Browse code

docker_api_ipcmode_test: add SameHostDaemon req

This is needed for tests that do some checks and/or create files
on the host system. Inspired by commit d9f3548a9.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>

Kir Kolyshkin authored on 2017/08/24 22:46:41
Showing 2 changed files
... ...
@@ -104,7 +104,7 @@ func (s *DockerSuite) TestAPIIpcModeNone(c *check.C) {
104 104
  * such pair on the host.
105 105
  */
106 106
 func (s *DockerSuite) TestAPIIpcModePrivate(c *check.C) {
107
-	testRequires(c, DaemonIsLinux)
107
+	testRequires(c, DaemonIsLinux, SameHostDaemon)
108 108
 	testIpcNonePrivateShareable(c, "private", true, false)
109 109
 }
110 110
 
... ...
@@ -114,7 +114,7 @@ func (s *DockerSuite) TestAPIIpcModePrivate(c *check.C) {
114 114
  * also exists on the host.
115 115
  */
116 116
 func (s *DockerSuite) TestAPIIpcModeShareable(c *check.C) {
117
-	testRequires(c, DaemonIsLinux)
117
+	testRequires(c, DaemonIsLinux, SameHostDaemon)
118 118
 	testIpcNonePrivateShareable(c, "shareable", true, true)
119 119
 }
120 120
 
... ...
@@ -188,7 +188,7 @@ func (s *DockerSuite) TestAPIIpcModePrivateAndContainer(c *check.C) {
188 188
  * can use IPC of the host system.
189 189
  */
190 190
 func (s *DockerSuite) TestAPIIpcModeHost(c *check.C) {
191
-	testRequires(c, DaemonIsLinux, NotUserNamespace)
191
+	testRequires(c, DaemonIsLinux, SameHostDaemon, NotUserNamespace)
192 192
 
193 193
 	cfg := container.Config{
194 194
 		Image: "busybox",
... ...
@@ -3022,7 +3022,7 @@ func testDaemonIpcPrivateShareable(d *daemon.Daemon, c *check.C, mustExist bool)
3022 3022
 
3023 3023
 // TestDaemonIpcModeShareable checks that --default-ipc-mode shareable works as intended.
3024 3024
 func (s *DockerDaemonSuite) TestDaemonIpcModeShareable(c *check.C) {
3025
-	testRequires(c, DaemonIsLinux)
3025
+	testRequires(c, DaemonIsLinux, SameHostDaemon)
3026 3026
 
3027 3027
 	s.d.StartWithBusybox(c, "--default-ipc-mode", "shareable")
3028 3028
 	testDaemonIpcPrivateShareable(s.d, c, true)
... ...
@@ -3030,7 +3030,7 @@ func (s *DockerDaemonSuite) TestDaemonIpcModeShareable(c *check.C) {
3030 3030
 
3031 3031
 // TestDaemonIpcModePrivate checks that --default-ipc-mode private works as intended.
3032 3032
 func (s *DockerDaemonSuite) TestDaemonIpcModePrivate(c *check.C) {
3033
-	testRequires(c, DaemonIsLinux)
3033
+	testRequires(c, DaemonIsLinux, SameHostDaemon)
3034 3034
 
3035 3035
 	s.d.StartWithBusybox(c, "--default-ipc-mode", "private")
3036 3036
 	testDaemonIpcPrivateShareable(s.d, c, false)
... ...
@@ -3053,17 +3053,17 @@ func testDaemonIpcFromConfig(s *DockerDaemonSuite, c *check.C, mode string, must
3053 3053
 
3054 3054
 // TestDaemonIpcModePrivateFromConfig checks that "default-ipc-mode: private" config works as intended.
3055 3055
 func (s *DockerDaemonSuite) TestDaemonIpcModePrivateFromConfig(c *check.C) {
3056
+	testRequires(c, DaemonIsLinux, SameHostDaemon)
3056 3057
 	testDaemonIpcFromConfig(s, c, "private", false)
3057 3058
 }
3058 3059
 
3059 3060
 // TestDaemonIpcModeShareableFromConfig checks that "default-ipc-mode: shareable" config works as intended.
3060 3061
 func (s *DockerDaemonSuite) TestDaemonIpcModeShareableFromConfig(c *check.C) {
3062
+	testRequires(c, DaemonIsLinux, SameHostDaemon)
3061 3063
 	testDaemonIpcFromConfig(s, c, "shareable", true)
3062 3064
 }
3063 3065
 
3064 3066
 func testDaemonStartIpcMode(c *check.C, from, mode string, valid bool) {
3065
-	testRequires(c, DaemonIsLinux)
3066
-
3067 3067
 	d := daemon.New(c, dockerBinary, dockerdBinary, daemon.Config{
3068 3068
 		Experimental: testEnv.ExperimentalDaemon(),
3069 3069
 	})
... ...
@@ -3101,6 +3101,8 @@ func testDaemonStartIpcMode(c *check.C, from, mode string, valid bool) {
3101 3101
 // arguments for default IPC mode, and bails out with incorrect ones.
3102 3102
 // Both CLI option (--default-ipc-mode) and config parameter are tested.
3103 3103
 func (s *DockerDaemonSuite) TestDaemonStartWithIpcModes(c *check.C) {
3104
+	testRequires(c, DaemonIsLinux, SameHostDaemon)
3105
+
3104 3106
 	ipcModes := []struct {
3105 3107
 		mode  string
3106 3108
 		valid bool