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
38 changes: 19 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,12 @@ nogo-tests:
#
# FIXME(gvisor.dev/issue/10045): Need to fix broken tests.
unit-tests: ## Local package unit tests in pkg/..., tools/.., etc.
@$(call test,--test_tag_filters=-nogo$(COMMA)-requires-kvm --build_tag_filters=-network_plugins -- //:all pkg/... tools/... runsc/... vdso/... test/trace/... -//pkg/metric:metric_test -//pkg/coretag:coretag_test -//tools/tracereplay:tracereplay_test -//test/trace:trace_test)
@$(call test,--test_tag_filters=-nogo$(COMMA)-requires-kvm --build_tag_filters=-network_plugins --test_env=CGROUPV2=$(CGROUPV2) -- //:all pkg/... tools/... runsc/... vdso/... test/trace/... -//pkg/metric:metric_test -//pkg/coretag:coretag_test -//tools/tracereplay:tracereplay_test -//test/trace:trace_test)
.PHONY: unit-tests

# See unit-tests: this includes runsc/container.
container-tests: ## Run all tests in runsc/container/...
@$(call test,--test_tag_filters=-nogo runsc/container/...)
@$(call test,--test_tag_filters=-nogo --test_env=CGROUPV2=$(CGROUPV2) runsc/container/...)
.PHONY: container-tests

tests: ## Runs all unit tests and syscall tests.
Expand Down Expand Up @@ -366,45 +366,45 @@ docker-tests: load-basic $(RUNTIME_BIN)
@$(call install_runtime,$(RUNTIME)-host-uds,--host-uds=all) # Used by TestHostSocketConnect.
@$(call install_runtime,$(RUNTIME)-overlay,--overlay2=all:self) # Used by TestOverlay*.
@$(call install_runtime,$(RUNTIME)-save-restore-netstack,--save-restore-netstack=true) # Used by TestRestoreListenConnWithNetstackSR.
@$(call test_runtime,$(RUNTIME),$(INTEGRATION_TARGETS) --test_env=TEST_SAVE_RESTORE_NETSTACK=true //test/e2e:integration_runtime_test //test/e2e:runtime_in_docker_test)
@$(call test_runtime_cached,$(RUNTIME),$(INTEGRATION_TARGETS) --test_env=TEST_SAVE_RESTORE_NETSTACK=true //test/e2e:integration_runtime_test //test/e2e:runtime_in_docker_test)
.PHONY: docker-tests

plugin-network-tests: load-basic $(RUNTIME_BIN)
@$(call install_runtime,$(RUNTIME),--network=plugin)
@$(call test_runtime,$(RUNTIME), --test_arg=-test.run=ConnectToSelf $(INTEGRATION_TARGETS))
@$(call install_runtime,$(RUNTIME)-dpdk,--network=plugin)
@$(call test_runtime_cached,$(RUNTIME)-dpdk, --test_arg=-test.run=ConnectToSelf $(INTEGRATION_TARGETS))

plugin-network-tests: RUNSC_TARGET=--config plugin-tldk //runsc:runsc-plugin-stack

overlay-tests: load-basic $(RUNTIME_BIN)
@$(call install_runtime,$(RUNTIME),--overlay2=all:dir=/tmp)
@$(call install_runtime,$(RUNTIME)-docker,--net-raw --overlay2=all:dir=/tmp)
@$(call test_runtime,$(RUNTIME),--test_env=TEST_OVERLAY=true $(INTEGRATION_TARGETS))
@$(call install_runtime,$(RUNTIME)-overlay,--overlay2=all:dir=/tmp)
@$(call install_runtime,$(RUNTIME)-overlay-docker,--net-raw --overlay2=all:dir=/tmp)
@$(call test_runtime_cached,$(RUNTIME)-overlay,--test_env=TEST_OVERLAY=true $(INTEGRATION_TARGETS))
.PHONY: overlay-tests

swgso-tests: load-basic $(RUNTIME_BIN)
@$(call install_runtime,$(RUNTIME),--software-gso=true --gso=false)
@$(call install_runtime,$(RUNTIME)-docker,--net-raw --software-gso=true --gso=false)
@$(call test_runtime,$(RUNTIME),$(INTEGRATION_TARGETS))
@$(call install_runtime,$(RUNTIME)-swgso,--software-gso=true --gso=false)
@$(call install_runtime,$(RUNTIME)-swgso-docker,--net-raw --software-gso=true --gso=false)
@$(call test_runtime_cached,$(RUNTIME)-swgso,$(INTEGRATION_TARGETS))
.PHONY: swgso-tests

hostnet-tests: load-basic $(RUNTIME_BIN)
@$(call install_runtime,$(RUNTIME),--network=host --net-raw)
@$(call test_runtime,$(RUNTIME),--test_env=TEST_CHECKPOINT=false --test_env=TEST_HOSTNET=true --test_env=TEST_NET_RAW=true $(INTEGRATION_TARGETS))
@$(call install_runtime,$(RUNTIME)-hostnet,--network=host --net-raw)
@$(call test_runtime_cached,$(RUNTIME)-hostnet,--test_env=TEST_CHECKPOINT=false --test_env=TEST_HOSTNET=true --test_env=TEST_NET_RAW=true $(INTEGRATION_TARGETS))
.PHONY: hostnet-tests

kvm-tests: load-basic $(RUNTIME_BIN)
@(lsmod | grep -E '^(kvm_intel|kvm_amd)') || sudo modprobe kvm
@if ! test -w /dev/kvm; then sudo chmod a+rw /dev/kvm; fi
@$(call test,//pkg/sentry/platform/kvm:kvm_test)
@$(call install_runtime,$(RUNTIME),--platform=kvm)
@$(call install_runtime,$(RUNTIME)-docker,--net-raw --platform=kvm)
@$(call test_runtime,$(RUNTIME),$(INTEGRATION_TARGETS))
@$(call install_runtime,$(RUNTIME)-kvm,--platform=kvm)
@$(call install_runtime,$(RUNTIME)-kvm-docker,--net-raw --platform=kvm)
@$(call test_runtime_cached,$(RUNTIME)-kvm,$(INTEGRATION_TARGETS))
.PHONY: kvm-tests

systrap-tests: load-basic $(RUNTIME_BIN)
@$(call install_runtime,$(RUNTIME),--platform=systrap)
@$(call install_runtime,$(RUNTIME)-docker,--net-raw --platform=systrap)
@$(call test_runtime,$(RUNTIME),$(INTEGRATION_TARGETS))
@$(call install_runtime,$(RUNTIME)-systrap,--platform=systrap)
@$(call install_runtime,$(RUNTIME)-systrap-docker,--net-raw --platform=systrap)
@$(call test_runtime_cached,$(RUNTIME)-systrap,$(INTEGRATION_TARGETS))
.PHONY: systrap-tests

iptables-tests: load-iptables $(RUNTIME_BIN)
Expand Down
7 changes: 7 additions & 0 deletions test/e2e/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ go_test(
"exec_test.go",
"integration_test.go",
],

# runsc is needed to invalidate the bazel cache in case of any code changes.
data = ["//runsc"],
library = ":integration",
tags = [
# Requires docker and runsc to be configured before the test runs.
Expand All @@ -36,6 +39,8 @@ go_test(
srcs = [
"integration_runtime_test.go",
],
# runsc is needed to invalidate the bazel cache in case of any code changes.
data = ["//runsc"],
library = ":integration",
tags = [
# Requires docker and runsc to be configured before the test runs.
Expand All @@ -58,6 +63,8 @@ go_test(
srcs = [
"runtime_in_docker_test.go",
],
# runsc is needed to invalidate the bazel cache in case of any code changes.
data = ["//runsc"],
library = ":integration",
tags = [
# Requires docker and runsc to be configured before the test runs.
Expand Down
7 changes: 6 additions & 1 deletion test/e2e/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,13 @@ func TestJobControl(t *testing.T) {
if _, err := p.Write(time.Second, []byte{0x03}); err != nil {
t.Fatalf("error exit: %v", err)
}
if logs, err := p.Logs(); err != nil {
t.Logf("failed to read output: %s", err)
} else {
t.Logf("output: %s", logs)
}

if err := d.WaitTimeout(ctx, 3*time.Second); err != nil {
if err := d.WaitTimeout(ctx, 10*time.Second); err != nil {
t.Fatalf("WaitTimeout failed: %v", err)
}

Expand Down
2 changes: 2 additions & 0 deletions test/image/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ go_test(
"mysql.sql",
"ruby.rb",
"ruby.sh",
# runsc is needed to invalidate the bazel cache in case of any code changes.
"//runsc",
],
library = ":image",
tags = [
Expand Down
Loading