File: test-SKIPCPIO-introduce-cpio_create-function.patch

package info (click to toggle)
dracut 108-5
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 5,400 kB
  • sloc: sh: 25,008; ansic: 5,202; makefile: 348; perl: 186; python: 28; javascript: 19
file content (47 lines) | stat: -rw-r--r-- 1,571 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
From: Benjamin Drung <benjamin.drung@canonical.com>
Date: Thu, 25 Sep 2025 11:44:38 +0200
Subject: test(SKIPCPIO): introduce cpio_create function

In preparation to support 3cpio as alternative archive tool, move the
cpio creation call into `cpio_create`.

Forwarded: https://github.com/dracut-ng/dracut-ng/pull/1705
---
 test/TEST-81-SKIPCPIO/test.sh | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/test/TEST-81-SKIPCPIO/test.sh b/test/TEST-81-SKIPCPIO/test.sh
index 99e6774..877317f 100755
--- a/test/TEST-81-SKIPCPIO/test.sh
+++ b/test/TEST-81-SKIPCPIO/test.sh
@@ -10,6 +10,10 @@ test_check() {
     (command -v cpio && command -v find && command -v diff) &> /dev/null
 }
 
+cpio_create() {
+    find . -print0 | sort -z | cpio -o --null -H newc
+}
+
 cpio_list_first() {
     local file="$1"
     cpio --extract --quiet --list < "$file"
@@ -22,8 +26,7 @@ skipcpio_simple() {
     for ((i = 0; i < 3; i++)); do
         echo "first archive file $i" >> ./"$i"
     done
-    find . -print0 | sort -z \
-        | cpio -o --null -H newc > "$CPIO_TESTDIR/skipcpio_simple.cpio"
+    cpio_create > "$CPIO_TESTDIR/skipcpio_simple.cpio"
     popd
 
     mkdir -p "$CPIO_TESTDIR/skipcpio_simple/second_archive"
@@ -33,8 +36,7 @@ skipcpio_simple() {
         echo "second archive file $i" >> ./"$i"
     done
 
-    find . -print0 | sort -z \
-        | cpio -o --null -H newc >> "$CPIO_TESTDIR/skipcpio_simple.cpio"
+    cpio_create >> "$CPIO_TESTDIR/skipcpio_simple.cpio"
     popd
 
     cpio_list_first "$CPIO_TESTDIR/skipcpio_simple.cpio" \