lib/specinfra/command/base.rb in specinfra-2.0.0.beta3 vs lib/specinfra/command/base.rb in specinfra-2.0.0.beta4
- old
+ new
@@ -119,9 +119,13 @@
def check_process(process)
"ps aux | grep -w -- #{escape(process)} | grep -qv grep"
end
+ def check_process_count(process,count)
+ "test $(ps aux | grep -w -- #{escape(process)} | grep -v grep | wc -l) -eq #{escape(count)}"
+ end
+
def get_process(process, opts)
"ps -C #{escape(process)} -o #{opts[:format]} | head -1"
end
def check_file_contain(file, expected_pattern)