lib/specinfra/command/base.rb in specinfra-0.7.0 vs lib/specinfra/command/base.rb in specinfra-0.7.1

- old
+ new

@@ -77,10 +77,18 @@ def check_installed(package, version=nil) raise NotImplementedError.new end + def check_service_installed(service) + raise NotImplementedError.new + end + + def check_service_start_mode(service, mode) + raise NotImplementedError.new + end + def check_listening(port) regexp = ":#{port} " "netstat -tunl | grep -- #{escape(regexp)}" end @@ -125,9 +133,14 @@ "grep -q -- #{escape(expected_pattern)} #{escape(file)}" end def check_file_contain_with_fixed_strings(file, expected_pattern) "grep -qF -- #{escape(expected_pattern)} #{escape(file)}" + end + + def check_file_checksum(file, expected) + regexp = "^#{expected}" + "cksum #{escape(file)} | grep -iw -- #{escape(regexp)}" end def check_file_md5checksum(file, expected) regexp = "^#{expected}" "md5sum #{escape(file)} | grep -iw -- #{escape(regexp)}"