-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from digitronik/start_stop_test
Start stop test
- Loading branch information
Showing
4 changed files
with
54 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import subprocess | ||
|
||
|
||
def miqsel_cmd(cmd): | ||
""" | ||
Runs a miqsel shell command, and returns the output, err, returncode | ||
""" | ||
ret = subprocess.Popen( | ||
cmd, | ||
shell=True, | ||
stdin=subprocess.PIPE, | ||
stdout=subprocess.PIPE, | ||
stderr=subprocess.PIPE, | ||
close_fds=True, | ||
) | ||
out, err = ret.communicate() | ||
returncode = ret.returncode | ||
return out.decode(), err.decode(), returncode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from tests import miqsel_cmd | ||
|
||
|
||
def test_miqsel_start(ensure_stopped): | ||
"""Check start of miqsel""" | ||
|
||
out, err, returncode = miqsel_cmd("miqsel start") | ||
assert "miq_sel container started" in out | ||
out, err, returncode = miqsel_cmd("miqsel status") | ||
assert out.strip() == "running" | ||
|
||
|
||
def test_miqsel_stop(ensure_running): | ||
"""Check stop of miqsel""" | ||
|
||
miqsel_cmd("miqsel stop") | ||
out, _, _ = miqsel_cmd("miqsel status") | ||
assert out.strip() == "Not running..." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters