Skip to content

Commit

Permalink
buildkite: run intergration tests with the network plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
avagin committed Sep 26, 2024
1 parent 975bf85 commit 009957d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 deletions.
8 changes: 8 additions & 0 deletions .buildkite/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,14 @@ steps:
<<: *platform_specific_agents
<<: *ubuntu_agents
arch: "amd64"
- <<: *common
<<: *docker
<<: *source_test
label: ":satellite: gVisor network plugin tests"
command: make plugin-network-tests
agents:
<<: *kvm_agents
arch: "amd64"
- <<: *common
<<: *source_test
label: ":coffee: Do tests"
Expand Down
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ else
RUNTIME ?= $(BRANCH_NAME)
endif
RUNTIME_DIR ?= $(shell dirname $(shell mktemp -u))/$(RUNTIME)
RUNSC_TARGET ?= //runsc
RUNTIME_BIN ?= $(RUNTIME_DIR)/runsc
RUNTIME_LOG_DIR ?= $(RUNTIME_DIR)/logs
RUNTIME_LOGS ?= $(RUNTIME_LOG_DIR)/runsc.log.%TEST%.%TIMESTAMP%.%COMMAND%
Expand All @@ -127,7 +128,7 @@ endif
$(RUNTIME_BIN): # See below.
@mkdir -p "$(RUNTIME_DIR)"
ifeq (,$(STAGED_BINARIES))
@$(call copy,//runsc,$(RUNTIME_BIN))
@$(call copy,$(RUNSC_TARGET),$(RUNTIME_BIN))
else
gsutil cat "${STAGED_BINARIES}" | \
tar -C "$(RUNTIME_DIR)" -zxvf - runsc && \
Expand Down Expand Up @@ -346,6 +347,12 @@ docker-tests: load-basic $(RUNTIME_BIN)
@$(call test_runtime,$(RUNTIME),$(INTEGRATION_TARGETS) //test/e2e:integration_runtime_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))

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)
Expand Down
11 changes: 6 additions & 5 deletions runsc/sandbox/sandbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -851,11 +851,12 @@ func (s *Sandbox) createSandboxProcess(conf *config.Config, args *Args, startSyn
if !conf.TestOnlyAllowRunAsCurrentUserWithoutChroot {
// Setting cmd.Env = nil causes cmd to inherit the current process's env.
cmd.Env = []string{}
// runsc-race with glibc needs to disable rseq.
glibcTunables := os.Getenv("GLIBC_TUNABLES")
if glibcTunables != "" {
cmd.Env = append(cmd.Env, fmt.Sprintf("GLIBC_TUNABLES=%s", glibcTunables))
}
}
if config.CgoEnabled {
// Platforms that use stub processes are not compatible with
// the glibc rseq, because they unmap everything from a process
// address space.
cmd.Env = append(cmd.Env, "GLIBC_TUNABLES=glibc.pthread.rseq=0")
}

// If there is a gofer, sends all socket ends to the sandbox.
Expand Down
4 changes: 2 additions & 2 deletions test/root/runsc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func TestSandboxProcessEnv(t *testing.T) {
if err != nil {
t.Fatal(err)
}
if len(got) != 0 {
t.Errorf("sandbox process's environment is not empty: got %s", string(got))
if len(got) != 0 && string(got) != "GLIBC_TUNABLES=glibc.pthread.rseq=0" {
t.Errorf("sandbox process's environment is not empty: got %s (%v)", string(got), got)
}
}

0 comments on commit 009957d

Please sign in to comment.