Skip to content

Commit 2f807b6

Browse files
authored
Merge pull request containerd#9750 from jiusanzhou/bugfix/integration-fix-strace-inject
Support inject delay running with the old version (4.x) of strace for test case
2 parents d297fbe + a9060cd commit 2f807b6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

integration/issue7496_linux_test.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,13 @@ func injectDelayToUmount2(ctx context.Context, t *testing.T, shimCli apitask.TTR
116116

117117
doneCh := make(chan struct{})
118118

119+
// use strace command to mock the delay of umount2
120+
// this require strace version >= 4.22
119121
cmd := exec.CommandContext(ctx, "strace",
120122
"-p", strconv.Itoa(int(pid)), "-f", // attach to all the threads
121-
"--detach-on=execve", // stop to attach runc child-processes
122-
"--trace=umount2", // only trace umount2 syscall
123-
"-e", "inject=umount2:delay_enter="+strconv.Itoa(delayInSec)+"s",
123+
"-b", "execve", // stop to attach runc child-processes
124+
"-e", "trace=umount2", // only trace umount2 syscall
125+
"-e", "inject=umount2:delay_enter="+strconv.Itoa(delayInSec)+"000000",
124126
)
125127
cmd.SysProcAttr = &syscall.SysProcAttr{Pdeathsig: syscall.SIGKILL}
126128

0 commit comments

Comments
 (0)