Skip to content

Commit

Permalink
[#375] New v63010/gtm9076 test to check for expected error messages f…
Browse files Browse the repository at this point in the history
…or file paths over 255 characters

This commit adds a v63010/gtm9076 test that checks that the following expected errors show up in the following 3 circumstances where the file path is over 255 characters:

* When GDE attempts to create a global directory file with a path longer than 255 characters, it produces a `FILEPATHTOOLONG` error.
* When MUPIP CREATE attempts to create a database with a path longer than 255 characters, it produces a `FNTRANSERROR` message.
* When MUPIP attempts to create a journal file with a path longer than 255 characters, it produces a `FILEPATHTOOLONG` error.

The `FILEPATHTOOLONG` error was added in V6.3-010 as a replacement for PARBUSFM that now covers those 2 additional circumstances.`FNTRANSERROR` pre-dates V6.3-010 but its message was changed in V6.3-010 and it was not covered by an existing test.
  • Loading branch information
bradwesthafer committed Apr 15, 2021
1 parent 9c293ed commit 5e948e1
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 1 deletion.
3 changes: 2 additions & 1 deletion v63010/instream.csh
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@
# gtm9183 [estess] Test that indirect exclusive NEW after FOR (on same line) does not cause sigsegv or other error
# gtm9180 [bdw] Look for error message if block number for DSE -add or -dump command doesn't fit in a 32 bit signed integer
# gtm9181 [estess] Add boolean literal tests that failed prior to V63010 with some involving $SELECT()
# gtm9076 [bdw] Look for error messages for GDE, MUPIP CREATE and journal files when file path exceeds 255 characters
#----------------------------------------------------------------------------------------------------------------------------------------------------------------


echo "v63010 test starts..."

# List the subtests seperated by sspaces under the appropriate environment variable name
setenv subtest_list_common ""
setenv subtest_list_non_replic "gtm9206 gtm9188 gtm9190 gtm9183 gtm9180 gtm9181"
setenv subtest_list_non_replic "gtm9206 gtm9188 gtm9190 gtm9183 gtm9180 gtm9181 gtm9076"
setenv subtest_list_replic ""

if ($?test_replic == 1) then
Expand Down
42 changes: 42 additions & 0 deletions v63010/outref/gtm9076.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# This test checks that FILEPATHTOOLONG error messages show up as expected when creating a global directory or a journal file where
# the full file path exceeds 255 characters. It also checks that the FNTRANSERROR message shows up as expected when creating a
# database file with MUPIP CREATE where the path for the database exceeds 255 characters.
###################################################################
# Create a mumps.gld file in the test root directory. We will need this later for a MUPIP CREATE.
%GDE-I-GDUSEDEFS, Using defaults for Global Directory
##TEST_PATH##/mumps.gld
%GDE-I-VERIFY, Verification OK

%GDE-I-GDCREATE, Creating Global Directory file
##TEST_PATH##/mumps.gld
###################################################################
# Switch to the subdirectory where the full path of mumps.gld/mumps.dat will be 256 characters
###################################################################
# Run GDE here to create a mumps.gld, expecting a FILEPATHTOOLONG error.
150374602,GDEINIT+88^GDEINIT,%YDB-E-FILEPARSE, Error parsing file specification: GDEINITSZ,%YDB-E-FILEPATHTOOLONG, Filename including the path cannot be longer than 255 characters
###################################################################
# Set ydb_gbldir to the test root's mumps.gld file.
###################################################################
# Run MUPIP CREATE to create a mumps.dat, expecting a FNTRANSERROR error.
%YDB-E-FNTRANSERROR, Filename including path exceeded 255 chars while trying to resolve filename DEFAULT
%YDB-F-DBNOCRE, Not all specified database files, or their associated journal files were created
###################################################################
# Returning to the test root directory and creating a database.
Files Created in ##TEST_PATH##:
Using: ##SOURCE_PATH##/mumps -run GDE
mumps.gld
Using: ##SOURCE_PATH##/mupip
mumps.dat
###################################################################
# Creating a journal file with a full path of 256 characters
##TEST_AWK%YDB-E-FILEPARSE, Error parsing file specification: [a]+/mumps.mjl
%YDB-E-FILEPATHTOOLONG, Filename including the path cannot be longer than 255 characters
##TEST_AWK%YDB-E-JNLNOCREATE, Journal file [a]+/mumps.mjl not created
%YDB-E-MUNOFINISH, MUPIP unable to finish all requested actions
###################################################################
##SOURCE_PATH##/mupip
##SOURCE_PATH##/mupip integ -REG *
No errors detected by integ.
##TEST_AWK##TEST_PATH##/[a]+/GDEDUMP.DMP
abortzs="150374602,GDEINIT+88^GDEINIT,%YDB-E-FILEPARSE, Error parsing file specification: GDEINITSZ,%YDB-E-FILEPATHTOOLONG, Filename including the path cannot be longer than 255 characters"
$ZSTATUS="150374602,GDEINIT+88^GDEINIT,%YDB-E-FILEPARSE, Error parsing file specification: GDEINITSZ,%YDB-E-FILEPATHTOOLONG, Filename including the path cannot be longer than 255 characters"
1 change: 1 addition & 0 deletions v63010/outref/outref.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ PASS from gtm9183
PASS from gtm9180
##ALLOW_OUTPUT DBG
PASS from gtm9181
PASS from gtm9076
##ALLOW_OUTPUT REPLIC
##SUSPEND_OUTPUT NON_REPLIC
##ALLOW_OUTPUT NON_REPLIC
Expand Down
65 changes: 65 additions & 0 deletions v63010/u_inref/gtm9076.csh
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/usr/local/bin/tcsh
#################################################################
# #
# Copyright (c) 2021 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. #
# #
#################################################################

echo "# This test checks that FILEPATHTOOLONG error messages show up as expected when creating a global directory or a journal file where"
echo "# the full file path exceeds 255 characters. It also checks that the FNTRANSERROR message shows up as expected when creating a"
echo "# database file with MUPIP CREATE where the path for the database exceeds 255 characters."

set path_length = `expr length $PWD`

set path255_length = 0
set filenamelength = 11 # includes 2 "/"s (before and after the large number of "a"s)
set path255 = ""
set testpath = $PWD

while (255 >= `expr $path_length + $path255_length + $filenamelength`)
set path255 = "${path255}a"
set path255_length = `expr $path255_length + 1`
end

$echoline
echo "# Create a mumps.gld file in the test root directory. We will need this later for a MUPIP CREATE."

$GDE exit

$echoline
echo "# Switch to the subdirectory where the full path of mumps.gld/mumps.dat will be 256 characters"

mkdir $path255
cd $path255

$echoline
echo "# Run GDE here to create a mumps.gld, expecting a FILEPATHTOOLONG error."

$GDE exit

$echoline
echo "# Set ydb_gbldir to the test root's mumps.gld file."
setenv ydb_gbldir "$testpath/mumps.gld"

$echoline
echo "# Run MUPIP CREATE to create a mumps.dat, expecting a FNTRANSERROR error."
$MUPIP CREATE

$echoline
echo "# Returning to the test root directory and creating a database."
cd ..
$gtm_tst/com/dbcreate.csh mumps


$echoline
echo "# Creating a journal file with a full path of 256 characters"
$MUPIP set -journal="enable,file=${path255}/mumps.mjl" -file mumps.dat

$echoline
$gtm_tst/com/dbcheck.csh

0 comments on commit 5e948e1

Please sign in to comment.