Skip to content

Commit dbf9a1e

Browse files
authored
Merge pull request #151 from kzys/buildkite-root
Correctly set DISABLE_ROOT_TESTS on the root tests
2 parents d05043c + ed9cd95 commit dbf9a1e

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

.buildkite/pipeline.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ steps:
4949
- 'ln -s /var/lib/fc-ci/rootfs.ext4 testdata/root-drive.img'
5050
- 'ln -s /usr/local/bin/firecracker-v0.19.0 testdata/firecracker'
5151
- 'ln -s /usr/local/bin/jailer-v0.19.0 testdata/jailer'
52-
- "DISABLE_ROOT_TESTS=true FC_TEST_TAP=fc-test-tap${BUILDKITE_BUILD_NUMBER} make test EXTRAGOARGS='-v -count=1'"
52+
- "FC_TEST_TAP=fc-test-tap${BUILDKITE_BUILD_NUMBER} make test EXTRAGOARGS='-v -count=1' DISABLE_ROOT_TESTS=true"
5353
agents:
5454
queue: "${BUILDKITE_AGENT_META_DATA_QUEUE:-default}"
5555

@@ -60,7 +60,7 @@ steps:
6060
- 'cp /usr/local/bin/firecracker-v0.19.0 testdata/firecracker'
6161
- 'cp /usr/local/bin/jailer-v0.19.0 testdata/jailer'
6262
- 'make -C cni install CNI_BIN_ROOT=$(pwd)/testdata/bin'
63-
- "sudo FC_TEST_TAP=fc-root-tap${BUILDKITE_BUILD_NUMBER} make test EXTRAGOARGS='-v -count=1'"
63+
- "sudo FC_TEST_TAP=fc-root-tap${BUILDKITE_BUILD_NUMBER} make test EXTRAGOARGS='-v -count=1' DISABLE_ROOT_TESTS="
6464
agents:
6565
queue: "${BUILDKITE_AGENT_META_DATA_QUEUE:-default}"
6666

machine_test.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -909,12 +909,19 @@ func TestPID(t *testing.T) {
909909
DisableValidation: true,
910910
}
911911

912-
m, err = NewMachine(context.Background(), cfg, WithLogger(fctesting.NewLogEntry(t)))
912+
ctx := context.Background()
913+
914+
cmd := VMCommandBuilder{}.
915+
WithSocketPath(cfg.SocketPath).
916+
WithBin(getFirecrackerBinaryPath()).
917+
Build(ctx)
918+
919+
m, err = NewMachine(ctx, cfg, WithProcessRunner(cmd), WithLogger(fctesting.NewLogEntry(t)))
913920
if err != nil {
914921
t.Errorf("expected no error during create machine, but received %v", err)
915922
}
916923

917-
if err := m.Start(context.Background()); err != nil {
924+
if err := m.Start(ctx); err != nil {
918925
t.Errorf("expected no error during Start, but received %v", err)
919926
}
920927
defer m.StopVMM()
@@ -932,7 +939,7 @@ func TestPID(t *testing.T) {
932939
t.Errorf("expected clean kill, but received %v", err)
933940
}
934941

935-
m.Wait(context.Background())
942+
m.Wait(ctx)
936943

937944
if _, err := m.PID(); err == nil {
938945
t.Errorf("expected an error, but received none")

network_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,11 @@ func startCNIMachine(t *testing.T,
353353
err = ioutil.WriteFile(rootfsPath, rootfsBytes, 0666)
354354
require.NoError(t, err, "failed to copy vm rootfs to %s", rootfsPath)
355355

356+
cmd := VMCommandBuilder{}.
357+
WithSocketPath(firecrackerSockPath).
358+
WithBin(getFirecrackerBinaryPath()).
359+
Build(ctx)
360+
356361
m, err := NewMachine(ctx, Config{
357362
SocketPath: firecrackerSockPath,
358363
KernelImagePath: getVmlinuxPath(t),
@@ -379,7 +384,7 @@ func startCNIMachine(t *testing.T,
379384
},
380385
}},
381386
VMID: vmID,
382-
})
387+
}, WithProcessRunner(cmd))
383388
require.NoError(t, err, "failed to create machine with CNI network interface")
384389

385390
err = m.Start(context.Background())

0 commit comments

Comments
 (0)