Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vmtests: address RCU stalls #317

Merged
merged 3 commits into from
Aug 12, 2022
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
4 changes: 0 additions & 4 deletions .github/workflows/vmtests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,6 @@ jobs:
run: |
sudo chmod go+rX -R /boot/

- name: set panic on RCU stall
run: |
sudo sh -c 'echo 1 > /proc/sys/kernel/panic_on_rcu_stall'

- name: download build data
uses: actions/download-artifact@v3
with:
Expand Down
12 changes: 7 additions & 5 deletions cmd/tetragon-vmtests-run/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,8 @@ func buildTesterService(rcnf *RunConf, tmpDir string) ([]images.Action, error) {
*/
}

if !rcnf.justBoot {
enableTester := images.Action{Op: &images.RunCommand{Cmd: "systemctl enable tetragon-tester.service"}}
actions = append(actions, enableTester)
}
enableTester := images.Action{Op: &images.RunCommand{Cmd: "systemctl enable tetragon-tester.service"}}
actions = append(actions, enableTester)

return actions, nil
}
Expand Down Expand Up @@ -132,7 +130,7 @@ func buildTesterActions(rcnf *RunConf, tmpDir string) ([]images.Action, error) {
Op: &images.CopyInCommand{LocalPath: tmpConfFile, RemoteDir: remoteConfDir},
})

if !rcnf.useTetragonTesterInit {
if !rcnf.useTetragonTesterInit && !rcnf.justBoot {
acts, err := buildTesterService(rcnf, tmpDir)
if err != nil {
return nil, err
Expand Down Expand Up @@ -168,6 +166,10 @@ func buildTestImage(log *logrus.Logger, rcnf *RunConf) error {
{Op: &images.SetHostnameCommand{Hostname: hostname}},
// NB: some of the tetragon tests expect a /usr/bin/cp
{Op: &images.RunCommand{Cmd: "cp /bin/cp /usr/bin/cp"}},
{Op: &images.AppendLineCommand{
File: "/etc/sysctl.d/local.conf",
Line: "kernel.panic_on_rcu_stall=1",
}},
}
actions = append(actions, fsActions...)
actions = append(actions, testerActions...)
Expand Down
11 changes: 9 additions & 2 deletions cmd/tetragon-vmtests-run/run_tests.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"bufio"
"context"
"encoding/json"
"fmt"
Expand Down Expand Up @@ -28,11 +29,17 @@ func runTests(
ctx, cancel := signal.NotifyContext(ctx, unix.SIGINT, unix.SIGTERM)
defer cancel()
qemuCmd := exec.CommandContext(ctx, qemuBin, qemuArgs...)
qemuCmd.Stdout = os.Stdout
qemuCmd.Stderr = os.Stderr

// buffer output from qemu's stdout/stderr to avoid delays
bout := bufio.NewWriter(os.Stdout)
berr := bufio.NewWriter(os.Stderr)
qemuCmd.Stdout = bout
qemuCmd.Stderr = berr
if err := qemuCmd.Run(); err != nil {
return nil, err
}
bout.Flush()
berr.Flush()

fmt.Printf("results directory: %s\n", rcnf.testerConf.ResultsDir)
resFile := filepath.Join(rcnf.testerConf.ResultsDir, "results.json")
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/cilium/cilium-e2e v0.0.0-00010101000000-000000000000
github.com/cilium/ebpf v0.9.0
github.com/cilium/hubble v0.5.3-0.20220311154618-3e44df066567
github.com/cilium/little-vm-helper v0.0.0-20220729082344-f2ca5b097f67
github.com/cilium/little-vm-helper v0.0.0-20220812055014-101c3e342e13
github.com/cilium/lumberjack/v2 v2.2.2
github.com/cilium/tetragon/api v0.0.0-00010101000000-000000000000
github.com/cilium/tetragon/pkg/k8s v0.0.0-00010101000000-000000000000
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ github.com/cilium/hubble v0.5.3-0.20220311154618-3e44df066567/go.mod h1:Y522N+Ka
github.com/cilium/ipam v0.0.0-20200217195329-a46f8d55f9db/go.mod h1:URWgSDyRFKKBgnY4Svj37siCG145nu3qJt6oHlZRdqU=
github.com/cilium/ipam v0.0.0-20201020084809-76717fcdb3a2/go.mod h1:Ascfar4FtgB+K+mwqbZpSb3WVZ5sPFIarg+iAOXNZqI=
github.com/cilium/kafka v0.0.0-20180809090225-01ce283b732b/go.mod h1:ktgizta3CPZBKz5uW272SJyjiro0vn4nOVP7Pk4RopA=
github.com/cilium/little-vm-helper v0.0.0-20220729082344-f2ca5b097f67 h1:gVu/1IyhT3t8fDGYVeDFJG3FCknd0lOFHmU6gkgHtlo=
github.com/cilium/little-vm-helper v0.0.0-20220729082344-f2ca5b097f67/go.mod h1:Ya+Z4TOpZlsTtFZg3teKp9lzNd/BTgC4MlRN4drM328=
github.com/cilium/little-vm-helper v0.0.0-20220812055014-101c3e342e13 h1:R1X8fZxqDnOZqDEWIcWR3t5utglPk2cWzS8VPBf1PFE=
github.com/cilium/little-vm-helper v0.0.0-20220812055014-101c3e342e13/go.mod h1:Ya+Z4TOpZlsTtFZg3teKp9lzNd/BTgC4MlRN4drM328=
github.com/cilium/lumberjack/v2 v2.2.2 h1:RKTdhb63DY0Xu7pE1pipMj7Zq28LyvBGSrCneHiKm4A=
github.com/cilium/lumberjack/v2 v2.2.2/go.mod h1:yfbtPGmg4i//5oEqzaMxDqSWqgfZFmMoV70Mc2k6v0A=
github.com/cilium/proxy v0.0.0-20191113190709-4c7b379792e6/go.mod h1:lbRnBzpxwMP5KsTu99cM654ShwTWamyhrF6cCLuYqhE=
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ github.com/cilium/hubble/pkg/k8s
github.com/cilium/hubble/pkg/parser/endpoint
github.com/cilium/hubble/pkg/parser/getters
github.com/cilium/hubble/pkg/servicecache
# github.com/cilium/little-vm-helper v0.0.0-20220729082344-f2ca5b097f67
# github.com/cilium/little-vm-helper v0.0.0-20220812055014-101c3e342e13
## explicit; go 1.18
github.com/cilium/little-vm-helper/pkg/images
github.com/cilium/little-vm-helper/pkg/logcmd
Expand Down