Skip to content
Snippets Groups Projects
Commit 94bc95b1 authored by Nicolas Joly's avatar Nicolas Joly Committed by Morris Jette
Browse files

Adjust time/date/cp commands in tests for portability

These changes are required to support NetBSD.
1) Use standard -p option for time command in test17.35 instead of
GNU specific format string to fetch the elapsed (real) time.

2) Adjust date command calls in test22.1 to use short option
(--date -> -d), and move options before arguments. NetBSD,
unlike Linux, disallow non standard order.

3) Use standard -R option instead of -r for cp command in test30.1.
parent 9b7a3527
No related branches found
No related tags found
No related merge requests found
......@@ -56,31 +56,28 @@ wait
set match 0
set time_used 100000
set timeout [expr $max_job_delay * 10]
spawn time -f "elapsed %E" ./$file_in
spawn time -p ./$file_in
expect {
-re "Submitted batch job ($number)" {
incr match
exp_continue
}
-re "elapsed ($number):($digit)($digit).($digit)($digit)" {
set mins $expect_out(1,string)
set secs [expr $expect_out(2,string) * 10 + $expect_out(3,string)]
set tenths $expect_out(4,string)
set hundredths $expect_out(5,string)
set time_used [expr $mins * 60000 + $secs * 1000 + $tenths * 100 + $hundredths * 10]
-re "real *($number).($digit)($digit)" {
set secs $expect_out(1,string)
set tenths $expect_out(2,string)
set hundredths $expect_out(3,string)
set time_used [expr $secs * 1000 + $tenths * 100 + $hundredths * 10]
exp_continue
}
-re "elapsed ($number):($digit)($digit).($digit)" {
set mins $expect_out(1,string)
set secs [expr $expect_out(2,string) * 10 + $expect_out(3,string)]
set tenths $expect_out(4,string)
set time_used [expr $mins * 60000 + $secs * 1000 + $tenths * 100]
-re "real *($number).($digit)" {
set secs $expect_out(1,string)
set tenths $expect_out(2,string)
set time_used [expr $secs * 1000 + $tenths * 100]
exp_continue
}
-re "elapsed ($number):($digit)($digit)" {
set mins $expect_out(1,string)
set secs [expr $expect_out(2,string) * 10 + $expect_out(3,string)]
set time_used [expr $mins * 60000 + $secs * 1000]
-re "real *($number)" {
set secs $expect_out(1,string)
set time_used [expr $secs * 1000]
exp_continue
}
timeout {
......
......@@ -89,15 +89,15 @@ print_header $test_id
# Fri Thu Jan 31 00:00:00 2008 - Needed only for the 00:00:00 for timing purposes
set midnight_time "Thu Jan 31 00:00:00 2008"
set midnight [exec date +%s --date=$midnight_time]
set midnight [exec date -d $midnight_time +%s]
# Mon Dec 31 23:00:00 2007
set start_date "Mon Dec 31 23:00:00 2007"
set period_start [exec date +%s --date=$start_date]
set period_start [exec date -d $start_date +%s]
# Thu Jan 31 23:59:59 2008
set end_date "Thu Jan 31 23:59:59 2008"
set period_end [exec date +%s --date=$end_date]
set period_end [exec date -d $end_date +%s]
set start_str [timestamp -format %Y-%m-%dT%X -seconds $period_start]
set end_str [timestamp -format %Y-%m-%dT%X -seconds $period_end]
......
......@@ -78,7 +78,7 @@ if {[test_cray] || [test_alps]} {
set timeout 1000
exec $bin_rm -fr /tmp/slurm $tar_name /tmp/built_rpms
spawn $bin_cp -L -r -v $src_dir /tmp/slurm
spawn $bin_cp -L -R -v $src_dir /tmp/slurm
expect {
timeout {
send_user "\nFAILURE: $src_dir was not copied\n"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment