File: test-dump-filtered.sh

package info (click to toggle)
composefs 1.0.8-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 11,040 kB
  • sloc: ansic: 9,004; sh: 416; python: 225; makefile: 5
file content (22 lines) | stat: -rwxr-xr-x 724 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash

BINDIR="$1"
ASSET_DIR="$2"

. $(dirname $0)/test-lib.sh

set -eu
tmpd=$(mktemp -d)
trap 'rm -rf -- "$tmpd"' EXIT

${BINDIR}/mkcomposefs --from-file $ASSET_DIR/special.dump $tmpd/out.cfs
${BINDIR}/composefs-info --filter=chardev --filter=inline --filter=whiteout dump $tmpd/out.cfs > $tmpd/dump.txt
foundlines=$(wc -l < $tmpd/dump.txt)
if test "${foundlines}" != "4"; then
    fatal "Filtered dump failed, expected 4 lines, found $foundlines"
fi
assert_file_has_content $tmpd/dump.txt '^/ 4096 40555.*trusted.foo1'
assert_file_has_content $tmpd/dump.txt '^/chardev 0 20777'
assert_file_has_content $tmpd/dump.txt '^/inline 15 100777.*FOOBAR'
assert_file_has_content $tmpd/dump.txt '^/whiteout 0 20777'
echo "ok"