Skip to content

Commit

Permalink
Merge pull request #15324 from alvarocarvajald/drbd-on-3nodes
Browse files Browse the repository at this point in the history
Skip ha/drbd_passive test when not in TWO_NODES scenario
  • Loading branch information
alvarocarvajald committed Aug 10, 2022
2 parents 6c1db55 + 81dbecc commit 6663dfc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
6 changes: 5 additions & 1 deletion tests/ha/drbd_passive.pm
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ sub run {

# At this time, we only test DRBD on a 2 nodes cluster
# And if the cluster has more than 2 nodes, we only use the first 2 nodes
return if (!is_node(1) && !is_node(2));
if ((!is_node(1) && !is_node(2)) || check_var('TWO_NODES', 'no')) {
write_tag('skip_fs_test');
record_info 'Skipped - Scenario', 'Test skipped because this job is not running in a two nodes scenario';
return;
}

# Wait until DRBD test is initialized
barrier_wait("DRBD_INIT_$cluster_name");
Expand Down
9 changes: 5 additions & 4 deletions tests/ha/filesystem.pm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ use hacluster;

sub run {
# Exit of this module if 'tag=drbd_passive' and if we are in a maintenance update not related to drbd
return 1 if (read_tag eq 'drbd_passive' and is_not_maintenance_update('drbd'));
my $tag = read_tag;
return 1 if (($tag eq 'drbd_passive' and is_not_maintenance_update('drbd')) or $tag eq 'skip_fs_test');

my $cluster_name = get_cluster_name;
my $node = get_hostname;
Expand All @@ -28,16 +29,16 @@ sub run {
my $fs_opts = '-F -N 16'; # Force the filesystem creation and allows 16 nodes

# This Filesystem test can be called multiple time
if (read_tag eq 'cluster_md') {
if ($tag eq 'cluster_md') {
$resource = 'cluster_md';
}
elsif (read_tag eq 'drbd_passive') {
elsif ($tag eq 'drbd_passive') {
$resource = 'drbd_passive';
$fs_lun = '/dev/drbd_passive' if is_node(1);
$fs_type = 'xfs';
$fs_opts = '-f';
}
elsif (read_tag eq 'drbd_active') {
elsif ($tag eq 'drbd_active') {
$resource = 'drbd_active';
}
else {
Expand Down
7 changes: 4 additions & 3 deletions tests/ha/vg.pm
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,21 @@ sub run {
my $vg_luns = undef;

# This test can be called multiple time
if (read_tag eq 'cluster_md') {
my $tag = read_tag;
if ($tag eq 'cluster_md') {
$resource = 'cluster_md';
$vg_luns = '/dev/md*' if is_node(1);

# Use a named RAID in SLE15
$vg_luns = "/dev/md/$resource" if (is_sle('15+') && is_node(1));
}
elsif (read_tag eq 'drbd_passive') {
elsif ($tag eq 'drbd_passive') {
$resource = 'drbd_passive';
$vg_luns = "/dev/$resource" if is_node(1);
$vg_exclusive = 'true';
$vg_type = '--clustered n';
}
elsif (read_tag eq 'drbd_active') {
elsif ($tag eq 'drbd_active') {
$resource = 'drbd_active';
$vg_luns = "/dev/$resource" if is_node(1);
}
Expand Down

0 comments on commit 6663dfc

Please sign in to comment.