source: MondoRescue/branches/2.2.9/mondo/test/test-mountlist.c@ 2206

Last change on this file since 2206 was 2206, checked in by Bruno Cornec, 15 years ago

-Improvements in tests for mountlist

  • escape remaining chars [{&...
  • Property svn:eol-style set to native
File size: 1.9 KB
Line 
1#include <stdio.h>
2#include "my-stuff.h"
3#include "../common/mondostructures.h"
4#include "../common/libmondo.h"
5#include "../mondorestore/mondorestore.h"
6#include "../mondorestore/mr-externs.h"
7
8extern void twenty_seconds_til_yikes(void);
9
10/* Reference to global bkpinfo */
11struct s_bkpinfo *bkpinfo;
12
13extern bool g_text_mode;
14extern FILE *g_fprep;
15extern double g_kernel_version;
16extern int g_partition_table_locked_up;
17extern int g_noof_rows;
18
19bool g_ISO_restore_mode = FALSE; /* are we in Iso Mode? */
20bool g_I_have_just_nuked = FALSE;
21char *g_isodir_device;
22char *g_isodir_format;
23char *g_biggielist_txt;
24char *g_filelist_full;
25char *g_filelist_imagedevs;
26char *g_imagedevs_restthese;
27
28char *g_mondo_cfg_file;
29
30char *g_mountlist_fname;
31char *g_mondo_home;
32
33char *g_getfacl;
34char *g_getfattr;
35
36extern char *MONDO_LOGFILE;
37extern int copy_from_src_to_dest(FILE * f_orig, FILE * f_archived,
38 char direction);
39
40void main() {
41
42 struct mountlist_itself *mountlist = NULL;
43 struct raidlist_itself *raidlist;
44
45 asprintf(&MONDO_LOGFILE,"/tmp/mrtest-mountlist.log");
46
47 /* Globals */
48 g_loglevel = 99;
49 g_text_mode = FALSE;
50 g_main_pid = getpid();
51
52 if (!(mountlist = malloc(sizeof(struct mountlist_itself)))) {
53 fatal_error("Cannot malloc mountlist");
54 }
55 if (!(raidlist = malloc(sizeof(struct raidlist_itself)))) {
56 fatal_error("Cannot malloc raidlist");
57 }
58 malloc_libmondo_global_strings();
59
60setup_newt_stuff();
61asprintf(&g_mountlist_fname, "/tmp/mountlist.txt");
62log_it("before mountlist");
63load_mountlist(mountlist, g_mountlist_fname);
64log_it("after mountlist");
65resize_mountlist_proportionately_to_suit_new_drives(mountlist);
66log_it("after resize_mountlist_proportionately_to_suit_new_drives");
67load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME);
68log_it("after load_raidtab_into_raidlist");
69edit_mountlist(g_mountlist_fname, mountlist, raidlist);
70log_it("after edit_mountlist");
71exit(0);
72}
Note: See TracBrowser for help on using the repository browser.