diff options
author | Jakob Unterwurzacher | 2016-06-16 21:29:22 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2016-06-16 21:29:22 +0200 |
commit | 82d87ff8eda1a8e43cda4a5f500fc579477ee606 (patch) | |
tree | 6faccc15d46a1120409bb2baee6134c542e917df /tests | |
parent | 305e9c1045f0546967bfbd2d10f13a28b6227a76 (diff) |
Add "-ro" (read-only) flag
From the man page:
**-ro**
: Mount the filesystem read-only
Also add a test.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/integration_tests/cli_test.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/integration_tests/cli_test.go b/tests/integration_tests/cli_test.go index ae6ef7f..0246901 100644 --- a/tests/integration_tests/cli_test.go +++ b/tests/integration_tests/cli_test.go @@ -102,3 +102,21 @@ func TestInitPlaintextNames(t *testing.T) { t.Error("FlagEMENames and FlagDirIV should be not set") } } + +// Test -ro +func TestRo(t *testing.T) { + dir := test_helpers.InitFS(t) + mnt := dir + ".mnt" + test_helpers.MountOrFatal(t, dir, mnt, "-ro", "-extpass=echo test") + defer test_helpers.Unmount(mnt) + + file := mnt + "/file" + err := os.Mkdir(file, 0777) + if err == nil { + t.Errorf("Mkdir should have failed") + } + _, err = os.Create(file) + if err == nil { + t.Errorf("Create should have failed") + } +} |