1
# LSB Test Execution Framework
2
# Olver Test Module (Olver_test.pm)
4
# Copyright (C) 2007-2009 The Linux Foundation. All rights reserved.
6
# This program has been developed by ISP RAS for LF.
7
# The ptyshell tool is originally written by Jiri Dluhos <jdluhos@suse.cz>
8
# Copyright (C) 2005-2007 SuSE Linux Products GmbH
10
# This program is free software; you can redistribute it and/or
11
# modify it under the terms of the GNU General Public License
12
# version 2 as published by the Free Software Foundation.
14
# This program is distributed in the hope that it will be useful,
15
# but WITHOUT ANY WARRANTY; without even the implied warranty of
16
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
# GNU General Public License for more details.
19
# You should have received a copy of the GNU General Public License
20
# along with this program; if not, write to the Free Software
21
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
31
our @ISA = qw(Test_common); # Inherit Test_common
32
#----------------------------------------------------------------------
34
my $checkpoints = undef;
36
#----------------------------------------------------------------------
41
# Call the parent's prepare function
42
is_ok $self->Test_common::prepare() or return $Error::Last;
44
# Download and install required packages
45
is_ok $self->prepare_test_packages() # According to the Manifest
46
or return error "Failed to download and install packages for '"
47
.$self->name."' test.", $Error::Last;
49
my $testsuite_dir = $self->option('TESTSUITE_DIR') || "/opt/lsb/test/olver-core";
50
$self->{TESTSUITE_DIR} = $testsuite_dir;
51
$self->{RESULTS_DIR} = $self->option('RESULTS_DIR') || "/var/opt/lsb/test/olver-core";
54
cmd("rm -rf ".shq($self->{RESULTS_DIR})."/*");
56
init_checkpoint_data($self->{VERSION});
64
my $subshell = $self->Spawn_subshell();
65
is_ok $subshell or return $Error::Last;
67
# Change to the test suite directory
69
$subshell->Send( "cd ".shq($self->{TESTSUITE_DIR})."\n" );
73
$subshell->Send("./bin/olver_run_tests; exit\n");
75
# Just wait for the test finished
76
while ( my $line = $subshell->Read(2) ) {
77
$self->check_progress($line);
80
# Just confirm that the subshell has finished
81
$subshell->WaitForSubshell();
87
my ($self, $line) = @_;
89
defined $line or $line = "";
91
if ( $line =~ /^Running scenario (\S+).*[\r\n]/ ) {
93
$self->progress_profiled($checkpoints, $testcase);
97
$self->progress_profiled();
104
$self->{JOURNAL_FILE} = $self->name.".journal";
105
$self->{JOURNAL_TYPE} = 'TET';
107
# Find the journal file and copy it to where it should be.
108
is_ok $self->copy_file_globbed( $self->{RESULTS_DIR}."/*/tet/tetreport.log", $self->journal_file )
109
or $self->report_error($Error::Last);
111
is_ok $self->copy_file_globbed( "/var/opt/lsb/test/olver-core/*", $globals->{"test_result_dir"}."/olver_full" )
112
or $self->report_error($Error::Last);
117
sub init_checkpoint_data {
120
# olver v. 4.0.0-5 for LSB 4.0
122
[ 0, 'dir_scenario' ],
123
[ 10, 'fstream_action_scenario' ],
124
[ 16, 'line_scenario' ],
125
[ 22, 'window_attr_scenario' ],
126
[ 29, 'execle_scenario' ],
127
[ 40, 'ualarm_scenario' ],
128
[ 47, 'vswscanf_scenario' ],
129
[ 54, 'scanf_scenario' ],
130
[ 62, 'vsprintf_scenario' ],
131
[ 68, 'vsscanf_scenario' ],
132
[ 75, 'getopt_scenario' ],