From b8977ae537d96b1023a5c65b14317cee6fb7e256 Mon Sep 17 00:00:00 2001 From: John Howard Date: Tue, 18 Oct 2016 11:45:32 -0700 Subject: [PATCH] Windows: Cred spec test with well form credentials Signed-off-by: John Howard --- integration-cli/docker_cli_run_test.go | 10 ++++++++ .../fixtures/credentialspecs/valid.json | 25 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 integration-cli/fixtures/credentialspecs/valid.json diff --git a/integration-cli/docker_cli_run_test.go b/integration-cli/docker_cli_run_test.go index cedbc40261..866eb7c594 100644 --- a/integration-cli/docker_cli_run_test.go +++ b/integration-cli/docker_cli_run_test.go @@ -4539,6 +4539,16 @@ func (s *DockerSuite) TestRunCredentialSpecFailures(c *check.C) { } } +// Windows specific test to validate credential specs with a well-formed spec. +// Note it won't actually do anything in CI configuration with the spec, but +// it should not fail to run a container. +func (s *DockerSuite) TestRunCredentialSpecWellFormed(c *check.C) { + testRequires(c, DaemonIsWindows, SameHostDaemon) + validCS := readFile(`fixtures\credentialspecs\valid.json`, c) + writeFile(filepath.Join(dockerBasePath, `credentialspecs\valid.json`), validCS, c) + dockerCmd(c, "run", `--security-opt=credentialspec=file://valid.json`, "busybox", "true") +} + // Windows specific test to ensure that a servicing app container is started // if necessary once a container exits. It does this by forcing a no-op // servicing event and verifying the event from Hyper-V-Compute diff --git a/integration-cli/fixtures/credentialspecs/valid.json b/integration-cli/fixtures/credentialspecs/valid.json new file mode 100644 index 0000000000..28913e49de --- /dev/null +++ b/integration-cli/fixtures/credentialspecs/valid.json @@ -0,0 +1,25 @@ +{ + "CmsPlugins": [ + "ActiveDirectory" + ], + "DomainJoinConfig": { + "Sid": "S-1-5-21-4288985-3632099173-1864715694", + "MachineAccountName": "MusicStoreAcct", + "Guid": "3705d4c3-0b80-42a9-ad97-ebc1801c74b9", + "DnsTreeName": "hyperv.local", + "DnsName": "hyperv.local", + "NetBiosName": "hyperv" + }, + "ActiveDirectoryConfig": { + "GroupManagedServiceAccounts": [ + { + "Name": "MusicStoreAcct", + "Scope": "hyperv.local" + }, + { + "Name": "MusicStoreAcct", + "Scope": "hyperv" + } + ] + } +}