Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
add in some serial setup tests; a little make cleanup
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
  • Loading branch information
mikebrow committed May 18, 2022
commit 42cfe0f8dcae8919832c955502b1e9de32282f94
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ jobs:

- run: |
bash -x script/install-cni
make clean V=1
make bin/integration.test V=1
sudo make clean V=1
make test V=1
sudo make integration V=1
working-directory: src/github.com/containerd/go-cni
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,10 @@ help: ## this help
test: ## run tests, except integration tests and tests that require root
$(Q)go test -v -race $(EXTRA_TESTFLAGS) -count=1 ./...

integration: ## run integration test
integration: bin/integration.test ## run integration test
$(Q)bin/integration.test -test.v -test.count=1 -test.root $(EXTRA_TESTFLAGS) -test.parallel $(TESTFLAGS_PARALLEL)

FORCE:

bin/integration.test: FORCE ## build integration test binary into bin
bin/integration.test: ## build integration test binary into bin
$(Q)cd ./integration && go test -race -c . -o ../bin/integration.test

clean: ## clean up binaries
Expand Down
32 changes: 28 additions & 4 deletions integration/cni_setup_teardown_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,26 @@ func TestBasicSetupAndRemove(t *testing.T) {

// Setup network
result, err := l.Setup(ctx, id, nsPath)
assert.NoError(t, err, "[%v] setup network for namespace %v", idx, nsPath)
assert.NoError(t, err, "[%v] setup network interfaces for namespace in parallel %v", idx, nsPath)

ip := result.Interfaces[defaultIfName].IPConfigs[0].IP.String()
t.Logf("[%v] ip is %v", idx, ip)

assert.NoError(t,
l.Remove(ctx, id, nsPath),
"[%v] teardown network for namespace %v", idx, nsPath,
"[%v] teardown network interfaces for namespace %v", idx, nsPath,
)

// Setup network serially
result, err = l.SetupSerially(ctx, id, nsPath)
assert.NoError(t, err, "[%v] setup network interfaces for namespace serially%v", idx, nsPath)

ip = result.Interfaces[defaultIfName].IPConfigs[0].IP.String()
t.Logf("[%v] ip is %v", idx, ip)

assert.NoError(t,
l.Remove(ctx, id, nsPath),
"[%v] teardown network interfaces for namespace %v", idx, nsPath,
)
}
}
Expand Down Expand Up @@ -271,14 +283,26 @@ func TestBasicSetupAndRemovePluginWithoutVersion(t *testing.T) {

// Setup network
result, err := l.Setup(ctx, id, nsPath)
assert.NoError(t, err, "[%v] setup network for namespace %v", idx, nsPath)
assert.NoError(t, err, "[%v] setup network interfaces for namespace in parallel %v", idx, nsPath)

ip := result.Interfaces[defaultIfName].IPConfigs[0].IP.String()
t.Logf("[%v] ip is %v", idx, ip)

assert.NoError(t,
l.Remove(ctx, id, nsPath),
"[%v] teardown network for namespace %v", idx, nsPath,
"[%v] teardown network interfaces for namespace %v", idx, nsPath,
)

// Setup network serially
result, err = l.SetupSerially(ctx, id, nsPath)
assert.NoError(t, err, "[%v] setup network interfaces for namespace serially%v", idx, nsPath)

ip = result.Interfaces[defaultIfName].IPConfigs[0].IP.String()
t.Logf("[%v] ip is %v", idx, ip)

assert.NoError(t,
l.Remove(ctx, id, nsPath),
"[%v] teardown network interfaces for namespace %v", idx, nsPath,
)
}
}
Expand Down