check for platform-specific env. variables
'USERNAME' is not a standard environment variable outside of Windows, which leads to this test failing on non-Windows Meterpreter platforms.
This commit is contained in:
parent
def3112dde
commit
ad1190b5c1
|
@ -53,8 +53,12 @@ class MetasploitModule < Msf::Post
|
|||
|
||||
def test_get_envs
|
||||
it "should return multiple envs" do
|
||||
res = get_envs('PATH','USERNAME')
|
||||
!res['PATH'].blank? && !res['USERNAME'].blank?
|
||||
res = get_envs('PATH','USERNAME','USER')
|
||||
if session.platform =~ /win/i
|
||||
!res['PATH'].blank? && !res['USERNAME'].blank?
|
||||
else
|
||||
!res['PATH'].blank? && !res['USER'].nil?
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue