forked from autotest/virt-test
-
Notifications
You must be signed in to change notification settings - Fork 0
WritingAdvancedTests
Lucas Meneghel Rodrigues edited this page Jan 10, 2013
·
1 revision
Now that you wrote your first simple test, we'll try some more involved examples. First, let's talk about some useful APIs and concepts:
As virt-tests evolved, a number of libraries were written to help test writers. Let's see what some of them can do:
- virttest.data_dir -> Has functions to get paths for resource files. One of the most used functions is data_dir.get_data_dir(), that returns the path shared/data, which helps you to get files.
from virttest import data_dir
Very frequently we may get values from the config set. All virt tests take 3 params:
test -> Test object params -> Dict with current test params env -> Environment file being used for the test job
You might pick any parameter using
variable_name = params.get("param_name", default_value)
You can update the parameters using