summaryrefslogtreecommitdiff
path: root/tar
diff options
context:
space:
mode:
authorArshan Khanifar <arshankhanifar@gmail.com>2018-02-07 12:59:57 -0500
committerArshan Khanifar <arshankhanifar@gmail.com>2018-02-07 12:59:57 -0500
commit64c49d77bcde1b86417ce5b4e45bd2d540f2dddd (patch)
treeaa2005a29a7a24b7f74a3410275346ed3cb56353 /tar
parent9b32b6ec3040da1748484acdf00147596ff46fb9 (diff)
downloadlibarchive-64c49d77bcde1b86417ce5b4e45bd2d540f2dddd.tar.gz
absolute path fix
Diffstat (limited to 'tar')
-rw-r--r--tar/test/test_option_C_mtree.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/tar/test/test_option_C_mtree.c b/tar/test/test_option_C_mtree.c
index fb644a41..dc2692ac 100644
--- a/tar/test/test_option_C_mtree.c
+++ b/tar/test/test_option_C_mtree.c
@@ -33,19 +33,24 @@ DEFINE_TEST(test_option_C_mtree)
char *p0;
size_t s;
int r;
-
p0 = NULL;
-
char *content = "./foo type=file uname=root gname=root mode=0755\n";
+ char *filename = "output.tar";
+ /* an absolute path to mtree file */
+ char *mtree_file = "/METALOG.mtree";
+ char *absolute_path = malloc(strlen(testworkdir) + strlen(mtree_file) + 1);
+ strcpy(absolute_path, testworkdir);
+ strcat(absolute_path, mtree_file );
+
/* Create an archive using an mtree file. */
- assertMakeFile("/tmp/METALOG.mtree", 0777, content);
+ assertMakeFile(absolute_path, 0777, content);
assertMakeDir("bar", 0775);
assertMakeFile("bar/foo", 0777, "abc");
- r = systemf("%s -cf output.tar -C bar @/tmp/METALOG.mtree >step1.out 2>step1.err", testprog);
+ r = systemf("%s -cf %s -C bar @%s >step1.out 2>step1.err", testprog, filename, absolute_path);
- failure("Error invoking %s -cf output.tar -C bar @/tmp/METALOG.mtree", testprog);
+ failure("Error invoking %s -cf %s -C bar @%s", testprog, filename, absolute_path);
assertEqualInt(r, 0);
assertEmptyFile("step1.out");
assertEmptyFile("step1.err");