hardMultiple Choice
350-401 Practice Question: An engineer is using the Cisco pyATS framework to…
An engineer is using the Cisco pyATS framework to test the configuration of a new QoS policy on a router. The engineer writes a testbed file and a test script that logs into the router, applies the configuration, and then verifies the output of 'show policy-map interface'. The test script fails because the verification step cannot find the expected output. The engineer confirms that the configuration was applied successfully. What is the most likely cause of the failure?
⚠ Common exam trap
Cisco often tests the misconception that CLI configuration changes are reflected immediately in show commands, when in reality there is often a brief propagation delay that automation scripts must account for with a wait mechanism.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
The test script does not include a sleep or wait mechanism after applying the configuration.
After applying a QoS policy with the `service-policy` command, the router may take a short time to update the operational state shown in `show policy-map interface`. Without an explicit sleep or wait mechanism in the pyATS test script, the verification step executes before the router has processed and reflected the new policy, causing a mismatch even though the configuration was applied successfully.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The pyATS library requires Python 3.8 or later, and the engineer is using an older version.
Why it's wrong here
pyATS supports a broad range of Python 3.x versions (commonly 3.6 and newer), and the engineer's environment is demonstrably capable of running the script because the configuration was applied successfully. A Python version mismatch would typically surface as an import error, SyntaxError, or a missing module attribute when the script starts, not as a post-verification failure after a config push. Since the script executed and sent configuration to the router, the Python interpreter is compatible with the pyATS and Genie libraries in use; therefore, this is not the root cause.
- ✗
The testbed file has incorrect credentials for the router.
Why it's wrong here
The engineer explicitly confirmed that the configuration was applied to the router, which proves that authentication and authorization via the testbed file already succeeded. If the testbed file contained incorrect credentials, the script would fail at the connection phase with a 'connection refused' or 'authentication failed' error, and no configuration commands would ever be sent. Because the configuration change actually took effect, the credentials in the testbed file must be valid, so this option cannot be the reason the verification step is not seeing the QoS policy.
- ✓
The test script does not include a sleep or wait mechanism after applying the configuration.
Why this is correct
When a QoS policy is applied on a Cisco IOS-XE device, the operational output—such as 'show policy-map interface'—does not update instantly; the device takes a short period to propagate the configuration into its internal data structures and hardware abstraction layer. The test script pushes the configuration and immediately parses the output without any sleep, wait, or polling loop, so the verification runs before the policy is fully reflected. Adding a delay (for example, 'time.sleep(5)' or a Genie 'learn' with a 'sleep' argument) or implementing a retry loop would give the device time to converge and allow the test to pass.
- ✗
The test script uses the 'genie' library instead of 'pyats' for parsing.
Why it's wrong here
Genie is not an alternative to pyATS; it is the built-in parsing and modeling library that is part of the pyATS framework. Using the 'genie' library is the correct and standard approach for parsing command output into structured data in pyATS-based scripts, as it provides parsers for show commands, OSPF, BGP, and many other features. The script correctly used Genie to parse the 'show policy-map' output, so this is not a mistake—it is the expected methodology. Thus, choosing Genie over pyATS for parsing cannot explain why the QoS policy is missing from the parsed results.
Go deeper
Related to this question
About these practice questions
One of 1,923 original 350-401 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This 350-401 practice question is part of Courseiva's free Cisco certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 350-401 exam.