// SetupTempDir is a utility function for kubeadm testing, that creates a temporary directory // NB. it is up to the caller to cleanup the folder at the end of the test with defer os.RemoveAll(tmpdir) func SetupTempDir(t *testing.T) string { … } // SetupEmptyFiles is a utility function for kubeadm testing that creates one or more empty files (touch) func SetupEmptyFiles(t *testing.T, tmpdir string, fileNames ...string) { … } // SetupPkiDirWithCertificateAuthority is a utility function for kubeadm testing that creates a // CertificateAuthority cert/key pair into /pki subfolder of a given temporary directory. // The function returns the path of the created pki. func SetupPkiDirWithCertificateAuthority(t *testing.T, tmpdir string) string { … } // AssertFilesCount is a utility function for kubeadm testing that asserts if the given folder contains // count files. func AssertFilesCount(t *testing.T, dirName string, count int) { … } // AssertFileExists is a utility function for kubeadm testing that asserts if the given folder contains // the given files. func AssertFileExists(t *testing.T, dirName string, fileNames ...string) { … } // AssertError checks that the provided error matches the expected output func AssertError(t *testing.T, err error, expected string) { … } // GetDefaultInternalConfig returns a defaulted kubeadmapi.InitConfiguration func GetDefaultInternalConfig(t *testing.T) *kubeadmapi.InitConfiguration { … }