Log extra environment information (#95)
* Make metrics tests use a host port * fix port forwarding in devconfig tests * Log extra environment information at startup
This commit is contained in:
committed by
Stephen Marshall
parent
6996f2b9b3
commit
9f3032f014
41
vendor/github.com/genuinetools/amicontained/container/container_test.go
generated
vendored
Normal file
41
vendor/github.com/genuinetools/amicontained/container/container_test.go
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
package container
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestReadUserMappings(t *testing.T) {
|
||||
f := ` 0 100000 1000
|
||||
1000 1000 1
|
||||
1001 101001 64535`
|
||||
expected := []UserMapping{
|
||||
{
|
||||
ContainerID: 0,
|
||||
HostID: 100000,
|
||||
Range: 1000,
|
||||
},
|
||||
{
|
||||
ContainerID: 1000,
|
||||
HostID: 1000,
|
||||
Range: 1,
|
||||
},
|
||||
{
|
||||
ContainerID: 1001,
|
||||
HostID: 101001,
|
||||
Range: 64535,
|
||||
},
|
||||
}
|
||||
|
||||
userNs, mappings, err := readUserMappings(f)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if !userNs {
|
||||
t.Fatal("expected user namespaces to be true")
|
||||
}
|
||||
|
||||
if len(expected) != len(mappings) {
|
||||
t.Fatalf("expected length %d got %d", len(expected), len(mappings))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user