Skip to content

Commit de67859

Browse files
committed
Update test script
1 parent 29e65a5 commit de67859

2 files changed

Lines changed: 54 additions & 43 deletions

File tree

run_tests.sh

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ else
3838
SIGNAL_CLI="$PWD/build/install/signal-cli/bin/signal-cli"
3939
fi
4040

41+
# Prefer line-buffered output for external commands when available
42+
if command -v stdbuf >/dev/null 2>&1; then
43+
STD_BUF="stdbuf -oL -eL --"
44+
else
45+
STD_BUF=""
46+
fi
47+
4148
run() {
4249
# To update graalvm config, set GRAALVM_HOME, e.g:
4350
# export GRAALVM_HOME=/usr/lib/jvm/java-25-graalvm
@@ -48,11 +55,23 @@ run() {
4855

4956
set -x
5057
if [ "$JSON_RPC" -eq 1 ]; then
51-
"$SIGNAL_CLI" $@
58+
if [ -n "$STD_BUF" ]; then
59+
$STD_BUF "$SIGNAL_CLI" $@
60+
else
61+
"$SIGNAL_CLI" $@
62+
fi
5263
elif [ "$DBUS" -eq 1 ]; then
53-
"$SIGNAL_CLI" --dbus --verbose --verbose $@ | grep -v 'Warning:' | grep -v 'at org'
64+
if [ -n "$STD_BUF" ]; then
65+
$STD_BUF "$SIGNAL_CLI" --dbus --verbose --verbose $@ | grep --line-buffered -v 'Warning:' | grep --line-buffered -v 'at org'
66+
else
67+
"$SIGNAL_CLI" --dbus --verbose --verbose $@ | grep --line-buffered -v 'Warning:' | grep --line-buffered -v 'at org'
68+
fi
5469
else
55-
"$SIGNAL_CLI" --service-environment="staging" --verbose --verbose $@ | grep -v 'Warning:' | grep -v 'at org'
70+
if [ -n "$STD_BUF" ]; then
71+
$STD_BUF "$SIGNAL_CLI" --service-environment="staging" --verbose --verbose $@ | grep --line-buffered -v 'Warning:' | grep --line-buffered -v 'at org'
72+
else
73+
"$SIGNAL_CLI" --service-environment="staging" --verbose --verbose $@ | grep --line-buffered -v 'Warning:' | grep --line-buffered -v 'at org'
74+
fi
5675
fi
5776
set +x
5877
}
@@ -98,9 +117,10 @@ link() {
98117
rm -f "$LINK_CODE_FILE"
99118
mkfifo "$LINK_CODE_FILE"
100119
run_linked link -n "test-device" >"$LINK_CODE_FILE" &
101-
read LINK_CODE <"$LINK_CODE_FILE"
120+
LINK_PID=$!
121+
read -r LINK_CODE <"$LINK_CODE_FILE"
102122
run_main -a "$NUMBER" addDevice --uri "$LINK_CODE"
103-
wait
123+
wait $LINK_PID
104124
run_linked -a "$NUMBER" send --note-to-self -m hi
105125
run_main -a "$NUMBER" receive
106126
run_linked -a "$NUMBER" receive
@@ -180,6 +200,7 @@ run_main -a "$NUMBER_2" updateContact "$NUMBER_1" -n NUMBER_1 -e 10
180200
run_main -a "$NUMBER_2" block "$NUMBER_1"
181201
run_main -a "$NUMBER_2" unblock "$NUMBER_1"
182202
run_main -a "$NUMBER_2" listContacts
203+
run_main -a "$NUMBER_2" listContacts "$NUMBER_1"
183204

184205
run_main -a "$NUMBER_1" send "$NUMBER_2" -m hi
185206
run_main -a "$NUMBER_2" receive
@@ -207,6 +228,7 @@ run_main -a "$NUMBER_1" updateGroup -g "$GROUP_ID" -m "$NUMBER_2"
207228
run_main -a "$NUMBER_1" listGroups -d
208229
run_main -a "$NUMBER_1" --output=json listGroups -d
209230
run_main -a "$NUMBER_2" receive
231+
run_main -a "$NUMBER_2" listGroups -g "$GROUP_ID"
210232
run_main -a "$NUMBER_2" quitGroup -g "$GROUP_ID"
211233
run_main -a "$NUMBER_2" listGroups -d
212234
run_main -a "$NUMBER_2" --output=json listGroups -d
@@ -228,15 +250,16 @@ for OUTPUT in "plain-text" "json"; do
228250
run_main -a "$NUMBER_2" --output="$OUTPUT" receive
229251
run_main -a "$NUMBER_1" --output="$OUTPUT" receive
230252
run_main -a "$NUMBER_1" --output="$OUTPUT" send -e "$NUMBER_2"
253+
run_main -a "$NUMBER_1" --output="$OUTPUT" send "$NUMBER_2" -m test
231254
run_main -a "$NUMBER_2" --output="$OUTPUT" receive
232255
done
233256

234257
## Profile
235258
run_main -a "$NUMBER_1" updateProfile --given-name=GIVEN --family-name=FAMILY --about=ABOUT --about-emoji=EMOJI --avatar=LICENSE --mobile-coin-address="YWJjCg=="
236259

237260
## Provisioning
238-
link "$NUMBER_1"
239-
link "$NUMBER_2"
261+
link "$NUMBER_1" || true
262+
link "$NUMBER_2" || true
240263
run_main -a "$NUMBER_1" listDevices
241264
run_linked -a "$NUMBER_1" sendSyncRequest
242265
run_main -a "$NUMBER_1" sendContacts

src/main/resources/META-INF/native-image/org.asamk/signal-cli/reachability-metadata.json

Lines changed: 24 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1586,42 +1586,13 @@
15861586
},
15871587
{
15881588
"type": "kotlin.reflect.jvm.internal.impl.resolve.scopes.DescriptorKindFilter",
1589-
"allPublicFields": true,
1590-
"fields": [
1591-
{
1592-
"name": "ALL"
1593-
},
1594-
{
1595-
"name": "CALLABLES"
1596-
},
1597-
{
1598-
"name": "CLASSIFIERS"
1599-
},
1600-
{
1601-
"name": "Companion"
1602-
},
1603-
{
1604-
"name": "FUNCTIONS"
1605-
},
1606-
{
1607-
"name": "NON_SINGLETON_CLASSIFIERS"
1608-
},
1609-
{
1610-
"name": "PACKAGES"
1611-
},
1612-
{
1613-
"name": "SINGLETON_CLASSIFIERS"
1614-
},
1615-
{
1616-
"name": "TYPE_ALIASES"
1617-
},
1618-
{
1619-
"name": "VALUES"
1620-
},
1621-
{
1622-
"name": "VARIABLES"
1623-
}
1624-
]
1589+
"allPublicFields": true
1590+
},
1591+
{
1592+
"type": "kotlinx.coroutines.AwaitAll"
1593+
},
1594+
{
1595+
"type": "kotlinx.coroutines.AwaitAll$AwaitAllNode"
16251596
},
16261597
{
16271598
"type": "kotlinx.coroutines.CancellableContinuationImpl",
@@ -6570,6 +6541,23 @@
65706541
{
65716542
"type": "org.signal.network.api.SenderCertificate$ByteArraySerializer"
65726543
},
6544+
{
6545+
"type": "org.signal.network.api.SubmitRecaptchaChallengePayload",
6546+
"methods": [
6547+
{
6548+
"name": "getCaptcha",
6549+
"parameterTypes": []
6550+
},
6551+
{
6552+
"name": "getToken",
6553+
"parameterTypes": []
6554+
},
6555+
{
6556+
"name": "getType",
6557+
"parameterTypes": []
6558+
}
6559+
]
6560+
},
65736561
{
65746562
"type": "org.signal.network.util.JsonUtil$IdentityKeyDeserializer",
65756563
"methods": [

0 commit comments

Comments
 (0)