lib/xfstests_utils.pm

heartbeat_prepare

Create heartbeat script and directories (Call it only once)

heartbeat_start

Start heartbeat, setup environment variables (Call it everytime SUT reboots)

heartbeat_stop

Stop heartbeat

heartbeat_wait

Wait for heartbeat

test_wait

Wait for test to finish

test_name

Format the name of a subtest, because we don't want / to be seen like directory (e.g. xfs-005) test - specific test (e.g. xfs/005)

log_add

Add one test result to log file file - log file test - specific test (e.g. xfs/008) status - test status time - time consumed

tests_from_category

Return all the tests of a specific xfstests category category - xfstests category (e.g. generic) dir - xfstests installation dir (e.g. /opt/xfstests)

exclude_grouplist

Return matched exclude tests from groups in XFSTESTS_GROUPLIST return structure - hash Group name start with ! will exclude in test, and expected to use to update blacklist If TEST_RANGES contain generic tests, then exclude tests from generic folder, else will exclude tests from filesystem type folder

include_grouplist

Return matched include tests from groups in XFSTESTS_GROUPLIST return structure - array Group name start without ! will include in test, and expected to use to update test ranges If TEST_RANGES contain generic tests, then include tests from generic folder, else will include tests from filesystem type folder

tests_from_ranges

Return a list of tests to run from given test ranges ranges - test ranges (e.g. xfs/001-100,btrfs/100-159) dir - xfstests installation dir (e.g. /opt/xfstests)

test_run

# Run a single test and write log to file # test - test to run (e.g. xfs/001)

save_kdump

Save kdump data for further uploading test - corresponding test(e.g. xfs/009) dir - Save kdump data to this dir vmcore - include vmcore file kernel - include kernel

shuffle

mess up the order of test queue

copy_log

Log & Must included: Copy log to ready to save

copy_fsxops

Log: Copy junk.fsxops for fails fsx tests included in subtests

dump_btrfs_img

Log: Only run in test Btrfs, collect image dump for inconsistent error

raw_dump

Log: Raw dump from SCRATCH_DEV via dd

collect_fs_status

Log: Collect fs runtime status for XFS, Btrfs and Ext4

copy_all_log

Add all above logs

reload_loop_device

Reload loop device for xfstests

umount_xfstests_dev

Umount TEST_DEV and SCRATCH_DEV

config_debug_option

Enable softlockup panic collection and could manually enable other setting by XFSTESTS_DEBUG

test_run_without_heartbeat

Run a single test and write log to file but without heartbeat, return log_add output

check_bugzilla_status

A function use in white list, to check bugzilla status and write messages in output