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

@ -1,6 +1,7 @@
package zfs
import (
"context"
"testing"
"github.com/stretchr/testify/assert"
@ -11,9 +12,11 @@ func TestZFSListHandlesProducesZFSErrorOnNonZeroExit(t *testing.T) {
var err error
ctx := context.Background()
ZFS_BINARY = "./test_helpers/zfs_failer.sh"
_, err = ZFSList([]string{"fictionalprop"}, "nonexistent/dataset")
_, err = ZFSList(ctx, []string{"fictionalprop"}, "nonexistent/dataset")
assert.Error(t, err)
zfsError, ok := err.(*ZFSError)