From 2b6718f9d90c21c1851cd09a040f921b39d41f82 Mon Sep 17 00:00:00 2001 From: Narayanan Iyer Date: Tue, 24 Apr 2018 14:58:47 -0400 Subject: [PATCH] [#207] Add r122/tprestart subtest (tests YottaDB/YottaDB#207) --- com/SUITE | 2 ++ r122/inref/tprestart.m | 27 +++++++++++++++++++++++++++ r122/instream.csh | 37 +++++++++++++++++++++++++++++++++++++ r122/outref/outref.txt | 5 +++++ r122/outref/tprestart.txt | 14 ++++++++++++++ r122/u_inref/tprestart.csh | 36 ++++++++++++++++++++++++++++++++++++ 6 files changed, 121 insertions(+) create mode 100644 r122/inref/tprestart.m create mode 100644 r122/instream.csh create mode 100644 r122/outref/outref.txt create mode 100644 r122/outref/tprestart.txt create mode 100755 r122/u_inref/tprestart.csh diff --git a/com/SUITE b/com/SUITE index 19cdd7e2f..8b402cbba 100644 --- a/com/SUITE +++ b/com/SUITE @@ -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 diff --git a/r122/inref/tprestart.m b/r122/inref/tprestart.m new file mode 100644 index 000000000..1404e56a3 --- /dev/null +++ b/r122/inref/tprestart.m @@ -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 diff --git a/r122/instream.csh b/r122/instream.csh new file mode 100644 index 000000000..2b3ad3b8a --- /dev/null +++ b/r122/instream.csh @@ -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." diff --git a/r122/outref/outref.txt b/r122/outref/outref.txt new file mode 100644 index 000000000..5c2d89319 --- /dev/null +++ b/r122/outref/outref.txt @@ -0,0 +1,5 @@ +v63004 test starts... +##SUSPEND_OUTPUT REPLIC +PASS from tprestart +##ALLOW_OUTPUT REPLIC +v63004 test DONE. diff --git a/r122/outref/tprestart.txt b/r122/outref/tprestart.txt new file mode 100644 index 000000000..38514cf93 --- /dev/null +++ b/r122/outref/tprestart.txt @@ -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. diff --git a/r122/u_inref/tprestart.csh b/r122/u_inref/tprestart.csh new file mode 100755 index 000000000..e0d3e3a75 --- /dev/null +++ b/r122/u_inref/tprestart.csh @@ -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