]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- use a define for config and subvolume
authorArvin Schnell <aschnell@suse.de>
Tue, 23 Apr 2013 10:02:28 +0000 (12:02 +0200)
committerArvin Schnell <aschnell@suse.de>
Tue, 23 Apr 2013 10:02:28 +0000 (12:02 +0200)
testsuite-real/common.cc
testsuite-real/common.h
testsuite-real/xattrs1.cc
testsuite-real/xattrs2.cc

index 7c1da5ced536bd0b1a2851b28e5d16e0f2fa2592..86b714e196b42ab27c773c2fdb901f18c137623e 100644 (file)
@@ -20,8 +20,6 @@ extern char* program_invocation_short_name;
 
 using namespace snapper;
 
-#define SUBVOLUME "/testsuite"
-
 Snapper* sh = NULL;
 
 Snapshots::iterator first;
@@ -41,7 +39,7 @@ setup()
 
     initDefaultLogger();
 
-    sh = new Snapper("testsuite");
+    sh = new Snapper(CONFIG);
 }
 
 
@@ -55,7 +53,7 @@ cleanup()
 void
 first_snapshot()
 {
-    first = sh->createPreSnapshot("testsuite");
+    first = sh->createPreSnapshot(CONFIG);
     first->setCleanup("number");
 }
 
@@ -63,7 +61,7 @@ first_snapshot()
 void
 second_snapshot()
 {
-    second = sh->createPostSnapshot("testsuite", first);
+    second = sh->createPostSnapshot(CONFIG, first);
     second->setCleanup("number");
 }
 
index 7ea57107864369c8b82f3360b7f980dedd98a894..f51340ccdbd4dde227fac8973f82a033bdc347ce 100644 (file)
@@ -1,6 +1,11 @@
 
 #include <string>
 
+
+#define SUBVOLUME "/testsuite"
+#define CONFIG "testsuite"
+
+
 using namespace std;
 
 
index aab01f23560bb99f90696462c4c6fc7c07b9be22..d10d0ee152b87fecf3a3b4d1e01d27bf0b4cdd01 100644 (file)
@@ -15,15 +15,15 @@ main()
     run_command("touch file1");
     run_command("setfacl -b file1");
     run_command("setfacl -m u:nobody:rw file1");
-    xattr_create("user.aaa", "aaa-value", "/testsuite/file1");
-    xattr_create("user.bbb", "bbb-value", "/testsuite/file1");
+    xattr_create("user.aaa", "aaa-value", SUBVOLUME "/file1");
+    xattr_create("user.bbb", "bbb-value", SUBVOLUME "/file1");
 
     first_snapshot();
 
     run_command("setfacl -b file1");
-    xattr_remove("user.aaa","/testsuite/file1");
-    xattr_replace("user.bbb", "bbb-new-value", "/testsuite/file1");
-    xattr_create("user.ccc", "ccc-value", "/testsuite/file1");
+    xattr_remove("user.aaa", SUBVOLUME "/file1");
+    xattr_replace("user.bbb", "bbb-new-value", SUBVOLUME "/file1");
+    xattr_create("user.ccc", "ccc-value", SUBVOLUME "/file1");
 
     second_snapshot();
 
index 97f88a5f303006069ee4418438bfb19a091e25de..09af99da5b6b54664ef15e78bb4c88eb3cf6d4fa 100644 (file)
@@ -20,17 +20,17 @@ main()
 
     // user.* namespace is allowed only for regular files and directories (restricted by VFS)
     // security namespace is verified to work with symlinks on ext4 and btrfs
-    xattr_create("security.aaa", "aaa-value", "/testsuite/first");
-    xattr_create("security.bbb", "aaa-value", "/testsuite/second");
-    xattr_create("security.ccc", "ccc-value", "/testsuite/first-link");
-    xattr_create("user.aaa", "aaa-value", "/testsuite/delete-me");
+    xattr_create("security.aaa", "aaa-value", SUBVOLUME "/first");
+    xattr_create("security.bbb", "aaa-value", SUBVOLUME "/second");
+    xattr_create("security.ccc", "ccc-value", SUBVOLUME "/first-link");
+    xattr_create("user.aaa", "aaa-value", SUBVOLUME "/delete-me");
 
     first_snapshot();
 
     // change type of 'first', preserve security.aaa xa
     run_command("rmdir first");
     run_command("touch first");
-    xattr_create("security.aaa", "aaa-value", "/testsuite/first");
+    xattr_create("security.aaa", "aaa-value", SUBVOLUME "/first");
 
     // change type of 'second', remove security.bbb xa
     run_command("rm second");