Browse code

Merge pull request #27503 from Microsoft/validcredspec

Windows: Add cred spec test with well form credentials

Brian Goff authored on 2016/10/26 05:44:52
Showing 2 changed files
... ...
@@ -4539,6 +4539,16 @@ func (s *DockerSuite) TestRunCredentialSpecFailures(c *check.C) {
4539 4539
 	}
4540 4540
 }
4541 4541
 
4542
+// Windows specific test to validate credential specs with a well-formed spec.
4543
+// Note it won't actually do anything in CI configuration with the spec, but
4544
+// it should not fail to run a container.
4545
+func (s *DockerSuite) TestRunCredentialSpecWellFormed(c *check.C) {
4546
+	testRequires(c, DaemonIsWindows, SameHostDaemon)
4547
+	validCS := readFile(`fixtures\credentialspecs\valid.json`, c)
4548
+	writeFile(filepath.Join(dockerBasePath, `credentialspecs\valid.json`), validCS, c)
4549
+	dockerCmd(c, "run", `--security-opt=credentialspec=file://valid.json`, "busybox", "true")
4550
+}
4551
+
4542 4552
 // Windows specific test to ensure that a servicing app container is started
4543 4553
 // if necessary once a container exits. It does this by forcing a no-op
4544 4554
 // servicing event and verifying the event from Hyper-V-Compute
4545 4555
new file mode 100644
... ...
@@ -0,0 +1,25 @@
0
+{
1
+    "CmsPlugins":  [
2
+                       "ActiveDirectory"
3
+                   ],
4
+    "DomainJoinConfig":  {
5
+                             "Sid":  "S-1-5-21-4288985-3632099173-1864715694",
6
+                             "MachineAccountName":  "MusicStoreAcct",
7
+                             "Guid":  "3705d4c3-0b80-42a9-ad97-ebc1801c74b9",
8
+                             "DnsTreeName":  "hyperv.local",
9
+                             "DnsName":  "hyperv.local",
10
+                             "NetBiosName":  "hyperv"
11
+                         },
12
+    "ActiveDirectoryConfig":  {
13
+                                  "GroupManagedServiceAccounts":  [
14
+                                                                      {
15
+                                                                          "Name":  "MusicStoreAcct",
16
+                                                                          "Scope":  "hyperv.local"
17
+                                                                      },
18
+                                                                      {
19
+                                                                          "Name":  "MusicStoreAcct",
20
+                                                                          "Scope":  "hyperv"
21
+                                                                      }
22
+                                                                  ]
23
+                              }
24
+}