Unify fake runtime helper in kuberuntime, rkt and dockertools.

This commit is contained in:
Random-Liu
2017-02-26 20:07:49 -08:00
parent 7265908e7f
commit 0deec63d1a
11 changed files with 81 additions and 132 deletions

View File

@@ -585,7 +585,7 @@ func TestGetPodStatus(t *testing.T) {
fs := newFakeSystemd()
fnp := nettest.NewMockNetworkPlugin(ctrl)
fos := &containertesting.FakeOS{}
frh := &fakeRuntimeHelper{}
frh := &containertesting.FakeRuntimeHelper{}
r := &Runtime{
apisvc: fr,
systemd: fs,
@@ -1391,7 +1391,12 @@ func TestGenerateRunCommand(t *testing.T) {
for i, tt := range tests {
testCaseHint := fmt.Sprintf("test case #%d", i)
rkt.network = network.NewPluginManager(tt.networkPlugin)
rkt.runtimeHelper = &fakeRuntimeHelper{tt.dnsServers, tt.dnsSearches, tt.hostName, "", tt.err}
rkt.runtimeHelper = &containertesting.FakeRuntimeHelper{
DNSServers: tt.dnsServers,
DNSSearches: tt.dnsSearches,
HostName: tt.hostName,
Err: tt.err,
}
rkt.execer = &utilexec.FakeExec{CommandScript: []utilexec.FakeCommandAction{func(cmd string, args ...string) utilexec.Cmd {
return utilexec.InitFakeCmd(&utilexec.FakeCmd{}, cmd, args...)
}}}