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

Last change on this file since 2579 was 2236, checked in by Bruno Cornec, 11 years ago
  • Still trying to fix issue with mountlist analysis at restore time
  • 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        NULL
65};
66int i;
67
68mr_asprintf(&MONDO_LOGFILE,"/tmp/mrtest-truncname.log");
69
70/* Globals */
71g_loglevel = 99;
72g_text_mode = FALSE;
73g_main_pid = getpid();
74
75log_it("Begin loop");
76for (i=0; list[i] != NULL; i++) {
77    log_it("%d: partition %s ...",i, list[i]);
78    mr_asprintf(&part,"%s",list[i]);
79    disk = truncate_to_drive_name(part);
80    log_it("...belongs to disk %s",disk);
81    mr_free(part);
82}
83log_it("end of loop");
84mr_free(MONDO_LOGFILE);
85exit(0);
86}
Note: See TracBrowser for help on using the repository browser.