summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/cli/cli_test.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/cli/cli_test.go b/tests/cli/cli_test.go
index 7b6736a..da9d508 100644
--- a/tests/cli/cli_test.go
+++ b/tests/cli/cli_test.go
@@ -7,6 +7,7 @@ import (
"io/ioutil"
"os"
"os/exec"
+ "strconv"
"syscall"
"testing"
"time"
@@ -92,6 +93,9 @@ func TestInitReverse(t *testing.T) {
}
}
+// testPasswd changes the password from "test" to "test" using
+// the -extpass method, then from "test" to "newpasswd" using the
+// stdin method.
func testPasswd(t *testing.T, dir string, extraArgs ...string) {
// Change password using "-extpass"
args := []string{"-q", "-passwd", "-extpass", "echo test"}
@@ -225,6 +229,23 @@ func TestPasswdReverse(t *testing.T) {
testPasswd(t, dir, "-reverse")
}
+// Test -passwd with -scryptn
+func TestPasswdScryptn(t *testing.T) {
+ dir := test_helpers.InitFS(t)
+ cf, err := configfile.Load(dir + "/gocryptfs.conf")
+ if err != nil {
+ t.Fatal(err)
+ }
+ testPasswd(t, dir, "-scryptn", strconv.Itoa(cf.ScryptObject.LogN()+1))
+ cf2, err := configfile.Load(dir + "/gocryptfs.conf")
+ if err != nil {
+ t.Fatal(err)
+ }
+ if cf2.ScryptObject.LogN() != cf.ScryptObject.LogN()+1 {
+ t.Errorf("wrong logN value %d", cf2.ScryptObject.LogN())
+ }
+}
+
// Test -init & -config flag
func TestInitConfig(t *testing.T) {
config := test_helpers.TmpDir + "/TestInitConfig.conf"