libct/int: use destroyContainer

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin
2025-03-21 14:53:10 -07:00
parent 1aebfa3eab
commit 65e0f2b719
2 changed files with 6 additions and 8 deletions
+2 -4
View File
@@ -1373,9 +1373,7 @@ func testPidnsInitKill(t *testing.T, config *configs.Config) {
// Run a container with two long-running processes.
container, err := newContainer(t, config)
ok(t, err)
defer func() {
_ = container.Destroy()
}()
defer destroyContainer(container)
process1 := &libcontainer.Process{
Cwd: "/",
@@ -1796,7 +1794,7 @@ func TestBindMountAndUser(t *testing.T) {
container, err := newContainer(t, config)
ok(t, err)
defer container.Destroy() //nolint: errcheck
defer destroyContainer(container)
var stdout bytes.Buffer
+4 -4
View File
@@ -33,7 +33,7 @@ func TestSeccompDenySyslogWithErrno(t *testing.T) {
container, err := newContainer(t, config)
ok(t, err)
defer container.Destroy() //nolint:errcheck
defer destroyContainer(container)
buffers := newStdBuffers()
pwd := &libcontainer.Process{
@@ -81,7 +81,7 @@ func TestSeccompDenySyslog(t *testing.T) {
container, err := newContainer(t, config)
ok(t, err)
defer container.Destroy() //nolint:errcheck
defer destroyContainer(container)
buffers := newStdBuffers()
pwd := &libcontainer.Process{
@@ -136,7 +136,7 @@ func TestSeccompPermitWriteConditional(t *testing.T) {
container, err := newContainer(t, config)
ok(t, err)
defer container.Destroy() //nolint:errcheck
defer destroyContainer(container)
buffers := newStdBuffers()
dmesg := &libcontainer.Process{
@@ -188,7 +188,7 @@ func TestSeccompDenyWriteConditional(t *testing.T) {
container, err := newContainer(t, config)
ok(t, err)
defer container.Destroy() //nolint:errcheck
defer destroyContainer(container)
buffers := newStdBuffers()
dmesg := &libcontainer.Process{