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

Last change on this file since 2204 was 2204, checked in by Bruno Cornec, 11 years ago

First set of improvements for mountlist management (test with valgrind). Fix errors on scanf usage. More to come.

  • Property svn:eol-style set to native
File size: 1.6 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    g_loglevel = 99;
48    g_text_mode = FALSE;
49    if (!(mountlist = malloc(sizeof(struct mountlist_itself)))) {
50        fatal_error("Cannot malloc mountlist");
51    }
52    if (!(raidlist = malloc(sizeof(struct raidlist_itself)))) {
53        fatal_error("Cannot malloc raidlist");
54    }
55    malloc_libmondo_global_strings();
56
57setup_newt_stuff();
58asprintf(&g_mountlist_fname, "/tmp/mountlist.txt");
59load_mountlist(mountlist, g_mountlist_fname);
60resize_mountlist_proportionately_to_suit_new_drives(mountlist);
61load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME);
62edit_mountlist(g_mountlist_fname, mountlist, raidlist);
63exit(0);
64}
Note: See TracBrowser for help on using the repository browser.