tests: matrix: add TestPwd
https://github.com/rfjakob/gocryptfs/issues/584
This commit is contained in:
parent
1dfd6b7b76
commit
eecbcbb090
@ -1,15 +1,10 @@
|
|||||||
// Tests run for (almost all) combinations of openssl, aessiv, plaintextnames.
|
// Tests run for (almost all) combinations of openssl, aessiv, plaintextnames.
|
||||||
package matrix
|
package matrix
|
||||||
|
|
||||||
// File reading, writing, modification, truncate
|
// File reading, writing, modification, truncate, ...
|
||||||
//
|
//
|
||||||
// Runs everything four times, for all combinations of
|
// Runs all tests N times, for the combinations of different flags specified
|
||||||
// "-plaintextnames" and "-openssl".
|
// in the `matrix` variable.
|
||||||
//
|
|
||||||
// Test Matrix:
|
|
||||||
// openssl=true openssl=false
|
|
||||||
// plaintextnames=false X X
|
|
||||||
// plaintextnames=true X X
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
@ -21,6 +16,7 @@ import (
|
|||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"syscall"
|
"syscall"
|
||||||
"testing"
|
"testing"
|
||||||
@ -901,3 +897,22 @@ func TestSymlinkSize(t *testing.T) {
|
|||||||
t.Errorf("wrong size: have %d, want %d", st.Size, 3)
|
t.Errorf("wrong size: have %d, want %d", st.Size, 3)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TestPwd check that /usr/bin/pwd works inside gocryptfs.
|
||||||
|
//
|
||||||
|
// This was broken in gocryptfs v2.0 with -sharedstorage:
|
||||||
|
// https://github.com/rfjakob/gocryptfs/issues/584
|
||||||
|
func TestPwd(t *testing.T) {
|
||||||
|
dir := test_helpers.DefaultPlainDir
|
||||||
|
for i := 0; i < 3; i++ {
|
||||||
|
cmd := exec.Command("pwd")
|
||||||
|
cmd.Dir = dir
|
||||||
|
out, err := cmd.CombinedOutput()
|
||||||
|
if err != nil {
|
||||||
|
t.Log(strings.TrimSpace(string(out)))
|
||||||
|
t.Fatalf("dir %q: %v", dir, err)
|
||||||
|
}
|
||||||
|
dir = dir + "/" + t.Name()
|
||||||
|
os.Mkdir(dir, 0700)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user