diff --git a/tests/sku_create_test.py b/tests/sku_create_test.py index c9cb6c7870..562ff8cdb5 100644 --- a/tests/sku_create_test.py +++ b/tests/sku_create_test.py @@ -1,13 +1,16 @@ -import sys import os -import pytest -import subprocess import re +import shutil +import subprocess +import sys + +import pytest test_path = os.path.dirname(os.path.abspath(__file__)) modules_path = os.path.dirname(test_path) scripts_path = os.path.join(modules_path, "scripts") input_path = os.path.join(modules_path, "tests/sku_create_input") +output_dir_path = os.path.join(modules_path, "tests/sku_create_input/Mellanox-SN2700-D48C8_NEW") sku_def_file = os.path.join(input_path, "Mellanox-SN2700-D48C8.xml") sku_create_script = os.path.join(scripts_path, "sonic_sku_create.py") output_file_path = os.path.join(modules_path, "tests/sku_create_input/Mellanox-SN2700-D48C8_NEW/port_config.ini") @@ -49,6 +52,9 @@ def are_file_contents_same(self,fname1,fname2): return True def test_no_param(self): + if (os.path.exists(output_dir_path)): + shutil.rmtree(output_dir_path) + my_command = sku_create_script + " -f " + sku_def_file + " -d " + input_path #Test case execution without stdout