Esempio n. 1
0
func verifyDirectoryExecutable(filePath string, testEnvironment *integration.TestEnvironment) {
	fileListing, err := testEnvironment.RunCommand("ls -l -d " + filePath)
	Expect(err).NotTo(HaveOccurred())

	Expect(fileListing[3]).To(Equal(uint8('x')))
	Expect(fileListing[6]).To(Equal(uint8('x')))
	Expect(fileListing[9]).To(Equal(uint8('x')))
}
Esempio n. 2
0
func verifyFilePermissions(filePath string, testEnvironment *integration.TestEnvironment) {
	fileListing, err := testEnvironment.RunCommand("ls -l " + filePath)
	Expect(err).NotTo(HaveOccurred())

	Expect(fileListing[1]).To(Equal(uint8('r')))
	Expect(fileListing[2]).To(Equal(uint8('w')))
	Expect(fileListing[4]).To(Equal(uint8('r')))
	Expect(fileListing[7]).To(Equal(uint8('r')))
}
func verifyFilePerm(perm string, filePath string, testEnvironment *integration.TestEnvironment) {
	filePerms, err := testEnvironment.RunCommand("sudo stat -c '%a %n' " + filePath + " | cut -d' ' -f 1")
	Expect(err).NotTo(HaveOccurred())

	Expect(strings.Trim(filePerms, "\n")).To(Equal(perm))
}
Esempio n. 4
0
func verifyFileContent(filePath string, expectedContent string, testEnvironment *integration.TestEnvironment) {
	deployment, err := testEnvironment.RunCommand("cat " + filePath)
	Expect(err).NotTo(HaveOccurred())
	Expect(deployment).To(Equal(expectedContent))
}