-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhance system test automation for parallelism and crash configuration
Signed-off-by: Suma R <[email protected]>
- Loading branch information
Suma R
authored and
Suma R
committed
Nov 26, 2024
1 parent
0cb1077
commit 2e2e2e0
Showing
5 changed files
with
671 additions
and
243 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 |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import os | ||
import traceback | ||
|
||
from tests.cephfs.cephfs_system.cephfs_system_utils import CephFSSystemUtils | ||
from utility.log import Log | ||
|
||
log = Log(__name__) | ||
|
||
|
||
def run(ceph_cluster, **kw): | ||
""" | ||
This script is a wrapper to Logs enablement and Logs collection module available in cephfs_uitlsV1 | ||
It can be included prior to test case execution to enable debug logs and post testcase execution to collect logs, | ||
PRETEST: To enable logs | ||
----------------------- | ||
- test: | ||
name: Enable system debug logs | ||
module: cephfs_logs_util.py | ||
config: | ||
ENABLE_LOGS : 1 | ||
daemon_dbg_level : {'mds':5} | ||
POSTTEST: To collect logs | ||
------------------------- | ||
- test: | ||
name: Collect and upload system logs | ||
module: cephfs_logs_util.py | ||
config: | ||
UPLOAD_LOGS : 1 | ||
daemon_list : ['mds'] | ||
POSTTEST: To disable logs | ||
------------------------- | ||
- test: | ||
name: Disable debug logs | ||
module: cephfs_logs_util.py | ||
config: | ||
DISABLE_LOGS : 1 | ||
daemon_list : ['mds'] | ||
This script will read input params ENABLE_LOGS,UPLOAD_LOGS and DISABLE_LOGS and invoke corresponding | ||
cephfs_utilsV1 module to perform the task. If UPLOAD_LOGS, script will print the path were logs are uploadded. | ||
""" | ||
try: | ||
fs_system_utils = CephFSSystemUtils(ceph_cluster) | ||
config = kw.get("config") | ||
clients = ceph_cluster.get_ceph_objects("client") | ||
client = clients[1] | ||
log.info("checking Pre-requisites") | ||
|
||
if not clients: | ||
log.info( | ||
f"This test requires minimum 1 client nodes.This has only {len(clients)} clients" | ||
) | ||
return 1 | ||
|
||
daemon_list = config.get("daemon_list", ["mds"]) | ||
crash_setup = config.get("crash_setup", 0) | ||
crash_check = config.get("crash_check", 0) | ||
crash_copy = config.get("crash_copy", 1) | ||
log_str = ( | ||
f"Test Params : Crash Setup : {crash_setup}, Crash check:{crash_check}" | ||
) | ||
log_str += f", daemon_list : {daemon_list}" | ||
log.info(log_str) | ||
if crash_setup == 1: | ||
log.info(f"Setup Crash configuration for : {daemon_list}") | ||
fs_system_utils.crash_setup(client, daemon_list=daemon_list) | ||
|
||
if crash_check == 1: | ||
log_dir = os.path.dirname(log.logger.handlers[0].baseFilename) | ||
log.info(f"log path:{log_dir}") | ||
log.info(f"Check for crash from : {daemon_list}") | ||
fs_system_utils.crash_check( | ||
client, crash_copy=crash_copy, daemon_list=daemon_list | ||
) | ||
return 0 | ||
|
||
except Exception as e: | ||
log.info(e) | ||
log.info(traceback.format_exc()) | ||
return 1 |
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
Oops, something went wrong.