-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test_fs_funcs.py for get_recent_logs() & readKeyValueFile()
- Loading branch information
1 parent
82b8121
commit c06992e
Showing
2 changed files
with
25 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
"""Regression tests for bugtool helper functions like get_recent_logs()""" | ||
|
||
|
||
def test_get_recent_logs(bugtool): | ||
"""Assert get_recent_logs() returning the most recent file(s)""" | ||
|
||
files = ["/proc/1/stat", "/proc/self/stat"] # self/stat is more recent. | ||
# return the files, ordered by their modification time, most recent first: | ||
assert bugtool.get_recent_logs(files, 9) == files | ||
assert bugtool.get_recent_logs([files[1], files[0]], 9) == files | ||
# When verbosity is 1, only return the most recent file: | ||
assert bugtool.get_recent_logs(files, 1) == [files[1]] | ||
|
||
|
||
def test_read_inventory(bugtool, dom0_template): | ||
"""Assert readKevValueFile() reading the a xensource inventory file""" | ||
|
||
inventory = bugtool.readKeyValueFile(dom0_template + bugtool.XENSOURCE_INVENTORY) | ||
assert inventory["PRODUCT_VERSION"] == "8.3.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters