aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJakob Unterwurzacher2018-04-02 18:32:30 +0200
committerJakob Unterwurzacher2018-04-02 18:32:30 +0200
commitb6c8960b01f9e5366814b0dada57a0b1e6a031d9 (patch)
tree6a65255c30c7bcd086523fd4e0970d3b59b230de /tests
parente6caf56ea4ab10e747aa5dfc0a768cb8176ebe6a (diff)
fsck: clean up log output
Make sure we get only 1 warning output per problem. Also, add new corruption types to broken_fs_v1.4.
Diffstat (limited to 'tests')
-rw-r--r--tests/defaults/ctlsock_test.go2
-rw-r--r--tests/fsck/broken_fs_v1.4/Ef-68icxbQ-TuvmnWHuItB1BeLB92dNCXMXiz2M-zPIbin0 -> 18 bytes
-rw-r--r--tests/fsck/broken_fs_v1.4/V5DjvW5BXlGl1yCIJn4lPgdjdMvW_LUfc7G-R8W1cZ0bin0 -> 8 bytes
-rw-r--r--tests/fsck/broken_fs_v1.4/ejZ3FX0zlFTpSfv-FBJ2u3ojwSN1XSqpNpCHxa5VGWwbin0 -> 1 bytes
l---------tests/fsck/broken_fs_v1.4/iI0MtUdzELPeOAZYwYZFee169hpGgd3l2PXQBcc9sl41
-rw-r--r--tests/fsck/broken_fs_v1.4/trqecbMNXdzLqzpk7fSfKw/gocryptfs.diriv1
-rw-r--r--tests/fsck/broken_fs_v1.4/yrwcjj2qoC4IYvhw9sbfRg/gocryptfs.diriv1
-rw-r--r--tests/fsck/broken_fs_v1.4/yrwcjj2qoC4IYvhw9sbfRg/uC2yqKyQUXSJF-YF1Ya5nQ0
-rw-r--r--tests/fsck/fsck_test.go6
-rw-r--r--tests/reverse/ctlsock_test.go5
10 files changed, 7 insertions, 9 deletions
diff --git a/tests/defaults/ctlsock_test.go b/tests/defaults/ctlsock_test.go
index 13e6912..b987bf6 100644
--- a/tests/defaults/ctlsock_test.go
+++ b/tests/defaults/ctlsock_test.go
@@ -25,7 +25,7 @@ func TestCtlSock(t *testing.T) {
req.EncryptPath = "not-existing-dir/xyz"
response = test_helpers.QueryCtlSock(t, sock, req)
if response.ErrNo != int32(syscall.ENOENT) || response.Result != "" {
- t.Errorf("incorrect error handling: %+v", response)
+ t.Errorf("incorrect error handling: wanted ErrNo=%d, have %+v", syscall.ENOENT, response)
}
// Strange paths should not cause a crash
crashers := []string{"/foo", "foo/", "/foo/", ".", "/////", "/../../."}
diff --git a/tests/fsck/broken_fs_v1.4/Ef-68icxbQ-TuvmnWHuItB1BeLB92dNCXMXiz2M-zPI b/tests/fsck/broken_fs_v1.4/Ef-68icxbQ-TuvmnWHuItB1BeLB92dNCXMXiz2M-zPI
new file mode 100644
index 0000000..84b9a70
--- /dev/null
+++ b/tests/fsck/broken_fs_v1.4/Ef-68icxbQ-TuvmnWHuItB1BeLB92dNCXMXiz2M-zPI
Binary files differ
diff --git a/tests/fsck/broken_fs_v1.4/V5DjvW5BXlGl1yCIJn4lPgdjdMvW_LUfc7G-R8W1cZ0 b/tests/fsck/broken_fs_v1.4/V5DjvW5BXlGl1yCIJn4lPgdjdMvW_LUfc7G-R8W1cZ0
new file mode 100644
index 0000000..6101efa
--- /dev/null
+++ b/tests/fsck/broken_fs_v1.4/V5DjvW5BXlGl1yCIJn4lPgdjdMvW_LUfc7G-R8W1cZ0
Binary files differ
diff --git a/tests/fsck/broken_fs_v1.4/ejZ3FX0zlFTpSfv-FBJ2u3ojwSN1XSqpNpCHxa5VGWw b/tests/fsck/broken_fs_v1.4/ejZ3FX0zlFTpSfv-FBJ2u3ojwSN1XSqpNpCHxa5VGWw
new file mode 100644
index 0000000..f76dd23
--- /dev/null
+++ b/tests/fsck/broken_fs_v1.4/ejZ3FX0zlFTpSfv-FBJ2u3ojwSN1XSqpNpCHxa5VGWw
Binary files differ
diff --git a/tests/fsck/broken_fs_v1.4/iI0MtUdzELPeOAZYwYZFee169hpGgd3l2PXQBcc9sl4 b/tests/fsck/broken_fs_v1.4/iI0MtUdzELPeOAZYwYZFee169hpGgd3l2PXQBcc9sl4
new file mode 120000
index 0000000..4b707cb
--- /dev/null
+++ b/tests/fsck/broken_fs_v1.4/iI0MtUdzELPeOAZYwYZFee169hpGgd3l2PXQBcc9sl4
@@ -0,0 +1 @@
+%%%broken_symlink%%% \ No newline at end of file
diff --git a/tests/fsck/broken_fs_v1.4/trqecbMNXdzLqzpk7fSfKw/gocryptfs.diriv b/tests/fsck/broken_fs_v1.4/trqecbMNXdzLqzpk7fSfKw/gocryptfs.diriv
new file mode 100644
index 0000000..41f0034
--- /dev/null
+++ b/tests/fsck/broken_fs_v1.4/trqecbMNXdzLqzpk7fSfKw/gocryptfs.diriv
@@ -0,0 +1 @@
+Wc
diff --git a/tests/fsck/broken_fs_v1.4/yrwcjj2qoC4IYvhw9sbfRg/gocryptfs.diriv b/tests/fsck/broken_fs_v1.4/yrwcjj2qoC4IYvhw9sbfRg/gocryptfs.diriv
new file mode 100644
index 0000000..29198ce
--- /dev/null
+++ b/tests/fsck/broken_fs_v1.4/yrwcjj2qoC4IYvhw9sbfRg/gocryptfs.diriv
@@ -0,0 +1 @@
+LOã/;pl]Ù×n·ÌÙfooo
diff --git a/tests/fsck/broken_fs_v1.4/yrwcjj2qoC4IYvhw9sbfRg/uC2yqKyQUXSJF-YF1Ya5nQ b/tests/fsck/broken_fs_v1.4/yrwcjj2qoC4IYvhw9sbfRg/uC2yqKyQUXSJF-YF1Ya5nQ
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/fsck/broken_fs_v1.4/yrwcjj2qoC4IYvhw9sbfRg/uC2yqKyQUXSJF-YF1Ya5nQ
diff --git a/tests/fsck/fsck_test.go b/tests/fsck/fsck_test.go
index 7506636..b5bbf84 100644
--- a/tests/fsck/fsck_test.go
+++ b/tests/fsck/fsck_test.go
@@ -2,7 +2,6 @@ package fsck
import (
"os/exec"
- "strings"
"testing"
"github.com/rfjakob/gocryptfs/internal/exitcodes"
@@ -18,9 +17,4 @@ func TestBrokenFsV14(t *testing.T) {
if code != exitcodes.FsckErrors {
t.Errorf("wrong exit code, have=%d want=%d", code, exitcodes.FsckErrors)
}
- lines := strings.Split(out, "\n")
- summaryLine := lines[len(lines)-2]
- if summaryLine != "fsck: found 5 problems" {
- t.Errorf("wrong summary line: %q", summaryLine)
- }
}
diff --git a/tests/reverse/ctlsock_test.go b/tests/reverse/ctlsock_test.go
index d60fbde..6ccc724 100644
--- a/tests/reverse/ctlsock_test.go
+++ b/tests/reverse/ctlsock_test.go
@@ -2,6 +2,7 @@ package reverse_test
import (
"io/ioutil"
+ "syscall"
"testing"
"github.com/rfjakob/gocryptfs/internal/ctlsock"
@@ -58,12 +59,12 @@ func TestCtlSockPathOps(t *testing.T) {
// Check that we do not mix up information for different directories.
req = ctlsock.RequestStruct{DecryptPath: "gocryptfs.longname.y6rxCn6Id8hIZL2t_STpdLZpu-aE2HpprJR25xD60mk="}
response = test_helpers.QueryCtlSock(t, sock, req)
- if response.ErrNo != -1 {
+ if response.ErrNo != int32(syscall.ENOENT) {
t.Errorf("File should not exist: ErrNo=%d ErrText=%s", response.ErrNo, response.ErrText)
}
req = ctlsock.RequestStruct{DecryptPath: "v6puXntoQOk7Mhl8zJ4Idg==/gocryptfs.longname.ZQCAoi5li3xvDZRO8McBV0L_kzJc4IcAOEzuW-2S1Y4="}
response = test_helpers.QueryCtlSock(t, sock, req)
- if response.ErrNo != -1 {
+ if response.ErrNo != int32(syscall.ENOENT) {
t.Errorf("File should not exist: ErrNo=%d ErrText=%s", response.ErrNo, response.ErrText)
}
}