MCPcopy
hub / github.com/moby/moby / TestRunTLSVerify

Method TestRunTLSVerify

integration-cli/docker_cli_run_test.go:2362–2383  ·  view source on GitHub ↗
(c *testing.T)

Source from the content-addressed store, hash-verified

2360}
2361
2362func (s *DockerCLIRunSuite) TestRunTLSVerify(c *testing.T) {
2363 // Remote daemons use TLS and this test is not applicable when TLS is required.
2364 testRequires(c, testEnv.IsLocalDaemon)
2365 if out, code, err := dockerCmdWithError("version"); err != nil || code != 0 {
2366 c.Fatalf("Should have worked: %v:\n%v", err, out)
2367 }
2368
2369 var notFoundErr string
2370 if runtime.GOOS == "windows" {
2371 notFoundErr = "ca.pem: The system cannot find the file specified"
2372 } else {
2373 notFoundErr = "ca.pem: no such file or directory"
2374 }
2375
2376 // Regardless of whether we specify true or false we need to
2377 // test to make sure tls is turned on if --tlsverify is specified at all
2378 result := cli.Docker(cli.Args("--tlsverify=false", "version"))
2379 result.Assert(c, icmd.Expected{ExitCode: 1, Err: notFoundErr})
2380
2381 result = cli.Docker(cli.Args("--tlsverify=true", "version"))
2382 result.Assert(c, icmd.Expected{ExitCode: 1, Err: notFoundErr})
2383}
2384
2385func (s *DockerCLIRunSuite) TestRunPortFromDockerRangeInUse(c *testing.T) {
2386 // TODO Windows. Once moved to libnetwork/CNM, this may be able to be

Callers

nothing calls this directly

Calls 4

DockerFunction · 0.92
ArgsFunction · 0.92
testRequiresFunction · 0.85
dockerCmdWithErrorFunction · 0.85

Tested by

no test coverage detected