zfs: use exec.CommandContext everywhere

Co-authored-by: InsanePrawn <insane.prawny@gmail.com>
This commit is contained in:
InsanePrawn
2020-03-27 00:57:33 +01:00
committed by Christian Schwarz
parent 3187129672
commit 9568e46f05
24 changed files with 133 additions and 126 deletions

View File

@ -17,14 +17,14 @@ func GetNonexistent(ctx *platformtest.Context) {
`)
// test raw
_, err := zfs.ZFSGetRawAnySource(fmt.Sprintf("%s/foo bar", ctx.RootDataset), []string{"name"})
_, err := zfs.ZFSGetRawAnySource(ctx, fmt.Sprintf("%s/foo bar", ctx.RootDataset), []string{"name"})
if err != nil {
panic(err)
}
// test nonexistent filesystem
nonexistent := fmt.Sprintf("%s/nonexistent filesystem", ctx.RootDataset)
props, err := zfs.ZFSGetRawAnySource(nonexistent, []string{"name"})
props, err := zfs.ZFSGetRawAnySource(ctx, nonexistent, []string{"name"})
if err == nil {
panic(props)
}
@ -37,7 +37,7 @@ func GetNonexistent(ctx *platformtest.Context) {
// test nonexistent snapshot
nonexistent = fmt.Sprintf("%s/foo bar@non existent", ctx.RootDataset)
props, err = zfs.ZFSGetRawAnySource(nonexistent, []string{"name"})
props, err = zfs.ZFSGetRawAnySource(ctx, nonexistent, []string{"name"})
if err == nil {
panic(props)
}
@ -50,7 +50,7 @@ func GetNonexistent(ctx *platformtest.Context) {
// test nonexistent bookmark
nonexistent = fmt.Sprintf("%s/foo bar#non existent", ctx.RootDataset)
props, err = zfs.ZFSGetRawAnySource(nonexistent, []string{"name"})
props, err = zfs.ZFSGetRawAnySource(ctx, nonexistent, []string{"name"})
if err == nil {
panic(props)
}