aboutsummaryrefslogtreecommitdiff
path: root/contrib/libarchive/cpio/test/test_option_passphrase.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/libarchive/cpio/test/test_option_passphrase.c')
-rw-r--r--contrib/libarchive/cpio/test/test_option_passphrase.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/contrib/libarchive/cpio/test/test_option_passphrase.c b/contrib/libarchive/cpio/test/test_option_passphrase.c
new file mode 100644
index 000000000000..28818cb6f05c
--- /dev/null
+++ b/contrib/libarchive/cpio/test/test_option_passphrase.c
@@ -0,0 +1,24 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2014 Michihiro NAKAJIMA
+ * All rights reserved.
+ */
+#include "test.h"
+
+DEFINE_TEST(test_option_passphrase)
+{
+ const char *reffile = "test_option_passphrase.zip";
+
+ extract_reference_file(reffile);
+ assertEqualInt(0,
+ systemf("%s -i --passphrase pass1 < %s >test.out 2>test.err",
+ testprog, reffile));
+
+ assertFileExists("file1");
+ assertTextFileContents("contents of file1.\n", "file1");
+ assertFileExists("file2");
+ assertTextFileContents("contents of file2.\n", "file2");
+ assertEmptyFile("test.out");
+ assertTextFileContents("1 block\n", "test.err");
+}