DAOS-17519 test: Automate dlck testing (basic/fault_injection) - #17307
DAOS-17519 test: Automate dlck testing (basic/fault_injection)#17307rpadma2 wants to merge 65 commits into
Conversation
Test-tag: DlckBasicFaultTest DlckBasicTest Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
|
Ticket title is 'Automation - Basic dlck test: scan the DAOS system by running the dlck tool.' |
Test-tag: DlckBasicTest DlckBasicFaultTest Skip-func-hw-test-medium: false Skip-func-hw-test-medium-md-on-ssd: false Skip-unit-test: true Skip-fault-injection-test: true Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
Skip-func-hw-test-medium: false Skip-func-hw-test-medium-md-on-ssd: false Skip-unit-test: true Skip-fault-injection-test: true Skip-nlt: true Test-tag: DlckBasicFaultTest DlckBasicTest
|
Test stage Functional Hardware Medium completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-17307/3/execution/node/932/log |
|
Test stage Functional Hardware Medium MD on SSD completed with status UNSTABLE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos//view/change-requests/job/PR-17307/3/testReport/ |
Skip-func-hw-test-medium: false Skip-func-hw-test-medium-md-on-ssd: false Skip-unit-test: true Skip-fault-injection-test: true Skip-nlt: true Test-tag: DlckBasicFaultTest DlckBasicTest Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
|
Test stage Functional Hardware Medium MD on SSD completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-17307/4/execution/node/966/log |
Skip-func-hw-test-medium: false Skip-func-hw-test-medium-md-on-ssd: false Skip-unit-test: true Skip-fault-injection-test: true Skip-nlt: true Test-tag: DlckBasicFaultTest DlckBasicTest Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
Skip-func-hw-test-medium: false Skip-func-hw-test-medium-md-on-ssd: false Skip-unit-test: true Skip-fault-injection-test: true Skip-nlt: true Test-tag: DlckBasicFaultTest DlckBasicTest Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
|
Test stage Functional Hardware Medium MD on SSD completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-17307/5/execution/node/988/log |
Skip-func-hw-test-medium: false Skip-func-hw-test-medium-md-on-ssd: false Skip-unit-test: true Skip-fault-injection-test: true Skip-nlt: true Test-tag: DlckBasicFaultTest DlckBasicTest Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
|
Test stage Functional Hardware Medium MD on SSD completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-17307/6/execution/node/867/log |
Skip-func-hw-test-medium: false Skip-func-hw-test-medium-md-on-ssd: false Skip-unit-test: true Skip-fault-injection-test: true Skip-nlt: true Test-tag: DlckBasicFaultTest DlckBasicTest Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
|
Test stage Functional Hardware Medium MD on SSD completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-17307/7/execution/node/866/log |
Skip-func-hw-test-medium: false Skip-func-hw-test-medium-md-on-ssd: false Skip-unit-test: true Skip-fault-injection-test: true Skip-nlt: true Test-tag: DlckBasicFaultTest DlckBasicTest Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
|
Test stage Functional Hardware Medium MD on SSD completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-17307/8/execution/node/1073/log |
|
Test stage Functional Hardware Medium completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-17307/8/execution/node/1083/log |
Skip-func-hw-test-medium: false Skip-func-hw-test-medium-md-on-ssd: false Skip-unit-test: true Skip-fault-injection-test: true Skip-nlt: true Test-tag: DlckBasicFaultTest DlckBasicTest Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
Skip-func-hw-test-medium: false Skip-func-hw-test-medium-md-on-ssd: false Skip-unit-test: true Skip-fault-injection-test: true Skip-nlt: true Test-tag: DlckBasicFaultTest DlckBasicTest Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
|
Test stage Functional Hardware Medium MD on SSD completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-17307/9/execution/node/1072/log |
|
Test stage Functional Hardware Medium completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-17307/9/execution/node/1082/log |
Skip-func-hw-test-medium: false Skip-func-hw-test-medium-md-on-ssd: false Skip-unit-test: true Skip-fault-injection-test: true Skip-nlt: true Test-tag: DlckBasicFaultTest DlckBasicTest Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
Skip-func-hw-test-medium: false Skip-func-hw-test-medium-md-on-ssd: false Skip-unit-test: true Skip-fault-injection-test: true Skip-nlt: true Test-tag: DlckBasicFaultTest DlckBasicTest Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
|
Test stage Build on EL 9 completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-17307/39/execution/node/520/log |
Skip-func-hw-test-medium: false Skip-func-hw-test-medium-md-on-ssd: false Skip-fault-injection-test: true Skip-unit-test: true Skip-nlt: true Test-tag: DlckBasicFaultTest DlckBasicTest Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
Skip-func-hw-test-medium: false Skip-func-hw-test-medium-md-on-ssd: false Skip-fault-injection-test: true Skip-unit-test: true Skip-nlt: true Test-tag: DlckBasicFaultTest DlckBasicTest Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
|
Test stage Build on EL 9 completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-17307/40/execution/node/531/log |
Skip-func-hw-test-medium: false Skip-func-hw-test-medium-md-on-ssd: false Skip-fault-injection-test: true Skip-unit-test: true Skip-nlt: true Test-tag: DlckBasicFaultTest DlckBasicTest Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
Skip-func-hw-test-medium: false Skip-func-hw-test-medium-md-on-ssd: false Skip-fault-injection-test: true Skip-unit-test: true Skip-nlt: true Test-tag: DlckBasicFaultTest DlckBasicTest Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
Skip-func-hw-test-medium: false Skip-func-hw-test-medium-md-on-ssd: false Skip-fault-injection-test: true Skip-unit-test: true Skip-nlt: true Test-tag: DlckBasicFaultTest DlckBasicTest Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
Skip-func-hw-test-medium: false Skip-func-hw-test-medium-md-on-ssd: false Skip-fault-injection-test: true Skip-unit-test: true Skip-nlt: true Test-tag: DlckBasicFaultTest DlckBasicTest Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
Skip-func-hw-test-medium: false Skip-func-hw-test-medium-md-on-ssd: false Skip-fault-injection-test: true Skip-unit-test: true Skip-nlt: true Test-tag: DlckBasicFaultTest DlckBasicTest Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
|
Thanks @janekmi , @phender , @daltonbohning and @shimizukko for your reviews... The dlck test framework seems to be much better now. Take a look at the latest changes. |
Skip-func-hw-test-medium: false Skip-func-hw-test-medium-md-on-ssd: false Skip-fault-injection-test: true Skip-unit-test: true Skip-nlt: true Test-tag: DlckBasicFaultTest DlckBasicTest Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
Skip-func-hw-test-medium: false Skip-func-hw-test-medium-md-on-ssd: false Skip-fault-injection-test: true Skip-unit-test: true Skip-nlt: true Test-tag: DlckBasicFaultTest DlckBasicTest Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
| errors = [] | ||
| dmg = self.get_dmg_command() | ||
| self.log_step("Create a pool to run dlck") | ||
| pool = add_pool(self) |
There was a problem hiding this comment.
We actually want to go back to using ONLY self.get_pool so if you need to push again, please change this to use self.get_pool.
| errors.append(f"dlck failed on {result.failed_hosts}") | ||
| self.fail(f"dlck basic test failed with errors: {errors}") |
There was a problem hiding this comment.
This is the only error in the list, so I think we should just print it directly
| errors.append(f"dlck failed on {result.failed_hosts}") | |
| self.fail(f"dlck basic test failed with errors: {errors}") | |
| self.fail(f"dlck failed on {result.failed_hosts}") |
| test_servers: 1 | ||
| test_clients: 1 | ||
|
|
||
| timeout: 600 |
There was a problem hiding this comment.
The last run completed in under 5 minutes so maybe this can be reduce to like 7 minutes?
| timeout: 600 | |
| timeout: 420 |
| self.log.info("Faults: %s", fault_list) | ||
| self.log.info("Faults dict: %s", faults_dict) | ||
| dmg = self.get_dmg_command() | ||
| pool = add_pool(self) |
There was a problem hiding this comment.
| pool = add_pool(self) | |
| pool = self.get_pool(self) |
| count = 0 | ||
| for key, value in faults_dict[test_fault].items(): | ||
| if count == 0: | ||
| f.write(f"- {key}: \'{value}\'\n") | ||
| else: | ||
| f.write(f" {key}: \'{value}\'\n") | ||
| count += 1 |
There was a problem hiding this comment.
You can use enumerate instead of keeping track of the count
| count = 0 | |
| for key, value in faults_dict[test_fault].items(): | |
| if count == 0: | |
| f.write(f"- {key}: \'{value}\'\n") | |
| else: | |
| f.write(f" {key}: \'{value}\'\n") | |
| count += 1 | |
| for count, (key, value) in enumerate(d.items()): | |
| if count == 0: | |
| f.write(f"- {key}: \'{value}\'\n") | |
| else: | |
| f.write(f" {key}: \'{value}\'\n") |
There was a problem hiding this comment.
done. Good suggestion !
| super().__init__(namespace, "dlck", path) | ||
| self.pool_uuid = FormattedParameter("--file={}", None) | ||
| self.nvme = FormattedParameter("--nvme={}", None) | ||
| self.storage_mount = FormattedParameter("--storage={}", None) |
There was a problem hiding this comment.
Any reason to not call this self.storage to match the command line param name?
There was a problem hiding this comment.
Since the server and pool config is the same for each test, I would suggest combining these two tests into a single python file.
There was a problem hiding this comment.
Yes. Merged both the test cases to a single python file...
Skip-func-hw-test-medium: false Skip-func-hw-test-medium-md-on-ssd: false Skip-fault-injection-test: true Skip-unit-test: true Skip-nlt: true Test-tag: DlckBasicFaultTest DlckBasicTest Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
Skip-func-hw-test-medium: false Skip-func-hw-test-medium-md-on-ssd: false Skip-fault-injection-test: true Skip-unit-test: true Skip-nlt: true Test-tag: DlckBasicFaultTest DlckBasicTest Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
Skip-func-hw-test-medium: false Skip-func-hw-test-medium-md-on-ssd: false Skip-fault-injection-test: true Skip-unit-test: true Skip-nlt: true Test-tag: DlckBasicFaultTest DlckBasicTest Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
|
Hmm... Something doesn't work after I changed to use get_pool instead of add_pool... Let me debug it later... |
Skip-func-hw-test-medium: false Skip-func-hw-test-medium-md-on-ssd: false Skip-fault-injection-test: true Skip-unit-test: true Skip-nlt: true Test-tag: DlckBasicFaultTest DlckBasicTest Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
| raise TypeError(f"Invalid {self.command} host NodeSet: {value} ({type(value)})") | ||
| self._hosts = value.copy() | ||
|
|
||
| def _run_process(self, raise_exception=None): |
There was a problem hiding this comment.
Should the default for raise_exception be False instead of None?
There was a problem hiding this comment.
@shimizukko : Presently I am using this file based on @phender PR (related to his branch : hendersp/DAOS-19532 . Hopefully, all issues related to command_utils.py is addressed in that PR which I merge to my branch later.
| Returns: | ||
| CommandResult: result from running the command | ||
| """ | ||
| if raise_exception is None: |
There was a problem hiding this comment.
If it's bool shouldn't we use False?
| if raise_exception is None: | |
| if raise_exception is False: |
| detected, running = stop_processes( | ||
| self.log, hosts, regex, full_command=self.full_command_regex) | ||
| if not detected: | ||
| self.log.info( |
There was a problem hiding this comment.
Shouldn't we collect error here (and elif and else block below) and return it at the end?
| from command_utils_base import CommandWithParameters, FormattedParameter | ||
| from run_utils import run_remote | ||
|
|
||
| class TestDlck(TestWithServers): |
There was a problem hiding this comment.
I believe the pattern is to separate util file and test base file. If this is a test base file, the class name should be:
| class TestDlck(TestWithServers): | |
| class DlckTestBase(TestWithServers): |
The file name should be dlck_test_base.py
There was a problem hiding this comment.
@daltonbohning / @phender : Any comments? I can do whatever we decide. This is an initial version... I am pretty sure we will be create lot of utility functions later....
| errors.append(error) | ||
| self.log_step("Run the dmg start command") | ||
| dmg.system_start() | ||
|
|
There was a problem hiding this comment.
There is no line break from beginning of the test to here. IMO, it would be easier to read by adding a few line breaks to separate many lines of code into blocks of code that runs similar tasks.
There was a problem hiding this comment.
I will do it later... Let the present PR run complete.
| :avocado: recursive | ||
| """ | ||
| def check_dlck_result(self, result, fault_name): | ||
| """Check that dlck reports the expected error for an injected fault.""" |
There was a problem hiding this comment.
You might want to add Args section to explain the arguments.
Also, the description would be more clear if you say "Check that dlck reported the expected error..."
| with open(fault_inject_file, 'w') as f: | ||
| f.write("fault_config:\n") | ||
| for count, (key, value) in enumerate(faults_dict[test_fault].items()): | ||
| if count == 0: | ||
| f.write(f"- {key}: \'{value}\'\n") | ||
| else: | ||
| f.write(f" {key}: \'{value}\'\n") |
There was a problem hiding this comment.
I just realized it makes little sense we generate a YAML file line by line when we could use the pyyaml package. From what I see we already use it in functional tests. Please look out for import yaml.
There was a problem hiding this comment.
I believe it would look like something like:
fault_config = {
'fault_config': [
{key: str(value) for key, value in faults_dict[test_fault].items()}]}
with open(fault_inject_file, 'w') as f:
yaml.dump(fault_config, f, default_flow_style=False)
Skip-func-hw-test-medium: false
Skip-func-hw-test-medium-md-on-ssd: false
Skip-fault-injection-test: true
Skip-unit-test: true
Skip-nlt: true
Test-tag: DlckBasicFaultTest DlckBasicTest
Steps for the author:
After all prior steps are complete: