summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/LTP/cve/run_tests.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/LTP/cve/run_tests.py b/tests/LTP/cve/run_tests.py
index cbe86fd..f8e864f 100644
--- a/tests/LTP/cve/run_tests.py
+++ b/tests/LTP/cve/run_tests.py
@@ -1,4 +1,7 @@
+import os
import pytest
+import pathlib
+import platform
from tests.LTP.agl_test_ltp_base import LTPBase
@@ -6,11 +9,23 @@ class CveBase(LTPBase):
def __init__(self):
super().__init__(test_name="cve")
+ def set_test_env(self):
+ # check into /proc/config.gz
+ path_Obj_gz = pathlib.Path("/proc/config.gz")
+ # check into /lib.modules/ for .config
+ release_info = platform.release()
+ config_file_path = "/lib/modules/" + release_info + "/build/.config"
+ path_Obj_config = pathlib.Path(config_file_path)
+ if not path_Obj_gz.is_file() and not path_Obj_config.is_file():
+ # set ENV "KCONFIG_SKIP_CHECK" to skip .config check
+ os.environ['KCONFIG_SKIP_CHECK'] = "True"
+
instance = CveBase()
test_case_list = instance.get_test_case_list()
@pytest.fixture(scope='module')
def testbase():
+ instance.set_test_env()
yield instance
#package log files and make report file
instance.log_report()