-
Notifications
You must be signed in to change notification settings - Fork 670
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
17fe792
commit acfd7f4
Showing
2 changed files
with
121 additions
and
130 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
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 |
---|---|---|
@@ -1,45 +1,39 @@ | ||
import os | ||
|
||
from ecn_test import * | ||
import sys | ||
from ecn_test import TestEcnConfigBase | ||
from ecn_input.ecn_test_vectors import * | ||
|
||
root_path = os.path.dirname(os.path.abspath(__file__)) | ||
modules_path = os.path.dirname(root_path) | ||
scripts_path = os.path.join(modules_path, "scripts") | ||
sys.path.insert(0, root_path) | ||
sys.path.insert(0, modules_path) | ||
|
||
|
||
class TestEcnConfigMultiAsic(object): | ||
class TestEcnConfigMultiAsic(TestEcnConfigBase): | ||
@classmethod | ||
def setup_class(cls): | ||
os.environ["PATH"] += os.pathsep + scripts_path | ||
super().setup_class() | ||
os.environ["UTILITIES_UNIT_TESTING_TOPOLOGY"] = "multi_asic" | ||
os.environ['UTILITIES_UNIT_TESTING'] = "2" | ||
print("SETUP") | ||
|
||
def test_ecn_show_config_all_masic(self): | ||
TestEcnConfig.executor(testData['ecn_show_config_masic']) | ||
self.executor(testData['ecn_show_config_masic']) | ||
|
||
def test_ecn_show_config_all_verbose_masic(self): | ||
TestEcnConfig.executor(testData['test_ecn_show_config_verbose_masic']) | ||
self.executor(testData['test_ecn_show_config_verbose_masic']) | ||
|
||
def test_ecn_show_config_one_masic(self): | ||
TestEcnConfig.executor(testData['test_ecn_show_config_namespace']) | ||
self.executor(testData['test_ecn_show_config_namespace']) | ||
|
||
def test_ecn_show_config_one_verbose_masic(self): | ||
TestEcnConfig.executor(testData['test_ecn_show_config_namespace_verbose']) | ||
self.executor(testData['test_ecn_show_config_namespace_verbose']) | ||
|
||
def test_ecn_config_change_other_threshold_masic(self): | ||
TestEcnConfig.executor(testData['ecn_cfg_threshold_masic']) | ||
self.executor(testData['ecn_cfg_threshold_masic']) | ||
|
||
def test_ecn_config_change_other_prob_masic(self): | ||
TestEcnConfig.executor(testData['ecn_cfg_probability_masic']) | ||
self.executor(testData['ecn_cfg_probability_masic']) | ||
|
||
@classmethod | ||
def teardown_class(cls): | ||
os.environ['PATH'] = os.pathsep.join(os.environ['PATH'].split(os.pathsep)[:-1]) | ||
os.environ['UTILITIES_UNIT_TESTING'] = "0" | ||
super().teardown_class() | ||
os.environ["UTILITIES_UNIT_TESTING_TOPOLOGY"] = "" | ||
if os.path.isfile('/tmp/ecnconfig'): | ||
os.remove('/tmp/ecnconfig') | ||
print("TEARDOWN") |