source: MondoRescue/branches/3.2/mondo/test/test-truncname.c@ 3374

Last change on this file since 3374 was 3374, checked in by Bruno Cornec, 9 years ago
  • Fix compilation warnings and errors
  • 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
16extern bool g_text_mode;
17extern FILE *g_fprep;
18extern double g_kernel_version;
19extern int g_partition_table_locked_up;
20extern int g_noof_rows;
21
22/* Whether we should fail immediately at first error */
23bool g_fail_immediately = FALSE;
24
25bool g_ISO_restore_mode = FALSE; /* are we in Iso Mode? */
26bool g_I_have_just_nuked = FALSE;
27char *g_biggielist_txt;
28char *g_filelist_full;
29char *g_filelist_imagedevs;
30char *g_imagedevs_restthese;
31
32char *g_mondo_cfg_file;
33
34char *g_mountlist_fname;
35char *g_mondo_home;
36
37char *g_getfacl;
38char *g_getfattr;
39
40/* Reference to global bkpinfo */
41struct s_bkpinfo *bkpinfo;
42
43extern char *MONDO_LOGFILE;
44extern char *truncate_to_drive_name(const char *);
45/* We don't have a cleanup function yet */
46void (*mr_cleanup)(void) = NULL;
47void free_MR_global_filenames() {
48}
49
50int main() {
51
52char *part = NULL;
53char *disk = NULL;
54char *list[] = {
55 "/dev/sda99",
56 "/dev/hda12",
57 "/dev/cciss/c12d9p24",
58 "/dev/mapper/vg00lv02",
59 "/dev/mapper/dm-4",
60 "/dev/mapper/mpath4p19",
61 "/dev/mapper/part13",
62 "/dev/rd/c10d4p16",
63 "/dev/cciss/c1d12",
64 "/dev/mapper/mpath34",
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.