mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
tests add root readonly test
This commit is contained in:
parent
6252037376
commit
b929e71948
@ -213,6 +213,26 @@ func TestStoreDeleteDiretory(t *testing.T) {
|
||||
assert.Equal(t, e.Action, "delete", "")
|
||||
}
|
||||
|
||||
func TestRootRdOnly(t *testing.T) {
|
||||
s := newStore()
|
||||
|
||||
_, err := s.Set("/", "", Permanent)
|
||||
assert.NotNil(t, err, "")
|
||||
|
||||
_, err = s.Delete("/", true)
|
||||
assert.NotNil(t, err, "")
|
||||
|
||||
_, err = s.Create("/", "", false, Permanent)
|
||||
assert.NotNil(t, err, "")
|
||||
|
||||
_, err = s.Update("/", "", Permanent)
|
||||
assert.NotNil(t, err, "")
|
||||
|
||||
_, err = s.CompareAndSwap("/", "", 0, "", Permanent)
|
||||
assert.NotNil(t, err, "")
|
||||
|
||||
}
|
||||
|
||||
// Ensure that the store cannot delete a directory if recursive is not specified.
|
||||
func TestStoreDeleteDiretoryFailsIfNonRecursive(t *testing.T) {
|
||||
s := newStore()
|
||||
|
Loading…
x
Reference in New Issue
Block a user