diff --git a/a_test.go b/a_test.go index 28f9aad..da96b49 100644 --- a/a_test.go +++ b/a_test.go @@ -24,6 +24,7 @@ func Test(t *testing.T) { zfsTestDatasetOpen(t) zfsTestDatasetSnapshot(t) zfsTestDatasetOpenAll(t) + zfsTestDatasetSetProperty(t) zfsTestDatasetDestroy(t) diff --git a/common.go b/common.go index b7949d0..81a4e6d 100644 --- a/common.go +++ b/common.go @@ -246,6 +246,10 @@ const ( DatasetPropLogicalused DatasetPropLogicalreferenced DatasetPropInconsistent /* not exposed to the user */ + DatasetPropFilesystemLimit + DatasetPropSnapshotLimit + DatasetPropFilesystemCount + DatasetPropSnapshotCount DatasetPropSnapdev DatasetPropAcltype DatasetPropSelinuxContext diff --git a/zfs_test.go b/zfs_test.go index 7a64992..22628ac 100644 --- a/zfs_test.go +++ b/zfs_test.go @@ -93,6 +93,32 @@ func zfsTestDatasetOpen(t *testing.T) { print("PASS\n\n") } +func zfsTestDatasetSetProperty(t *testing.T) { + println("TEST Dataset SetProp(", TSTDatasetPath, ") ... ") + d, err := zfs.DatasetOpen(TSTDatasetPath) + if err != nil { + t.Error(err) + return + } + defer d.Close() + if err = d.SetProperty(zfs.DatasetPropOverlay, "on"); err != nil { + t.Error(err) + return + } + if prop, err := d.GetProperty(zfs.DatasetPropOverlay); err != nil { + t.Error(err) + return + } else { + println(prop.Value) + if prop.Value != "on" { + t.Error(fmt.Errorf("Update of dataset property failed")) + return + } + } + print("PASS\n\n") + return +} + func zfsTestDatasetOpenAll(t *testing.T) { println("TEST DatasetOpenAll()/DatasetCloseAll() ... ") ds, err := zfs.DatasetOpenAll() diff --git a/zpool_test.go b/zpool_test.go index 3ea75eb..72e9aff 100644 --- a/zpool_test.go +++ b/zpool_test.go @@ -274,9 +274,9 @@ func zpoolTestPoolProp(t *testing.T) { if pool, err := zfs.PoolOpen(TSTPoolName); err == nil { defer pool.Close() // Turn on snapshot listing for pool - pool.SetProperty(zfs.PoolPropListsnaps, "on") + pool.SetProperty(zfs.PoolPropListsnaps, "off") // Verify change is succesfull - if pool.Properties[zfs.PoolPropListsnaps].Value != "on" { + if pool.Properties[zfs.PoolPropListsnaps].Value != "off" { t.Error(fmt.Errorf("Update of pool property failed")) return }