Add functional test for 'clean' subcommand 95/108195/2
authorBartek Grzybowski <b.grzybowski@partner.samsung.com>
Mon, 25 May 2020 10:56:58 +0000 (03:56 -0700)
committerMorgan Richomme <morgan.richomme@orange.com>
Mon, 25 May 2020 14:06:11 +0000 (14:06 +0000)
Change-Id: Iac2b7d5f912b22c6c4b342e350a71ee6ad8b1fbb
Issue-ID: INT-1577
Signed-off-by: Bartek Grzybowski <b.grzybowski@partner.samsung.com>
test/mocks/mass-pnf-sim/conftest.py
test/mocks/mass-pnf-sim/test_lifecycle.py

index b5502f3..3323440 100644 (file)
@@ -32,3 +32,7 @@ def args_trigger(parser):
 @pytest.fixture(scope="module")
 def args_trigger_custom(parser):
     return parser.parse_args(['trigger_custom', '--triggerstart', '0', '--triggerend', str(SIM_INSTANCES-1)])
+
+@pytest.fixture
+def args_clean(parser):
+    return parser.parse_args(['clean'])
index 9c5ff89..dc1160c 100644 (file)
@@ -126,3 +126,9 @@ def test_stop_idempotence(args_stop, caplog, capfd):
         assert f'Stopping pnf-sim-lw-{instance} instance:' in caplog.text
         assert 'ROP_file_creator.sh already not running' in msg.out
         assert 'Simulator containers are already down' in msg.out
+    caplog.clear()
+
+def test_clean(args_clean):
+    m = MassPnfSim(args_clean)
+    m.clean()
+    assert not glob(f"{m.sim_dirname_pattern}*")