aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTim Kientzle <kientzle@FreeBSD.org>2008-08-22 01:26:55 +0000
committerTim Kientzle <kientzle@FreeBSD.org>2008-08-22 01:26:55 +0000
commitba1a63391274e6ef2402285dca6c87bdcb7834ca (patch)
tree22621fd57101cdbca581512d1b6cc4301826e20c /usr.bin
parent38734246848de01957b066ca4487817e3de62a40 (diff)
Notes
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tar/test/test_option_q.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/usr.bin/tar/test/test_option_q.c b/usr.bin/tar/test/test_option_q.c
index 7ce75e6a08a1..d1651194807e 100644
--- a/usr.bin/tar/test/test_option_q.c
+++ b/usr.bin/tar/test/test_option_q.c
@@ -29,6 +29,16 @@ DEFINE_TEST(test_option_q)
{
int fd;
+ /*
+ * Create an archive with several different versions of the
+ * same files. By default, the last version will overwrite
+ * any earlier versions. The -q/--fast-read option will
+ * stop early, so we can verify -q/--fast-read by seeing
+ * which version of each file actually ended up being
+ * extracted. This also exercises -r mode, since that's
+ * what we use to build up the test archive.
+ */
+
fd = open("foo", O_CREAT | O_WRONLY, 0644);
assert(fd >= 0);
assertEqualInt(4, write(fd, "foo1", 4));
@@ -64,6 +74,11 @@ DEFINE_TEST(test_option_q)
assertEqualInt(0, systemf("%s -rf archive.tar bar", testprog));
+ /*
+ * Now, try extracting from the test archive with various
+ * combinations of -q.
+ */
+
/* Test 1: -q foo should only extract the first foo. */
assertEqualInt(0, mkdir("test1", 0755));
assertEqualInt(0, chdir("test1"));