1
mirror of https://github.com/rapid7/metasploit-framework synced 2024-11-05 14:57:30 +01:00

Add a test for listing processes

This commit is contained in:
James Lee 2012-05-17 16:51:29 -06:00
parent c0d17734ed
commit 2197332c3d

View File

@ -22,6 +22,29 @@ class Metasploit4 < Msf::Post
end
def test_sys_process
vprint_status("Starting process tests")
it "should return its own process id" do
pid = session.sys.process.getpid
vprint_status("Pid: #{pid}")
true
end
it "should return a list of processes" do
ret = true
list = session.sys.process.get_processes
ret &&= (list && list.length > 0)
pid = session.sys.process.getpid
process = list.find{ |p| p['pid'] == pid }
vprint_status("PID info: #{process.inspect}")
ret &&= !(process.nil?)
ret
end
end
def test_sys_config
vprint_status("Starting system config tests")