node-api/containers/docker_test.go
Adam Štrauch 1fb659b1e6
Some checks failed
continuous-integration/drone/push Build is failing
Wait for the container
2022-02-06 01:40:04 +01:00

34 lines
689 B
Go

package containers
import (
"testing"
"time"
"github.com/stretchr/testify/assert"
)
func TestGetProcesses(t *testing.T) {
driver := Driver{
//DockerSock: "unix:///run/user/1000/podman/podman.sock",
DockerSock: "unix:///var/run/docker.sock",
BindIPHTTP: "127.0.0.1",
BindIPSSH: "127.0.0.1",
}
driver.Remove("test")
_, err := driver.Create("test", "docker.io/library/busybox", "/tmp", 8990, 8922, 1, 128, []string{"sleep", "3600"})
assert.Nil(t, err)
err = driver.Start("test")
assert.Nil(t, err)
time.Sleep(5 * time.Second)
processes, err := driver.GetProcesses("test")
assert.Nil(t, err)
assert.Contains(t, processes, "sleep 3600")
driver.Remove("test")
}