source: branches/2.2.9/mondo/test/test-truncname.c @ 2235

Last change on this file since 2235 was 2235, checked in by bruno, 10 years ago

r3132@localhost: bruno | 2009-06-19 16:10:49 +0200
Ads a test infrastruture for mountlist nd truncname

  • Property svn:eol-style set to native
File size: 1.8 KB
Line 
1/*
2 * $Id$
3 *
4 * Test program for mountlist management at restore time
5 * Cn be used on host system with valgrind easier than with mondorestore
6 */
7#include <stdio.h>
8#include "my-stuff.h"
9#include "mr_mem.h"
10#include "../common/mondostructures.h"
11#include "../common/libmondo.h"
12#include "../mondoarchive/mondoarchive.h"
13
14extern void twenty_seconds_til_yikes(void);
15
16/* Reference to global bkpinfo */
17struct s_bkpinfo *bkpinfo;
18
19extern bool g_text_mode;
20extern FILE *g_fprep;
21extern double g_kernel_version;
22extern int g_partition_table_locked_up;
23extern int g_noof_rows;
24
25bool g_ISO_restore_mode = FALSE;    /* are we in Iso Mode? */
26bool g_I_have_just_nuked = FALSE;
27char *g_isodir_device;
28char *g_isodir_format;
29char *g_biggielist_txt;
30char *g_filelist_full;
31char *g_filelist_imagedevs;
32char *g_imagedevs_restthese;
33
34char *g_mondo_cfg_file;
35
36char *g_mountlist_fname;
37char *g_mondo_home;
38
39char *g_getfacl;
40char *g_getfattr;
41
42extern char *MONDO_LOGFILE;
43extern char *truncate_to_drive_name(char *);
44/* We don't have a cleanup function yet */
45void (*mr_cleanup)(void) = NULL;
46void free_MR_global_filenames() {
47}
48
49void main() {
50
51char *part = NULL;
52char *disk = NULL;
53char *list[] = {
54        "/dev/sda99",
55        "/dev/hda12",
56        "/dev/cciss/c12d9p24",
57        "/dev/mapper/vg00lv02",
58        "/dev/mapper/dm-4",
59        "/dev/mapper/mpath4p19",
60        "/dev/mapper/part13",
61        "/dev/rd/c10d4p16",
62        "/dev/cciss/c1d12",
63        "/dev/mapper/mpath34",
64        "",
65        NULL
66};
67int i;
68
69mr_asprintf(&MONDO_LOGFILE,"/tmp/mrtest-truncname.log");
70
71/* Globals */
72g_loglevel = 99;
73g_text_mode = FALSE;
74g_main_pid = getpid();
75
76log_it("Begin loop");
77for (i=0; list[i] != NULL; i++) {
78    log_it("%d: partition %s ...",i, list[i]);
79    mr_asprintf(&part,"%s",list[i]);
80    disk = truncate_to_drive_name(part);
81    log_it(" belongs to disk %s",disk);
82    mr_free(part);
83}
84log_it("end of loop");
85mr_free(MONDO_LOGFILE);
86exit(0);
87}
Note: See TracBrowser for help on using the repository browser.