Commit 31a07ec
committed
common/rc: introduce _load_module()
When a test case requires specific modules for testing, it loads and
uses the modules. To maintain a clean environment, it is desired that
the test case unloads after execution. The modules should be unloaded
only when the module was not loaded before the test case run. However,
writing logic to determine the module load status and unload accordingly
can be cumbersome.
To simplify and standardize such module unload control, introduce the
helper function _load_module(). It attempts to load the specified
module and records it to the global array MODULES_TO_UNLOAD only when
the module was not already loaded. Modules listed in MODULES_TO_UNLOAD
are unloaded by _unload_modules() after each test case run.
Reviewed-by: Daniel Wagner <[email protected]>
Signed-off-by: Shin'ichiro Kawasaki <[email protected]>1 parent 756d18d commit 31a07ec
1 file changed
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
72 | 84 | | |
73 | 85 | | |
74 | 86 | | |
| |||
0 commit comments