Skip to content

Commit

Permalink
Add test for etcd cert population
Browse files Browse the repository at this point in the history
  • Loading branch information
caseydavenport committed Sep 4, 2020
1 parent 26de77b commit b1ec9b3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/install/install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,12 +240,16 @@ PuB/TL+u2y+iQUyXxLy3
It("Should copy a non-hidden file", func() {
err = ioutil.WriteFile(tempDir+"/certs/etcd-cert", []byte("doesn't matter"), 0644)
Expect(err).NotTo(HaveOccurred(), fmt.Sprintf("Failed to write file: %v", err))
err = runCniContainer(tempDir, "-v", tempDir+"/certs:/calico-secrets")
err = runCniContainer(tempDir, "-v", tempDir+"/certs:/calico-secrets", "-e", "CNI_NETWORK_CONFIG={\"etcd_cert\": \"__ETCD_CERT_FILE__\"}")
Expect(err).NotTo(HaveOccurred())
file, err := os.Open(tempDir + "/net.d/calico-tls/etcd-cert")
Expect(err).NotTo(HaveOccurred())
err = file.Close()
Expect(err).NotTo(HaveOccurred())

// Expect the config to have the correct value filled in.
expectedConfig := "{\"etcd_cert\": \"/etc/cni/net.d/calico-tls/etcd-cert\"}"
expectFileContents(tempDir+"/net.d/10-calico.conflist", expectedConfig)
})
})
})
Expand Down

0 comments on commit b1ec9b3

Please sign in to comment.