Skip to content

Commit

Permalink
[#207] Add r122/tprestart subtest (tests YottaDB/YDB#207)
Browse files Browse the repository at this point in the history
  • Loading branch information
nars1 committed Apr 25, 2018
1 parent 6f41ea5 commit 8b688df
Show file tree
Hide file tree
Showing 6 changed files with 121 additions and 0 deletions.
2 changes: 2 additions & 0 deletions com/SUITE
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ r110 E
r110 E REPLIC
r120 E
r120 E REPLIC
r122 E
r122 E REPLIC
simpleapi E
simpleapi E REPLIC
spanning_nodes L
Expand Down
27 changes: 27 additions & 0 deletions r122/inref/tprestart.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ;
; Copyright (c) 2018 YottaDB LLC. and/or its subsidiaries. ;
; All rights reserved. ;
; ;
; This source code contains the intellectual property ;
; of its copyright holder(s), and is made available ;
; under a license. If you do not know the terms of ;
; the license, please stop and do not read further. ;
; ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

tprestart ;
set ^stop=0,jmaxwait=0 ; signal child processes to proceed
do ^job("child^tprestart",5,"""""") ; start 5 jobs
hang 10 ; let child run for 10 seconds
set ^stop=1 ; signal child processes to stop
do wait^job ; wait for child processes to die
quit

child ;
for i=1:1 quit:^stop=1 do
. tstart ():serial
. set x=$incr(^c)
. set ^a(x)=1,^b(x)=2
. tcommit
quit
37 changes: 37 additions & 0 deletions r122/instream.csh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/local/bin/tcsh -f
#################################################################
# #
# Copyright (c) 2018 YottaDB LLC. and/or its subsidiaries. #
# All rights reserved. #
# #
# This source code contains the intellectual property #
# of its copyright holder(s), and is made available #
# under a license. If you do not know the terms of #
# the license, please stop and do not read further. #
# #
#################################################################
#
#-------------------------------------------------------------------------------------------------------------
# List of subtests of the form "subtestname [author] description"
#-------------------------------------------------------------------------------------------------------------
# tprestart [nars] Test that TPRESTART syslog message has the correct global name when restart "type" is 4
#-------------------------------------------------------------------------------------------------------------

echo "r122 test starts..."

# List the subtests separated by spaces under the appropriate environment variable name
setenv subtest_list_common ""
setenv subtest_list_non_replic ""
setenv subtest_list_non_replic "$subtest_list_non_replic tprestart"
setenv subtest_list_replic ""

if ($?test_replic == 1) then
setenv subtest_list "$subtest_list_common $subtest_list_replic"
else
setenv subtest_list "$subtest_list_common $subtest_list_non_replic"
endif

# Submit the list of subtests
$gtm_tst/com/submit_subtest.csh

echo "r122 test DONE."
5 changes: 5 additions & 0 deletions r122/outref/outref.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
v63004 test starts...
##SUSPEND_OUTPUT REPLIC
PASS from tprestart
##ALLOW_OUTPUT REPLIC
v63004 test DONE.
14 changes: 14 additions & 0 deletions r122/outref/tprestart.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Files Created in ##TEST_PATH##:
Using: ##SOURCE_PATH##/mumps -run GDE
mumps.gld
Using: ##SOURCE_PATH##/mupip
a.dat
b.dat
mumps.dat
-------------------------------------------------------------------------------------------------
Below is a list of global names & region names in the TPRESTART syslog messages that do not match
-------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------
##SOURCE_PATH##/mupip
##SOURCE_PATH##/mupip integ -REG *
No errors detected by integ.
36 changes: 36 additions & 0 deletions r122/u_inref/tprestart.csh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/local/bin/tcsh -f
#################################################################
# #
# Copyright (c) 2018 YottaDB LLC. and/or its subsidiaries. #
# All rights reserved. #
# #
# This source code contains the intellectual property #
# of its copyright holder(s), and is made available #
# under a license. If you do not know the terms of #
# the license, please stop and do not read further. #
# #
#################################################################
#

$gtm_tst/com/dbcreate.csh mumps 3

set syslog_time_before = `date +"%b %e %H:%M:%S"`
$ydb_dist/mumps -run tprestart
set syslog_time_after = `date +"%b %e %H:%M:%S"`
set | grep syslog_time > debug.txt # record these variables for test debugging if later needed
$gtm_tst/com/getoper.csh "$syslog_time_before" "$syslog_time_after" syslog2.txt

# Search for TPRESTART messages belonging to this test (hence the `pwd` below) and ensure they have the right global name.
# $8 is the full path of the database file name
# $15 is the global name (subscripted or unsubscripted)
# It is possible the global name is ^*DIR to imply directory tree. Filter that out.
# It is possible the global name has subscripts. Filter that out.
# Finally compare the unsubscripted global name against the database file name.
$grep "TPRESTART.*`pwd`" syslog2.txt | $tst_awk '{print $8, $15}' | grep -vw DIR | sed 's/(.*)//g' | sort -u >& reg_gbl.out
echo "-------------------------------------------------------------------------------------------------"
echo "Below is a list of global names & region names in the TPRESTART syslog messages that do not match"
echo "-------------------------------------------------------------------------------------------------"
$grep -v "`pwd`/a.dat; ^a;" reg_gbl.out | $grep -v "`pwd`/b.dat; ^b;" | $grep -v "`pwd`/mumps.dat; ^c;"
echo "-------------------------------------------------------------------------------------------------"

$gtm_tst/com/dbcheck.csh

0 comments on commit 8b688df

Please sign in to comment.