public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] cpio_tests.sh: Fix failure with BusyBox cpio
@ 2020-12-21 11:01 Radoslav Kolev
  2020-12-22 17:10 ` Petr Vorel
  0 siblings, 1 reply; 7+ messages in thread
From: Radoslav Kolev @ 2020-12-21 11:01 UTC (permalink / raw)
  To: ltp

A very limited BusyBox cpio requires the archive format to be
explicitly set to newc when creating an archive.

Signed-off-by: Radoslav Kolev <radoslav.kolev@suse.com>
---
 testcases/commands/cpio/cpio_tests.sh | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/testcases/commands/cpio/cpio_tests.sh b/testcases/commands/cpio/cpio_tests.sh
index a1469d873..57b6d983c 100755
--- a/testcases/commands/cpio/cpio_tests.sh
+++ b/testcases/commands/cpio/cpio_tests.sh
@@ -8,6 +8,12 @@ TST_NEEDS_TMPDIR=1
 TST_NEEDS_CMDS="cpio"
 . tst_test.sh
 
+ARCHIVE_FORMAT=""
+
+if cpio 2>&1 | grep -q '\-o\sCreate (requires -H newc)'; then
+	ARCHIVE_FORMAT="-H newc"
+fi
+
 cpio_test()
 {
 	ROD mkdir "dir"
@@ -16,7 +22,7 @@ cpio_test()
 	done
 
 	ROD find dir -type f > filelist
-	EXPECT_PASS cpio -o \> cpio.out \< filelist
+	EXPECT_PASS cpio -o $ARCHIVE_FORMAT \> cpio.out \< filelist
 	ROD mv "dir" "dir_orig"
 	ROD mkdir "dir"
 	EXPECT_PASS cpio -i \< cpio.out
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-01-20 11:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-21 11:01 [LTP] [PATCH] cpio_tests.sh: Fix failure with BusyBox cpio Radoslav Kolev
2020-12-22 17:10 ` Petr Vorel
2021-01-05 11:12   ` Petr Vorel
2021-01-05 12:04     ` Radoslav Kolev
2021-01-20  7:19     ` Zhu Feiyu
2021-01-20  9:39       ` Petr Vorel
2021-01-20 11:00       ` Petr Vorel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox