Question 330
After applying the change "Use systemctl's supported is-active result and branch on the outcome", the team needs to verify: A script tries to detect whether a service is active but relies on grepping a localized human-readable status line. Which test result is strongest evidence of success?
Explanation
Correct Answer
A successful acceptance test is that the script correctly distinguishes stopped and active test services. This relates to the original issue: A script tries to detect whether a service is active but relies on grepping a localized human-readable status line. The administrator applied a change to use systemctl's supported is-active result and branch on the outcome. Verifying real behavior and subsequent reboot state, where applicable, is stronger than observing a successful command alone.
Incorrect Answers
Threshold tests produce the right branch for representative low and high values. That alternative is checked by normalizing and validating the selected numeric capacity value before numerical comparison; the actual requirement instead calls for confirming that the script correctly distinguishes stopped and active test services.
Files with spaces and special characters are each handled without path corruption. Using a safe line- or null-delimited loop instead of unquoted substitution for filenames tests that mechanism, but it does not establish the reported condition—a script tries to detect whether a service is active but relies on grepping a localized human-readable status line.
The variable contains the current command output instead of literal substitution characters. Its technical evidence involves using supported command substitution syntax while preserving safe quoting of the result. For the stated question, confirming that the script correctly distinguishes stopped and active test services is the more relevant test.