-
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.
SW-8433: Karl Config File Add CI Test (#109)
* SW-7698 karl Config File: Reworked things to make it simpler and easier to maintain. also using the madara global logger for debug output, now even leaner! * SW-8433: Karl Config File Add CI Test, test script, karl logic and karl config files in this package. * SW-8433: Karl Config File Add CI Test, test script, karl logic and karl config files in this package, aded to travis. * SW-8433: Karl Config File Add CI Test, test script, karl logic and karl config files in this package, aded to travis, synced karl.cpp. * SW-8433: Karl Config File Add CI Test, push/sync. * SW-8433: Karl Config File Add CI Test, push/sync-1. * SW-8433: Fix for CI test failure and env var expand for karl config. * SW-8433: Fix for MAC CI test failure, trial and error, I do not have a MAC-1. * SW-8433: Fix for MAC CI test failure, trial and error, I do not have a MAC-try2. * SW-8433: Fix for MAC CI test failure, trial and error, I do not have a MAC-try3. * SW-8433: Fix for MAC CI test failure. MACOSX Dly load failure. * SW-8433: Fix for karl config CI failure: Only run for non OSX for now. * SW-8433: Fix for karl config CI failure: test karl logic file wording change...
- Loading branch information
1 parent
2590756
commit 88cde94
Showing
11 changed files
with
204 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
test_result += 1; | ||
|
||
// return result | ||
test_result |
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,7 @@ | ||
// setup test_result (=0 for fail, >=1 for pass) | ||
test_result = 0; | ||
|
||
// simple increment | ||
test_result += 1 | ||
|
||
|
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,5 @@ | ||
// this will cause an exception | ||
undef_func(test_result += 1); | ||
|
||
// return result | ||
test_result |
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,146 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright (c) 2015-2018 Carnegie Mellon University. All Rights Reserved. | ||
# | ||
# Redistribution and use in source and binary forms, with or without | ||
# modification, are permitted provided that the following conditions | ||
# are met: | ||
# | ||
# 1. Redistributions of source code must retain the above copyright | ||
# notice, this list of conditions and the following acknowledgments | ||
# and disclaimers. | ||
# | ||
# 2. Redistributions in binary form must reproduce the above copyright | ||
# notice, this list of conditions and the following disclaimer in the | ||
# documentation and/or other materials provided with the distribution. | ||
# | ||
# 3. The names "Carnegie Mellon University," "SEI" and/or "Software | ||
# Engineering Institute" shall not be used to endorse or promote | ||
# products derived from this software without prior written | ||
# permission. For written permission, please contact | ||
# permission@sei.cmu.edu. | ||
# | ||
# 4. Products derived from this software may not be called "SEI" nor | ||
# may "SEI" appear in their names without prior written permission of | ||
# permission@sei.cmu.edu. | ||
# | ||
# 5. Redistributions of any form whatsoever must retain the following | ||
# acknowledgment: | ||
# | ||
# Copyright 2015 Carnegie Mellon University | ||
# | ||
# This material is based upon work funded and supported by the | ||
# Department of Defense under Contract No. FA8721-05-C-0003 with | ||
# Carnegie Mellon University for the operation of the Software | ||
# Engineering Institute, a federally funded research and development | ||
# center. | ||
# | ||
# Any opinions, findings and conclusions or recommendations expressed | ||
# in this material are those of the author(s) and do not necessarily | ||
# reflect the views of the United States Department of Defense. | ||
# | ||
# NO WARRANTY. THIS CARNEGIE MELLON UNIVERSITY AND SOFTWARE | ||
# ENGINEERING INSTITUTE MATERIAL IS FURNISHED ON AN "AS-IS" | ||
# BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, | ||
# EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT | ||
# LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE OR MERCHANTABILITY, | ||
# EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE | ||
# MELLON UNIVERSITY DOES NOT MAKE ANY WARRANTY OF ANY KIND WITH | ||
# RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT | ||
# INFRINGEMENT. | ||
# | ||
# This material has been approved for public release and unlimited | ||
# distribution. | ||
# | ||
# DM-0002489 | ||
# | ||
# karl configurartion files - tests | ||
# each test loads a config file containing karl interpeter logic too | ||
# | ||
|
||
MADARA_FAILS=0 | ||
TESTLINE="" | ||
|
||
# test simple load of one config file which also points to a karl logic file | ||
echo "Test simple load of one config file which also points to a karl logic file" | ||
$MADARA_ROOT/bin/karl -cf $MADARA_ROOT/tests/settings/karl1.cfg &> $MADARA_ROOT/tests/settings/log1 | ||
|
||
input="$MADARA_ROOT/tests/settings/log1" | ||
while IFS= read -r line | ||
do | ||
#echo "line: $line endline" | ||
TESTLINE=$line | ||
done < "$input" | ||
|
||
if [ "$TESTLINE" != "test_result=2" ] ; then | ||
echo "Test 1: Fail" | ||
((MADARA_FAILS++)) | ||
else | ||
echo "Test 1: Pass" | ||
fi | ||
|
||
# recursion limit test, should fail | ||
echo "Recursion limit test, fallout at 10" | ||
$MADARA_ROOT/bin/karl -cf $MADARA_ROOT/tests/settings/karl.cfg &> $MADARA_ROOT/tests/settings/log2 | ||
|
||
TESTLINE="" | ||
input="$MADARA_ROOT/tests/settings/log2" | ||
while IFS= read -r line | ||
do | ||
#echo "line: $line endline" | ||
TESTLINE=$line | ||
done < "$input" | ||
|
||
if [ "$TESTLINE" == "test_result=1" ] ; then | ||
echo "Test 2: Fail" | ||
((MADARA_FAILS++)) | ||
else | ||
echo "Test 2: Pass" | ||
fi | ||
|
||
# test one karl config loading another karl config | ||
echo "Test one karl config loading another karl config" | ||
$MADARA_ROOT/bin/karl -cf $MADARA_ROOT/tests/settings/karl2.cfg &> $MADARA_ROOT/tests/settings/log3 | ||
|
||
TESTLINE="" | ||
input="$MADARA_ROOT/tests/settings/log3" | ||
while IFS= read -r line | ||
do | ||
#echo "line: $line endline" | ||
TESTLINE=$line | ||
done < "$input" | ||
|
||
if [ "$TESTLINE" == "test_result=2" ] ; then | ||
echo "Test 3: Fail" | ||
((MADARA_FAILS++)) | ||
else | ||
echo "Test 3: Pass" | ||
fi | ||
|
||
# test one karl config loading a karl logic file which contains commands to tripper an exception | ||
echo "Test one karl config loading a karl logic file which contains commands to tripper an exception" | ||
$MADARA_ROOT/bin/karl -cf $MADARA_ROOT/tests/settings/karl4.cfg &> $MADARA_ROOT/tests/settings/log4 | ||
|
||
TESTLINE="" | ||
input="$MADARA_ROOT/tests/settings/log4" | ||
while IFS= read -r line | ||
do | ||
#echo "line: $line endline" | ||
TESTLINE=$line | ||
done < "$input" | ||
|
||
if [ "$TESTLINE" == "test_result=1" ] ; then | ||
echo "Test 4: Fail" | ||
((MADARA_FAILS++)) | ||
else | ||
echo "Test 4: Pass" | ||
fi | ||
|
||
# echo test result information | ||
echo "MADARA_FAILS=$MADARA_FAILS" | ||
|
||
exit $MADARA_FAILS | ||
|
||
|
||
|
||
|
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,7 @@ | ||
-l 2 | ||
-f ../logfile1.txt | ||
-a | ||
-t 12 | ||
-w 2 | ||
-cf $(MADARA_ROOT)/tests/settings/karl.cfg | ||
-w 5 |
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,10 @@ | ||
-l 2 | ||
-f ../logfile1.txt | ||
-a | ||
-t 12 | ||
--wait 1 | ||
-0f $(MADARA_ROOT)/scripts/linux/test_config_files_init.karl | ||
--wait 1 | ||
-i $(MADARA_ROOT)/scripts/linux/test_config_files.karl | ||
-k | ||
|
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,4 @@ | ||
-t 20 | ||
--wait 2 | ||
-cf $(MADARA_ROOT)/tests/settings/karl3.cfg | ||
-k |
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,8 @@ | ||
-l 2 | ||
-f $(MADARA_ROOT)/tests/settings/logfile1.txt | ||
-a | ||
-t 12 | ||
--wait 1 | ||
-0f $(MADARA_ROOT)/scripts/linux/test_config_files_init.karl | ||
-k | ||
|
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,10 @@ | ||
-l 2 | ||
-f ../logfile1.txt | ||
-a | ||
-t 12 | ||
--wait 1 | ||
-0f $(MADARA_ROOT)/scripts/linux/test_config_files_init.karl | ||
--wait 1 | ||
-i $(MADARA_ROOT)/scripts/linux/test_config_files_karl_exception.karl | ||
-k | ||
|
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