source: MondoRescue/branches/2.2.10/mondo/test/test-truncname.c@ 2623

Last change on this file since 2623 was 2623, checked in by Bruno Cornec, 14 years ago

r3783@localhost: bruno | 2010-04-11 11:57:27 +0200

  • Use MINDI_CACHE for temp file communication between archive/restore
  • Remove some now useless globals in mondo
  • Remove function get_cfg_file_from_archive_or_bust and get_cfg_file_from_archive
  • Adds function get_cfg_file_from_initrd (Not finished)
  • Recovery doesn't work in that version atm (checkpoint version)
  • Property svn:eol-style set to native
File size: 1.7 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_filelist_full;
30char *g_filelist_imagedevs;
31char *g_imagedevs_restthese;
32
33char *g_mondo_home;
34
35char *g_getfacl;
36char *g_getfattr;
37
38extern char *MONDO_LOGFILE;
39extern char *truncate_to_drive_name(char *);
40/* We don't have a cleanup function yet */
41void (*mr_cleanup)(int) = NULL;
42void free_MR_global_filenames() {
43}
44
45int main() {
46
47char *part = NULL;
48char *disk = NULL;
49char *list[] = {
50 "/dev/sda99",
51 "/dev/hda12",
52 "/dev/cciss/c12d9p24",
53 "/dev/mapper/vg00lv02",
54 "/dev/mapper/dm-4",
55 "/dev/mapper/mpath4p19",
56 "/dev/mapper/part13",
57 "/dev/rd/c10d4p16",
58 "/dev/cciss/c1d12",
59 "/dev/mapper/mpath34",
60 NULL
61};
62int i;
63
64mr_asprintf(MONDO_LOGFILE,"/tmp/mrtest-truncname.log");
65
66/* Globals */
67g_loglevel = 99;
68g_text_mode = FALSE;
69g_main_pid = getpid();
70
71log_it("Begin loop");
72for (i=0; list[i] != NULL; i++) {
73 log_it("%d: partition %s ...",i, list[i]);
74 mr_asprintf(part,"%s",list[i]);
75 disk = truncate_to_drive_name(part);
76 log_it("...belongs to disk %s",disk);
77 mr_free(part);
78}
79log_it("end of loop");
80mr_free(MONDO_LOGFILE);
81exit(0);
82}
Note: See TracBrowser for help on using the repository browser.