Merge pull request #45354 from thaJeztah/c8d_test_fixes
containerd integration: some test-fixes
This commit is contained in:
commit
5745ba6a8e
2 changed files with 13 additions and 2 deletions
|
@ -22,9 +22,11 @@ func TestGetInspectData(t *testing.T) {
|
|||
linkIndex: newLinkIndex(),
|
||||
configStore: &config.Config{},
|
||||
}
|
||||
|
||||
if d.UsesSnapshotter() {
|
||||
t.Skip("does not apply to containerd snapshotters, which don't have RWLayer set")
|
||||
}
|
||||
_, err := d.getInspectData(c)
|
||||
assert.Check(t, is.ErrorContains(err, ""))
|
||||
assert.Check(t, is.ErrorContains(err, "RWLayer of container inspect-me is unexpectedly nil"))
|
||||
|
||||
c.Dead = true
|
||||
_, err = d.getInspectData(c)
|
||||
|
|
|
@ -33,6 +33,7 @@ func setupFakeDaemon(t *testing.T, c *container.Container) *Daemon {
|
|||
configStore: &config.Config{},
|
||||
linkIndex: newLinkIndex(),
|
||||
netController: netController,
|
||||
imageService: &fakeImageService{},
|
||||
}
|
||||
|
||||
c.Root = root
|
||||
|
@ -51,6 +52,14 @@ func setupFakeDaemon(t *testing.T, c *container.Container) *Daemon {
|
|||
return d
|
||||
}
|
||||
|
||||
type fakeImageService struct {
|
||||
ImageService
|
||||
}
|
||||
|
||||
func (i *fakeImageService) StorageDriver() string {
|
||||
return "overlay"
|
||||
}
|
||||
|
||||
func cleanupFakeContainer(c *container.Container) {
|
||||
_ = os.RemoveAll(c.Root)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue