diff options
| author | Paweł Stołowski <stolowski@gmail.com> | 2022-02-11 14:32:17 +0100 |
|---|---|---|
| committer | Paweł Stołowski <stolowski@gmail.com> | 2022-02-23 17:23:34 +0100 |
| commit | b4b4ec6119ac1fae611402e7f5b79fe4a6046fcd (patch) | |
| tree | 8f55dbaefb60618a98916da82b5fd03aacdf7812 | |
| parent | 0905935a7e4921eb1805dee0ac8f45c683478d00 (diff) | |
Do not mock systemctl status.
| -rw-r--r-- | wrappers/core18_test.go | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/wrappers/core18_test.go b/wrappers/core18_test.go index f9dec2e01e..450ceed076 100644 --- a/wrappers/core18_test.go +++ b/wrappers/core18_test.go @@ -230,19 +230,7 @@ func (s *servicesTestSuite) TestAddSnapServicesForSnapdOnCorePreseeding(c *C) { dirs.SetRootDir(s.tempdir) systemctlRestorer := systemd.MockSystemctl(func(cmd ...string) ([]byte, error) { - s.sysdLog = append(s.sysdLog, cmd) - if cmd[0] == "show" && cmd[1] == "--property=Id,ActiveState,UnitFileState,Type" { - s := fmt.Sprintf("Type=oneshot\nId=%s\nActiveState=inactive\nUnitFileState=enabled\n", cmd[2]) - return []byte(s), nil - } - if len(cmd) == 2 && cmd[0] == "is-enabled" { - // pretend snapd.socket is disabled - if cmd[1] == "snapd.socket" { - return []byte("disabled"), &mockSystemctlError{msg: "disabled", exitCode: 1} - } - return []byte("enabled"), nil - } - return []byte("ActiveState=inactive\n"), nil + return nil, fmt.Errorf("not expected") }) defer systemctlRestorer() |
