-
Notifications
You must be signed in to change notification settings - Fork 346
/
Copy pathtest_hexanonymize.sh
executable file
·43 lines (33 loc) · 1004 Bytes
/
test_hexanonymize.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env bash
# vim:ts=4:sts=4:sw=4:et
#
# Author: Hari Sekhon
# Date: 2020-01-02 17:35:08 +0000 (Thu, 02 Jan 2020)
#
# https://github.com/harisekhon/devop-python-tools
#
# License: see accompanying Hari Sekhon LICENSE file
#
set -eu
[ -n "${DEBUG:-}" ] && set -x
srcdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$srcdir/..";
# shellcheck disable=SC1091
. ./tests/utils.sh
section "HexAnonymize"
start_time=$(date +%s)
run++
check_output "abc123456def789012abcd" hexanonymize.py <<< "xyz987654rst654321AKIA"
run++
check_output "abc123456def789012ABCD" hexanonymize.py -c <<< "xyz987654rst654321AKIA"
run++
check_output "xyz123456rst789012abC" hexanonymize.py -c -o <<< "xyz987654rst654321caD"
run++
check_output "xyz123456rst789012abc" hexanonymize.py -o <<< "xyz987654rst654321caD"
echo
# $run_count defined in lib
# shellcheck disable=SC2154
echo "Total Tests run: $run_count"
time_taken "$start_time" "All version tests for hexanonymize.py completed in"
echo
untrap