rkt: Refactor the systemd interface.

Replace shell out calls with dbus API calls.
Remove unused 'Reload()'.
This commit is contained in:
Yifan Gu
2016-05-05 12:04:36 -07:00
parent 68097515d8
commit 3699b70b00
4 changed files with 28 additions and 41 deletions

View File

@@ -21,6 +21,7 @@ import (
"fmt"
"net"
"os"
"path/filepath"
"sort"
"testing"
"time"
@@ -1626,13 +1627,20 @@ func TestGarbageCollect(t *testing.T) {
sort.Sort(sortedStringList(tt.expectedServiceFiles))
sort.Sort(sortedStringList(fakeOS.Removes))
sort.Sort(sortedStringList(fs.resetFailedUnits))
assert.Equal(t, tt.expectedServiceFiles, fakeOS.Removes, testCaseHint)
var expectedService []string
for _, f := range tt.expectedServiceFiles {
expectedService = append(expectedService, filepath.Base(f))
}
assert.Equal(t, expectedService, fs.resetFailedUnits, testCaseHint)
// Cleanup after each test.
cli.Reset()
ctrl.Finish()
fakeOS.Removes = []string{}
fs.resetFailedUnits = []string{}
getter.pods = make(map[kubetypes.UID]*api.Pod)
}
}