tests: reverse: don't run tests that ignore "-plaintextnames" twice

TestMain() runs all tests twice, once with plaintextnames=true and once
with false. Several tests mount their own filesystem and ignore the
plaintextnames variable. It makes no sense to run them twice, so
skip execution when plaintextnames is set.
This commit is contained in:
Jakob Unterwurzacher 2017-03-07 20:53:58 +01:00
parent d48ccb3dda
commit a80d798c2d
2 changed files with 10 additions and 1 deletions

View File

@ -55,6 +55,9 @@ func TestSymlinks(t *testing.T) {
// Symbolic link dentry sizes should be set to the length of the string
// that contains the target path.
func TestSymlinkDentrySize(t *testing.T) {
if plaintextnames {
t.Skip("this only tests encrypted names")
}
symlink := "a_symlink"
mnt, err := ioutil.TempDir(test_helpers.TmpDir, "reverse_mnt_")
@ -108,7 +111,7 @@ func TestConfigMapping(t *testing.T) {
// Check that the access() syscall works on virtual files
func TestAccessVirtual(t *testing.T) {
if plaintextnames {
t.Skip()
t.Skip("test makes no sense for plaintextnames")
}
var R_OK uint32 = 4
var W_OK uint32 = 2

View File

@ -24,6 +24,9 @@ var ctlSockTestCases = [][]string{
// Test DecryptPath and EncryptPath
func TestCtlSockPathOps(t *testing.T) {
if plaintextnames {
t.Skip("this only tests encrypted names")
}
mnt, err := ioutil.TempDir(test_helpers.TmpDir, "reverse_mnt_")
if err != nil {
t.Fatal(err)
@ -54,6 +57,9 @@ func TestCtlSockPathOps(t *testing.T) {
// We should not panic when somebody feeds requests that make no sense
func TestCtlSockCrash(t *testing.T) {
if plaintextnames {
t.Skip("this only tests encrypted names")
}
mnt, err := ioutil.TempDir(test_helpers.TmpDir, "reverse_mnt_")
if err != nil {
t.Fatal(err)