-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #136 from keithj/sql-query-test
Support for setting up iRODS specific query SQL for tests.
- Loading branch information
Showing
7 changed files
with
133 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash | ||
# | ||
# This script is run on unchecked fixture setup. It installs iRODS | ||
# specific query SQL if rodsadmin is available. | ||
# | ||
|
||
E_ARGS_MISSING=3 | ||
E_INPUT_MISSING=4 | ||
|
||
sql_path=$1 | ||
|
||
if [ $# -lt 1 ] | ||
then | ||
echo "Insufficient command line arguments; expected 1" | ||
exit $E_ARGS_MISSING | ||
fi | ||
|
||
if [[ ! -z "$sql_path" ]] | ||
then | ||
if [[ ! -f $sql_path ]] | ||
then | ||
echo "SQL input file '$sql_path' not found. Aborting" | ||
exit $E_INPUT_MISSING | ||
else | ||
# Test for admin capabilities | ||
iuserinfo | grep 'type: rodsadmin' >/dev/null | ||
status=$? | ||
|
||
if [[ $status -eq 0 ]] | ||
then | ||
echo "# Installing specific queries" | ||
awk '{print "asq $s"}' < $sql_path | iadmin >/dev/null | ||
status=$? | ||
|
||
if [[ $status -ne 0 ]] | ||
then | ||
echo "Failed to install SQL in '$sql_path'" | ||
exit $status | ||
fi | ||
else | ||
echo "# Not installing specific queries" | ||
fi | ||
fi | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash | ||
# | ||
# This script is run on unchecked fixture teardown. It removes iRODS | ||
# specific query SQL if rodsadmin is available. | ||
# | ||
|
||
E_ARGS_MISSING=3 | ||
E_INPUT_MISSING=4 | ||
|
||
sql_path=$1 | ||
|
||
if [[ $# < 1 ]] | ||
then | ||
echo "Insufficient command line arguments; expected 1" | ||
exit $E_ARGS_MISSING | ||
fi | ||
|
||
if [[ ! -z "$sql_path" ]] | ||
then | ||
if [[ ! -f $sql_path ]] | ||
then | ||
echo "SQL input file '$sql_path' not found. Aborting" | ||
exit $E_INPUT_MISSING | ||
else | ||
# Test for admin capabilities | ||
iuserinfo | grep 'type: rodsadmin' >/dev/null | ||
status=$? | ||
|
||
if [[ $status -eq 0 ]] | ||
then | ||
echo "# Removing specific queries" | ||
awk '{print "rsq $s"}' < $sql_path | iadmin >/dev/null | ||
status=$? | ||
|
||
if [[ $status -ne 0 ]] | ||
then | ||
echo "Failed to remove SQL in '$sql_path'" | ||
exit $status | ||
fi | ||
else | ||
echo "# Not removing specific queries" | ||
fi | ||
fi | ||
fi |
Empty file.