Skip to content

Commit

Permalink
Get "mr test" running on openqaworker15 for 15 SP4
Browse files Browse the repository at this point in the history
jsc#TEAM-6726 - Get "mr test" running on openqaworker15 for 15 SP4 (intel on-premise)
  • Loading branch information
lilyeyes committed Sep 22, 2022
1 parent f459463 commit af155dc
Show file tree
Hide file tree
Showing 3 changed files with 601 additions and 383 deletions.
52 changes: 52 additions & 0 deletions lib/mr_test_lib.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Copyright 2022 SUSE LLC
# SPDX-License-Identifier: GPL-2.0-or-later

# Summary: Base module for saptune "mr_test" test cases.
# It dynamically generates test modules (*.pm) according to 'MR_TEST'.
# Maintainer: llzhao <llzhao@suse.com>
# Tags: jsc#TEAM-6726

package mr_test_lib;

use strict;
use warnings;
use testapi;
use utils;
use autotest;

use base 'consoletest';
use LTP::TestInfo 'testinfo';
use mr_test_run qw(get_notes get_solutions);

our @EXPORT = qw(
load_mr_tests
);

sub loadtest_mr_test {
my ($test, %args) = @_;
autotest::loadtest("lib/$test.pm", %args);
}

sub load_mr_tests {
my ($test_list) = @_;
my $i = 1;
my $note_solution = '';

# The main script which dynamically generates test modules (*.pm) according to 'MR_TEST' value
my $script = 'mr_test_run';
my $tinfo = testinfo({}, test => $script);
for my $test (split(/,/, $test_list)) {
$note_solution = '';
if (grep { /^${test}$/ } mr_test_run::get_solutions()) {
$note_solution = 'solution_';
}
elsif (grep { /^${test}$/ } mr_test_run::get_notes()) {
$note_solution = 'note_';
}
$tinfo = testinfo({}, test => $test);
loadtest_mr_test("$script", name => $i . '_saptune_' . $note_solution . $test, run_args => $tinfo);
$i++;
}
}

1;
Loading

0 comments on commit af155dc

Please sign in to comment.