mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 22:37:14 +08:00
3f2333b667
This integration pkg adds a framework for writing integration tests aginst the libcontainer APIs Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
16 lines
298 B
Go
16 lines
298 B
Go
package utils
|
|
|
|
import "testing"
|
|
|
|
func TestGenerateName(t *testing.T) {
|
|
name, err := GenerateRandomName("veth", 5)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
|
|
expected := 5 + len("veth")
|
|
if len(name) != 5+len("veth") {
|
|
t.Fatalf("expected name to be %d chars but received %d", expected, len(name))
|
|
}
|
|
}
|