Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xfstests: Add XFSTESTS_PART_SIZE parameter #20304

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions tests/xfstests/partition.pm
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ use Utils::Systemd 'disable_and_stop_service';
use registration;
use version_utils qw(is_transactional);
use transactional;
use List::Util 'sum';

my $INST_DIR = '/opt/xfstests';
my $CONFIG_FILE = "$INST_DIR/local.config";
Expand Down Expand Up @@ -173,11 +174,11 @@ sub create_loop_device_by_rootsize {
}
# Use 90% of free space, not use all space in /root
$size = int($para{size} * 0.9);
# 15G each for test_dev and scratch_dev1, other devices share the rest
if ($para{size} >= 38912 && $amount == 5 && get_var('XFSTESTS_BIG_SPACE')) {
my $size1 = 15360;
my $size2 = int(($size - ($size1 * 2)) / ($amount - 1));
@loop_dev_size = (($size1 . 'M') x 2, ($size2 . 'M') x 4);
# get device size from XFSTESTS_PART_SIZE, other devices share the rest
if (my @part_list = split(/,/, get_var('XFSTESTS_PART_SIZE'))) {
my $list_remaining = $amount + 1 - (scalar @part_list);
if ($list_remaining > 0) { push(@part_list, (int(($size - (sum @part_list)) / $list_remaining)) x $list_remaining); }
foreach (0 .. $amount) { push(@loop_dev_size, shift(@part_list) . 'M'); }
}
else {
$size > (20480 * ($amount + 1)) ? ($size = 20480) : ($size = int($size / ($amount + 1)));
Expand Down
1 change: 1 addition & 0 deletions variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ XFSTESTS_NFS_VERSION | string | 4.1 | NFS only, version of test target NFS
XFSTESTS_NFS_SERVER | boolean | | NFS multimation test only, mandatory. To tag this test job for NFS server in a NFS multimachine test. NFS test in a multimachine test either a client or a server.
NFS_GRACE_TIME | integer | 15 | NFS only, set the nlm_grace_period in /etc/modprobe.d/lockd.conf used in NFS test.
PARALLEL_WITH | string | | NFS multimation test only, value=<set-the-parent-job-name>. To set the NFS server job name in NFS client job in a NFS multimachine test. e.g. xfstests_nfs4.1-server
XFSTESTS_PART_SIZE | string | | Partitions size in MB, separate with commas. Each size is allocated to test_dev, scratch_dev1 and so on in turn. Unconfigured partitions will divide the remaining space equally. E.g, value=5120,10240 then test_dev=5120M, scratch_dev1=10240M, and remain partitions share the rest space.


Debug setting: advance setting to debugging issues, may cause test fail
Expand Down
Loading