Skip to content

Commit

Permalink
Remove SKU create pytest output directory before execution of the scr…
Browse files Browse the repository at this point in the history
…ipt (sonic-net#1226)

Remove SKU create pytest output directory before execution of the script

Co-authored-by: Madhan Babu <madhan@arc-build-server.mtr.labs.mlnx>
  • Loading branch information
madhanmellanox and Madhan Babu committed Nov 9, 2020
1 parent 12e1a0f commit b693cf6
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/sku_create_test.py
Original file line number Diff line number Diff line change
@@ -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")
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b693cf6

Please sign in to comment.