diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-03-23 17:24:52 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-03-23 17:24:52 +0900 |
| commit | 46059b1840fe08a887944f7f6bd085f83defe66e (patch) | |
| tree | 2a1f15a422b9e2a903d96562e95cd7e79a358de5 /test/sandbox | |
| parent | d2c329bceaf146da4cf5a619761c50491356a82d (diff) | |
test/sandbox: print mismatching file content
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'test/sandbox')
| -rw-r--r-- | test/sandbox/fs.go | 2 | ||||
| -rw-r--r-- | test/sandbox/fs_test.go | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/test/sandbox/fs.go b/test/sandbox/fs.go index fd1aa2c5..68dcecfb 100644 --- a/test/sandbox/fs.go +++ b/test/sandbox/fs.go @@ -84,6 +84,8 @@ func (s *FS) Compare(prefix string, e fs.FS) error { return err } else if string(v) != *want.Data { printf("[FAIL] f %s", name) + printf("got: %s", v) + printf("want: %s", *want.Data) return ErrFSBadData } printf("[ OK ] f %s", name) diff --git a/test/sandbox/fs_test.go b/test/sandbox/fs_test.go index 1262ddac..2b122c55 100644 --- a/test/sandbox/fs_test.go +++ b/test/sandbox/fs_test.go @@ -54,7 +54,7 @@ func TestCompare(t *testing.T) { }, &sandbox.FS{Dir: map[string]*sandbox.FS{"etc": {Mode: 0x800001c0, Dir: map[string]*sandbox.FS{ "passwd": {Mode: 0x1a4, Data: &fsGroupSample}, "group": {Mode: 0x1a4, Data: &fsGroupSample}, - }}}}, "[ OK ] f etc/group\x00[FAIL] f etc/passwd\x00", sandbox.ErrFSBadData}, + }}}}, "[ OK ] f etc/group\x00[FAIL] f etc/passwd\x00got: u0_a20:x:65534:65534:Fortify:/var/lib/persist/module/fortify/u0/a20:/run/current-system/sw/bin/zsh\x00want: fortify:x:65534:\x00", sandbox.ErrFSBadData}, } for _, tc := range testCases { |
