Add tests for container graphs

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #557
Approved by: rhatdan
This commit is contained in:
Matthew Heon
2018-03-27 13:23:23 -04:00
committed by Atomic Bot
parent 120520af34
commit b1dfee50e8
4 changed files with 336 additions and 28 deletions

View File

@ -96,30 +96,6 @@ func runForAllStates(t *testing.T, testFunc func(*testing.T, State, string)) {
}
}
func getTestCtrN(n, lockPath string) (*Container, error) {
return getTestContainer(strings.Repeat(n, 32), "test"+n, lockPath)
}
func getTestCtr1(lockPath string) (*Container, error) {
return getTestCtrN("1", lockPath)
}
func getTestCtr2(lockPath string) (*Container, error) {
return getTestCtrN("2", lockPath)
}
func getTestPodN(n, lockPath string) (*Pod, error) {
return getTestPod(strings.Repeat(n, 32), "test"+n, lockPath)
}
func getTestPod1(lockPath string) (*Pod, error) {
return getTestPodN("1", lockPath)
}
func getTestPod2(lockPath string) (*Pod, error) {
return getTestPodN("2", lockPath)
}
func TestAddAndGetContainer(t *testing.T) {
runForAllStates(t, func(t *testing.T, state State, lockPath string) {
testCtr, err := getTestCtr1(lockPath)