Skip to content

Commit

Permalink
use whoami in the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
twangboy committed Oct 16, 2024
1 parent 0bc5492 commit 50290f4
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tests/pytests/functional/utils/test_win_runas.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,22 @@ def user():
yield account


def test_runas(user):
cmd = "hostname && echo foo"
def test_compound_runas(user):
cmd = "hostname && whoami"
result = win_runas.runas(
cmdLine=cmd,
username=user.username,
password=user.password,
)
assert "foo" in result["stdout"]
assert user.username in result["stdout"]


def test_runas_unpriv(user):
cmd = "hostname && echo foo"
def test_compound_runas_unpriv(user):
cmd = "hostname && whoami"
print(user.username)
result = win_runas.runas_unpriv(
cmd=cmd,
username=user.username,
password=user.password,
)
assert "foo" in result["stdout"]
assert user.username in result["stdout"]

0 comments on commit 50290f4

Please sign in to comment.