using namespace snapper;
-#define SUBVOLUME "/testsuite"
-
Snapper* sh = NULL;
Snapshots::iterator first;
initDefaultLogger();
- sh = new Snapper("testsuite");
+ sh = new Snapper(CONFIG);
}
void
first_snapshot()
{
- first = sh->createPreSnapshot("testsuite");
+ first = sh->createPreSnapshot(CONFIG);
first->setCleanup("number");
}
void
second_snapshot()
{
- second = sh->createPostSnapshot("testsuite", first);
+ second = sh->createPostSnapshot(CONFIG, first);
second->setCleanup("number");
}
#include <string>
+
+#define SUBVOLUME "/testsuite"
+#define CONFIG "testsuite"
+
+
using namespace std;
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();
// 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");