docker_cli_exec_test.go 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649
  1. // +build !test_no_exec
  2. package main
  3. import (
  4. "bufio"
  5. "fmt"
  6. "os"
  7. "os/exec"
  8. "path/filepath"
  9. "reflect"
  10. "sort"
  11. "strings"
  12. "sync"
  13. "time"
  14. "github.com/go-check/check"
  15. )
  16. func (s *DockerSuite) TestExec(c *check.C) {
  17. runCmd := exec.Command(dockerBinary, "run", "-d", "--name", "testing", "busybox", "sh", "-c", "echo test > /tmp/file && top")
  18. if out, _, _, err := runCommandWithStdoutStderr(runCmd); err != nil {
  19. c.Fatal(out, err)
  20. }
  21. execCmd := exec.Command(dockerBinary, "exec", "testing", "cat", "/tmp/file")
  22. out, _, err := runCommandWithOutput(execCmd)
  23. if err != nil {
  24. c.Fatal(out, err)
  25. }
  26. out = strings.Trim(out, "\r\n")
  27. if expected := "test"; out != expected {
  28. c.Errorf("container exec should've printed %q but printed %q", expected, out)
  29. }
  30. }
  31. func (s *DockerSuite) TestExecInteractive(c *check.C) {
  32. runCmd := exec.Command(dockerBinary, "run", "-d", "--name", "testing", "busybox", "sh", "-c", "echo test > /tmp/file && top")
  33. if out, _, _, err := runCommandWithStdoutStderr(runCmd); err != nil {
  34. c.Fatal(out, err)
  35. }
  36. execCmd := exec.Command(dockerBinary, "exec", "-i", "testing", "sh")
  37. stdin, err := execCmd.StdinPipe()
  38. if err != nil {
  39. c.Fatal(err)
  40. }
  41. stdout, err := execCmd.StdoutPipe()
  42. if err != nil {
  43. c.Fatal(err)
  44. }
  45. if err := execCmd.Start(); err != nil {
  46. c.Fatal(err)
  47. }
  48. if _, err := stdin.Write([]byte("cat /tmp/file\n")); err != nil {
  49. c.Fatal(err)
  50. }
  51. r := bufio.NewReader(stdout)
  52. line, err := r.ReadString('\n')
  53. if err != nil {
  54. c.Fatal(err)
  55. }
  56. line = strings.TrimSpace(line)
  57. if line != "test" {
  58. c.Fatalf("Output should be 'test', got '%q'", line)
  59. }
  60. if err := stdin.Close(); err != nil {
  61. c.Fatal(err)
  62. }
  63. finish := make(chan struct{})
  64. go func() {
  65. if err := execCmd.Wait(); err != nil {
  66. c.Fatal(err)
  67. }
  68. close(finish)
  69. }()
  70. select {
  71. case <-finish:
  72. case <-time.After(1 * time.Second):
  73. c.Fatal("docker exec failed to exit on stdin close")
  74. }
  75. }
  76. func (s *DockerSuite) TestExecAfterContainerRestart(c *check.C) {
  77. runCmd := exec.Command(dockerBinary, "run", "-d", "busybox", "top")
  78. out, _, err := runCommandWithOutput(runCmd)
  79. if err != nil {
  80. c.Fatal(out, err)
  81. }
  82. cleanedContainerID := strings.TrimSpace(out)
  83. runCmd = exec.Command(dockerBinary, "restart", cleanedContainerID)
  84. if out, _, err = runCommandWithOutput(runCmd); err != nil {
  85. c.Fatal(out, err)
  86. }
  87. runCmd = exec.Command(dockerBinary, "exec", cleanedContainerID, "echo", "hello")
  88. out, _, err = runCommandWithOutput(runCmd)
  89. if err != nil {
  90. c.Fatal(out, err)
  91. }
  92. outStr := strings.TrimSpace(out)
  93. if outStr != "hello" {
  94. c.Errorf("container should've printed hello, instead printed %q", outStr)
  95. }
  96. }
  97. func (s *DockerSuite) TestExecAfterDaemonRestart(c *check.C) {
  98. testRequires(c, SameHostDaemon)
  99. d := NewDaemon(c)
  100. if err := d.StartWithBusybox(); err != nil {
  101. c.Fatalf("Could not start daemon with busybox: %v", err)
  102. }
  103. defer d.Stop()
  104. if out, err := d.Cmd("run", "-d", "--name", "top", "-p", "80", "busybox:latest", "top"); err != nil {
  105. c.Fatalf("Could not run top: err=%v\n%s", err, out)
  106. }
  107. if err := d.Restart(); err != nil {
  108. c.Fatalf("Could not restart daemon: %v", err)
  109. }
  110. if out, err := d.Cmd("start", "top"); err != nil {
  111. c.Fatalf("Could not start top after daemon restart: err=%v\n%s", err, out)
  112. }
  113. out, err := d.Cmd("exec", "top", "echo", "hello")
  114. if err != nil {
  115. c.Fatalf("Could not exec on container top: err=%v\n%s", err, out)
  116. }
  117. outStr := strings.TrimSpace(string(out))
  118. if outStr != "hello" {
  119. c.Errorf("container should've printed hello, instead printed %q", outStr)
  120. }
  121. }
  122. // Regression test for #9155, #9044
  123. func (s *DockerSuite) TestExecEnv(c *check.C) {
  124. runCmd := exec.Command(dockerBinary, "run",
  125. "-e", "LALA=value1",
  126. "-e", "LALA=value2",
  127. "-d", "--name", "testing", "busybox", "top")
  128. if out, _, _, err := runCommandWithStdoutStderr(runCmd); err != nil {
  129. c.Fatal(out, err)
  130. }
  131. execCmd := exec.Command(dockerBinary, "exec", "testing", "env")
  132. out, _, err := runCommandWithOutput(execCmd)
  133. if err != nil {
  134. c.Fatal(out, err)
  135. }
  136. if strings.Contains(out, "LALA=value1") ||
  137. !strings.Contains(out, "LALA=value2") ||
  138. !strings.Contains(out, "HOME=/root") {
  139. c.Errorf("exec env(%q), expect %q, %q", out, "LALA=value2", "HOME=/root")
  140. }
  141. }
  142. func (s *DockerSuite) TestExecExitStatus(c *check.C) {
  143. runCmd := exec.Command(dockerBinary, "run", "-d", "--name", "top", "busybox", "top")
  144. if out, _, _, err := runCommandWithStdoutStderr(runCmd); err != nil {
  145. c.Fatal(out, err)
  146. }
  147. // Test normal (non-detached) case first
  148. cmd := exec.Command(dockerBinary, "exec", "top", "sh", "-c", "exit 23")
  149. ec, _ := runCommand(cmd)
  150. if ec != 23 {
  151. c.Fatalf("Should have had an ExitCode of 23, not: %d", ec)
  152. }
  153. }
  154. func (s *DockerSuite) TestExecPausedContainer(c *check.C) {
  155. defer unpauseAllContainers()
  156. runCmd := exec.Command(dockerBinary, "run", "-d", "--name", "testing", "busybox", "top")
  157. out, _, err := runCommandWithOutput(runCmd)
  158. if err != nil {
  159. c.Fatal(out, err)
  160. }
  161. ContainerID := strings.TrimSpace(out)
  162. pausedCmd := exec.Command(dockerBinary, "pause", "testing")
  163. out, _, _, err = runCommandWithStdoutStderr(pausedCmd)
  164. if err != nil {
  165. c.Fatal(out, err)
  166. }
  167. execCmd := exec.Command(dockerBinary, "exec", "-i", "-t", ContainerID, "echo", "hello")
  168. out, _, err = runCommandWithOutput(execCmd)
  169. if err == nil {
  170. c.Fatal("container should fail to exec new command if it is paused")
  171. }
  172. expected := ContainerID + " is paused, unpause the container before exec"
  173. if !strings.Contains(out, expected) {
  174. c.Fatal("container should not exec new command if it is paused")
  175. }
  176. }
  177. // regression test for #9476
  178. func (s *DockerSuite) TestExecTtyCloseStdin(c *check.C) {
  179. cmd := exec.Command(dockerBinary, "run", "-d", "-it", "--name", "exec_tty_stdin", "busybox")
  180. if out, _, err := runCommandWithOutput(cmd); err != nil {
  181. c.Fatal(out, err)
  182. }
  183. cmd = exec.Command(dockerBinary, "exec", "-i", "exec_tty_stdin", "cat")
  184. stdinRw, err := cmd.StdinPipe()
  185. if err != nil {
  186. c.Fatal(err)
  187. }
  188. stdinRw.Write([]byte("test"))
  189. stdinRw.Close()
  190. if out, _, err := runCommandWithOutput(cmd); err != nil {
  191. c.Fatal(out, err)
  192. }
  193. cmd = exec.Command(dockerBinary, "top", "exec_tty_stdin")
  194. out, _, err := runCommandWithOutput(cmd)
  195. if err != nil {
  196. c.Fatal(out, err)
  197. }
  198. outArr := strings.Split(out, "\n")
  199. if len(outArr) > 3 || strings.Contains(out, "nsenter-exec") {
  200. // This is the really bad part
  201. if out, _, err := runCommandWithOutput(exec.Command(dockerBinary, "rm", "-f", "exec_tty_stdin")); err != nil {
  202. c.Fatal(out, err)
  203. }
  204. c.Fatalf("exec process left running\n\t %s", out)
  205. }
  206. }
  207. func (s *DockerSuite) TestExecTtyWithoutStdin(c *check.C) {
  208. cmd := exec.Command(dockerBinary, "run", "-d", "-ti", "busybox")
  209. out, _, err := runCommandWithOutput(cmd)
  210. if err != nil {
  211. c.Fatalf("failed to start container: %v (%v)", out, err)
  212. }
  213. id := strings.TrimSpace(out)
  214. if err := waitRun(id); err != nil {
  215. c.Fatal(err)
  216. }
  217. defer func() {
  218. cmd := exec.Command(dockerBinary, "kill", id)
  219. if out, _, err := runCommandWithOutput(cmd); err != nil {
  220. c.Fatalf("failed to kill container: %v (%v)", out, err)
  221. }
  222. }()
  223. done := make(chan struct{})
  224. go func() {
  225. defer close(done)
  226. cmd := exec.Command(dockerBinary, "exec", "-ti", id, "true")
  227. if _, err := cmd.StdinPipe(); err != nil {
  228. c.Fatal(err)
  229. }
  230. expected := "cannot enable tty mode"
  231. if out, _, err := runCommandWithOutput(cmd); err == nil {
  232. c.Fatal("exec should have failed")
  233. } else if !strings.Contains(out, expected) {
  234. c.Fatalf("exec failed with error %q: expected %q", out, expected)
  235. }
  236. }()
  237. select {
  238. case <-done:
  239. case <-time.After(3 * time.Second):
  240. c.Fatal("exec is running but should have failed")
  241. }
  242. }
  243. func (s *DockerSuite) TestExecParseError(c *check.C) {
  244. runCmd := exec.Command(dockerBinary, "run", "-d", "--name", "top", "busybox", "top")
  245. if out, _, err := runCommandWithOutput(runCmd); err != nil {
  246. c.Fatal(out, err)
  247. }
  248. // Test normal (non-detached) case first
  249. cmd := exec.Command(dockerBinary, "exec", "top")
  250. if _, stderr, code, err := runCommandWithStdoutStderr(cmd); err == nil || !strings.Contains(stderr, "See '"+dockerBinary+" exec --help'") || code == 0 {
  251. c.Fatalf("Should have thrown error & point to help: %s", stderr)
  252. }
  253. }
  254. func (s *DockerSuite) TestExecStopNotHanging(c *check.C) {
  255. if out, err := exec.Command(dockerBinary, "run", "-d", "--name", "testing", "busybox", "top").CombinedOutput(); err != nil {
  256. c.Fatal(out, err)
  257. }
  258. if err := exec.Command(dockerBinary, "exec", "testing", "top").Start(); err != nil {
  259. c.Fatal(err)
  260. }
  261. wait := make(chan struct{})
  262. go func() {
  263. if out, err := exec.Command(dockerBinary, "stop", "testing").CombinedOutput(); err != nil {
  264. c.Fatal(out, err)
  265. }
  266. close(wait)
  267. }()
  268. select {
  269. case <-time.After(3 * time.Second):
  270. c.Fatal("Container stop timed out")
  271. case <-wait:
  272. }
  273. }
  274. func (s *DockerSuite) TestExecCgroup(c *check.C) {
  275. var cmd *exec.Cmd
  276. cmd = exec.Command(dockerBinary, "run", "-d", "--name", "testing", "busybox", "top")
  277. _, err := runCommand(cmd)
  278. if err != nil {
  279. c.Fatal(err)
  280. }
  281. cmd = exec.Command(dockerBinary, "exec", "testing", "cat", "/proc/1/cgroup")
  282. out, _, err := runCommandWithOutput(cmd)
  283. if err != nil {
  284. c.Fatal(out, err)
  285. }
  286. containerCgroups := sort.StringSlice(strings.Split(string(out), "\n"))
  287. var wg sync.WaitGroup
  288. var mu sync.Mutex
  289. execCgroups := []sort.StringSlice{}
  290. // exec a few times concurrently to get consistent failure
  291. for i := 0; i < 5; i++ {
  292. wg.Add(1)
  293. go func() {
  294. cmd := exec.Command(dockerBinary, "exec", "testing", "cat", "/proc/self/cgroup")
  295. out, _, err := runCommandWithOutput(cmd)
  296. if err != nil {
  297. c.Fatal(out, err)
  298. }
  299. cg := sort.StringSlice(strings.Split(string(out), "\n"))
  300. mu.Lock()
  301. execCgroups = append(execCgroups, cg)
  302. mu.Unlock()
  303. wg.Done()
  304. }()
  305. }
  306. wg.Wait()
  307. for _, cg := range execCgroups {
  308. if !reflect.DeepEqual(cg, containerCgroups) {
  309. fmt.Println("exec cgroups:")
  310. for _, name := range cg {
  311. fmt.Printf(" %s\n", name)
  312. }
  313. fmt.Println("container cgroups:")
  314. for _, name := range containerCgroups {
  315. fmt.Printf(" %s\n", name)
  316. }
  317. c.Fatal("cgroups mismatched")
  318. }
  319. }
  320. }
  321. func (s *DockerSuite) TestInspectExecID(c *check.C) {
  322. out, exitCode, err := runCommandWithOutput(exec.Command(dockerBinary, "run", "-d", "busybox", "top"))
  323. if exitCode != 0 || err != nil {
  324. c.Fatalf("failed to run container: %s, %v", out, err)
  325. }
  326. id := strings.TrimSuffix(out, "\n")
  327. out, err = inspectField(id, "ExecIDs")
  328. if err != nil {
  329. c.Fatalf("failed to inspect container: %s, %v", out, err)
  330. }
  331. if out != "[]" {
  332. c.Fatalf("ExecIDs should be empty, got: %s", out)
  333. }
  334. exitCode, err = runCommand(exec.Command(dockerBinary, "exec", "-d", id, "ls", "/"))
  335. if exitCode != 0 || err != nil {
  336. c.Fatalf("failed to exec in container: %s, %v", out, err)
  337. }
  338. out, err = inspectField(id, "ExecIDs")
  339. if err != nil {
  340. c.Fatalf("failed to inspect container: %s, %v", out, err)
  341. }
  342. out = strings.TrimSuffix(out, "\n")
  343. if out == "[]" || out == "<no value>" {
  344. c.Fatalf("ExecIDs should not be empty, got: %s", out)
  345. }
  346. }
  347. func (s *DockerSuite) TestLinksPingLinkedContainersOnRename(c *check.C) {
  348. var out string
  349. out, _ = dockerCmd(c, "run", "-d", "--name", "container1", "busybox", "top")
  350. idA := strings.TrimSpace(out)
  351. if idA == "" {
  352. c.Fatal(out, "id should not be nil")
  353. }
  354. out, _ = dockerCmd(c, "run", "-d", "--link", "container1:alias1", "--name", "container2", "busybox", "top")
  355. idB := strings.TrimSpace(out)
  356. if idB == "" {
  357. c.Fatal(out, "id should not be nil")
  358. }
  359. execCmd := exec.Command(dockerBinary, "exec", "container2", "ping", "-c", "1", "alias1", "-W", "1")
  360. out, _, err := runCommandWithOutput(execCmd)
  361. if err != nil {
  362. c.Fatal(out, err)
  363. }
  364. dockerCmd(c, "rename", "container1", "container_new")
  365. execCmd = exec.Command(dockerBinary, "exec", "container2", "ping", "-c", "1", "alias1", "-W", "1")
  366. out, _, err = runCommandWithOutput(execCmd)
  367. if err != nil {
  368. c.Fatal(out, err)
  369. }
  370. }
  371. func (s *DockerSuite) TestRunExecDir(c *check.C) {
  372. testRequires(c, SameHostDaemon)
  373. cmd := exec.Command(dockerBinary, "run", "-d", "busybox", "top")
  374. out, _, err := runCommandWithOutput(cmd)
  375. if err != nil {
  376. c.Fatal(err, out)
  377. }
  378. id := strings.TrimSpace(out)
  379. execDir := filepath.Join(execDriverPath, id)
  380. stateFile := filepath.Join(execDir, "state.json")
  381. {
  382. fi, err := os.Stat(execDir)
  383. if err != nil {
  384. c.Fatal(err)
  385. }
  386. if !fi.IsDir() {
  387. c.Fatalf("%q must be a directory", execDir)
  388. }
  389. fi, err = os.Stat(stateFile)
  390. if err != nil {
  391. c.Fatal(err)
  392. }
  393. }
  394. stopCmd := exec.Command(dockerBinary, "stop", id)
  395. out, _, err = runCommandWithOutput(stopCmd)
  396. if err != nil {
  397. c.Fatal(err, out)
  398. }
  399. {
  400. _, err := os.Stat(execDir)
  401. if err == nil {
  402. c.Fatal(err)
  403. }
  404. if err == nil {
  405. c.Fatalf("Exec directory %q exists for removed container!", execDir)
  406. }
  407. if !os.IsNotExist(err) {
  408. c.Fatalf("Error should be about non-existing, got %s", err)
  409. }
  410. }
  411. startCmd := exec.Command(dockerBinary, "start", id)
  412. out, _, err = runCommandWithOutput(startCmd)
  413. if err != nil {
  414. c.Fatal(err, out)
  415. }
  416. {
  417. fi, err := os.Stat(execDir)
  418. if err != nil {
  419. c.Fatal(err)
  420. }
  421. if !fi.IsDir() {
  422. c.Fatalf("%q must be a directory", execDir)
  423. }
  424. fi, err = os.Stat(stateFile)
  425. if err != nil {
  426. c.Fatal(err)
  427. }
  428. }
  429. rmCmd := exec.Command(dockerBinary, "rm", "-f", id)
  430. out, _, err = runCommandWithOutput(rmCmd)
  431. if err != nil {
  432. c.Fatal(err, out)
  433. }
  434. {
  435. _, err := os.Stat(execDir)
  436. if err == nil {
  437. c.Fatal(err)
  438. }
  439. if err == nil {
  440. c.Fatalf("Exec directory %q is exists for removed container!", execDir)
  441. }
  442. if !os.IsNotExist(err) {
  443. c.Fatalf("Error should be about non-existing, got %s", err)
  444. }
  445. }
  446. }
  447. func (s *DockerSuite) TestRunMutableNetworkFiles(c *check.C) {
  448. testRequires(c, SameHostDaemon)
  449. for _, fn := range []string{"resolv.conf", "hosts"} {
  450. deleteAllContainers()
  451. content, err := runCommandAndReadContainerFile(fn, exec.Command(dockerBinary, "run", "-d", "--name", "c1", "busybox", "sh", "-c", fmt.Sprintf("echo success >/etc/%s && top", fn)))
  452. if err != nil {
  453. c.Fatal(err)
  454. }
  455. if strings.TrimSpace(string(content)) != "success" {
  456. c.Fatal("Content was not what was modified in the container", string(content))
  457. }
  458. out, _, err := runCommandWithOutput(exec.Command(dockerBinary, "run", "-d", "--name", "c2", "busybox", "top"))
  459. if err != nil {
  460. c.Fatal(err)
  461. }
  462. contID := strings.TrimSpace(out)
  463. netFilePath := containerStorageFile(contID, fn)
  464. f, err := os.OpenFile(netFilePath, os.O_WRONLY|os.O_SYNC|os.O_APPEND, 0644)
  465. if err != nil {
  466. c.Fatal(err)
  467. }
  468. if _, err := f.Seek(0, 0); err != nil {
  469. f.Close()
  470. c.Fatal(err)
  471. }
  472. if err := f.Truncate(0); err != nil {
  473. f.Close()
  474. c.Fatal(err)
  475. }
  476. if _, err := f.Write([]byte("success2\n")); err != nil {
  477. f.Close()
  478. c.Fatal(err)
  479. }
  480. f.Close()
  481. res, err := exec.Command(dockerBinary, "exec", contID, "cat", "/etc/"+fn).CombinedOutput()
  482. if err != nil {
  483. c.Fatalf("Output: %s, error: %s", res, err)
  484. }
  485. if string(res) != "success2\n" {
  486. c.Fatalf("Expected content of %s: %q, got: %q", fn, "success2\n", res)
  487. }
  488. }
  489. }
  490. func (s *DockerSuite) TestExecWithUser(c *check.C) {
  491. runCmd := exec.Command(dockerBinary, "run", "-d", "--name", "parent", "busybox", "top")
  492. if out, _, err := runCommandWithOutput(runCmd); err != nil {
  493. c.Fatal(out, err)
  494. }
  495. cmd := exec.Command(dockerBinary, "exec", "-u", "1", "parent", "id")
  496. out, _, err := runCommandWithOutput(cmd)
  497. if err != nil {
  498. c.Fatal(err, out)
  499. }
  500. if !strings.Contains(out, "uid=1(daemon) gid=1(daemon)") {
  501. c.Fatalf("exec with user by id expected daemon user got %s", out)
  502. }
  503. cmd = exec.Command(dockerBinary, "exec", "-u", "root", "parent", "id")
  504. out, _, err = runCommandWithOutput(cmd)
  505. if err != nil {
  506. c.Fatal(err, out)
  507. }
  508. if !strings.Contains(out, "uid=0(root) gid=0(root)") {
  509. c.Fatalf("exec with user by root expected root user got %s", out)
  510. }
  511. }
  512. func (s *DockerSuite) TestExecWithPrivileged(c *check.C) {
  513. runCmd := exec.Command(dockerBinary, "run", "-d", "--name", "parent", "--cap-drop=ALL", "busybox", "top")
  514. if out, _, err := runCommandWithOutput(runCmd); err != nil {
  515. c.Fatal(out, err)
  516. }
  517. cmd := exec.Command(dockerBinary, "exec", "parent", "sh", "-c", "mknod /tmp/sda b 8 0")
  518. out, _, err := runCommandWithOutput(cmd)
  519. if err == nil || !strings.Contains(out, "Operation not permitted") {
  520. c.Fatalf("exec mknod in --cap-drop=ALL container without --privileged should failed")
  521. }
  522. cmd = exec.Command(dockerBinary, "exec", "--privileged", "parent", "sh", "-c", "mknod /tmp/sda b 8 0 && echo ok")
  523. out, _, err = runCommandWithOutput(cmd)
  524. if err != nil {
  525. c.Fatal(err, out)
  526. }
  527. if actual := strings.TrimSpace(out); actual != "ok" {
  528. c.Fatalf("exec mknod in --cap-drop=ALL container with --privileged failed: %v, output: %q", err, out)
  529. }
  530. }