From: Radoslav Kolev <radoslav.kolev@suse.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] cpio_tests.sh: Fix failure with BusyBox cpio
Date: Mon, 21 Dec 2020 13:01:20 +0200 [thread overview]
Message-ID: <20201221110120.26165-1-radoslav.kolev@suse.com> (raw)
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
next reply other threads:[~2020-12-21 11:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-21 11:01 Radoslav Kolev [this message]
2020-12-22 17:10 ` [LTP] [PATCH] cpio_tests.sh: Fix failure with BusyBox cpio 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201221110120.26165-1-radoslav.kolev@suse.com \
--to=radoslav.kolev@suse.com \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox