aboutsummaryrefslogtreecommitdiff
path: root/tests/cli/cli_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'tests/cli/cli_test.go')
-rw-r--r--tests/cli/cli_test.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/cli/cli_test.go b/tests/cli/cli_test.go
index eaa92b6..bd22a43 100644
--- a/tests/cli/cli_test.go
+++ b/tests/cli/cli_test.go
@@ -495,3 +495,26 @@ func TestExcludeForward(t *testing.T) {
}
t.Log(err)
}
+
+// Check that the config file can be read from a named pipe.
+// Make sure bug https://github.com/rfjakob/gocryptfs/issues/258 does not come
+// back.
+func TestConfigPipe(t *testing.T) {
+ dir := test_helpers.InitFS(t)
+ mnt := dir + ".mnt"
+ err := os.Mkdir(mnt, 0700)
+ if err != nil {
+ t.Fatal(err)
+ }
+ bashLine := fmt.Sprintf("%s -q -extpass \"echo test\" -config <(cat %s/gocryptfs.conf) %s %s", test_helpers.GocryptfsBinary, dir, dir, mnt)
+ cmd := exec.Command("bash", "-c", bashLine)
+ cmd.Stdout = os.Stdout
+ cmd.Stderr = os.Stdout
+ err = cmd.Run()
+ exitCode := test_helpers.ExtractCmdExitCode(err)
+ if exitCode != 0 {
+ t.Errorf("bash command\n%q\nresulted in exit code %d", bashLine, exitCode)
+ return
+ }
+ test_helpers.UnmountPanic(mnt)
+}