-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changed init container version to 1.0.0
- Loading branch information
Showing
2 changed files
with
68 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,67 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
echo "Removing otput directory" | ||
|
||
rm -rf output | ||
|
||
echo "starting wiremock" | ||
|
||
docker-compose up -d --build wiremock | ||
|
||
docker-compose build decryptor | ||
|
||
echo "running decryptor - json format" | ||
|
||
OUTPUT_FORMAT=json docker-compose run decryptor | ||
|
||
echo "comparing out.json and expected.json files" | ||
|
||
diff -q output/out.json expected.json | ||
|
||
rm -rf output | ||
|
||
echo "running decryptor - cfg format" | ||
|
||
OUTPUT_FORMAT=cfg docker-compose run decryptor | ||
|
||
echo "comparing out.cfg and expected.cfg files" | ||
|
||
diff -q output/out.cfg expected.cfg | ||
|
||
rm -rf output | ||
|
||
echo "running decryptor - cfg strict format" | ||
|
||
OUTPUT_FORMAT=cfg-strict docker-compose run decryptor | ||
|
||
echo "comparing out.cfg-strict and expected-strict.cfg files" | ||
|
||
diff -q output/out.cfg-strict expected-strict.cfg | ||
|
||
rm -rf output | ||
|
||
echo "running decryptor - files format" | ||
|
||
OUTPUT_FORMAT=files docker-compose run decryptor | ||
|
||
echo "comparing output directory with expected.json" | ||
|
||
for f in "output"/*; do | ||
output=$(cat "$f") | ||
expected=$(cat expected.json | jq .$(basename $f) | sed -e 's/^"//' -e 's/"$//') # remove double qoutes because they doesn't exist in files | ||
diff <(echo $output) <(echo $expected) | ||
done | ||
|
||
rm -rf output | ||
|
||
echo "running decryptor - upper case" | ||
|
||
OUTPUT_FORMAT=JSON docker-compose run decryptor | ||
|
||
if [[ $? != 0 ]] | ||
then | ||
echo "should not fail on upper case format" | ||
exit 1 | ||
fi |