Skip to content

Commit 42a13b2

Browse files
committed
Fix start-up test script
Signed-off-by: Pol Henarejos <[email protected]>
1 parent 9742991 commit 42a13b2

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/start-up-and-test.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ sleep 1
1818
rm -f memory.flash
1919
echo -n "Start Pico OpenPGP..."
2020
./build_in_docker/pico_openpgp > /dev/null 2>&1 &
21+
PID=$!
2122
test $? -eq 0 && echo -n "." || fail
2223
sleep 1
2324
ATR="3b:da:18:ff:81:b1:fe:75:1f:03:00:31:f5:73:c0:01:60:00:90:00:1c"
@@ -27,4 +28,19 @@ test $? -eq 0 && echo -e "${OK}" || fail
2728

2829
pytest tests -W ignore::DeprecationWarning
2930

31+
echo -n "Stopping Pico OpenPGP..."
32+
kill "$PID" 2>/dev/null || true
33+
kill -9 "$PID" 2>/dev/null || true
34+
test $? -eq 0 && echo -e "${OK}" || fail
35+
sleep 1
36+
rm -f memory.flash
37+
echo -n "Start Pico OpenPGP..."
38+
./build_in_docker/pico_openpgp > /dev/null 2>&1 &
39+
PID=$!
40+
test $? -eq 0 && echo -n "." || fail
41+
sleep 1
42+
e=$(opensc-tool -an 2>&1)
43+
grep -q "${ATR}" <<< $e && echo -n "." || fail
44+
test $? -eq 0 && echo -e "${OK}" || fail
45+
3046
./tests/scripts/cli-test.sh

0 commit comments

Comments
 (0)