Browse code

Add a test to make sure that --tlsverify=false turn on tls in daemon

Signed-off-by: Doug Davis <dug@us.ibm.com>

Doug Davis authored on 2015/07/31 10:38:02
Showing 1 changed files
... ...
@@ -1318,6 +1318,14 @@ func (s *DockerDaemonSuite) TestHttpsInfo(c *check.C) {
1318 1318
 	}
1319 1319
 }
1320 1320
 
1321
+// TestTlsVerify verifies that --tlsverify=false turns on tls
1322
+func (s *DockerDaemonSuite) TestTlsVerify(c *check.C) {
1323
+	out, err := exec.Command(dockerBinary, "daemon", "--tlsverify=false").CombinedOutput()
1324
+	if err == nil || !strings.Contains(string(out), "Could not load X509 key pair") {
1325
+		c.Fatalf("Daemon should not have started due to missing certs: %v\n%s", err, string(out))
1326
+	}
1327
+}
1328
+
1321 1329
 // TestHttpsInfoRogueCert connects via two-way authenticated HTTPS to the info endpoint
1322 1330
 // by using a rogue client certificate and checks that it fails with the expected error.
1323 1331
 func (s *DockerDaemonSuite) TestHttpsInfoRogueCert(c *check.C) {