X-Git-Url: https://git.nmode.ca/signal-cli/blobdiff_plain/4120630309979c1c952691a3b000b79b727a8d39..7a25ae5b9c435e28988449a911c79045bad8c719:/run_tests.sh diff --git a/run_tests.sh b/run_tests.sh index c8788cb4..036ba370 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -11,8 +11,9 @@ NUMBER_2="$2" TEST_PIN_1=456test_pin_foo123 NATIVE=0 JSON_RPC=0 +TEST_REGISTER=0 -PATH_TEST_CONFIG="$PWD/build/test-config" +PATH_TEST_CONFIG="$PWD/test-config" PATH_MAIN="$PATH_TEST_CONFIG/main" PATH_LINK="$PATH_TEST_CONFIG/link" @@ -31,7 +32,7 @@ fi run() { # To update graalvm config, set GRAALVM_HOME, e.g: - # export GRAALVM_HOME=/usr/lib/jvm/java-17-graalvm + # export GRAALVM_HOME=/usr/lib/jvm/java-21-graalvm if [ ! -z "$GRAALVM_HOME" ]; then export JAVA_HOME=$GRAALVM_HOME export SIGNAL_CLI_OPTS="-agentlib:native-image-agent=config-merge-dir=graalvm-config-dir-${SIGNAL_CLI_AGENT_ID}/" @@ -97,16 +98,20 @@ link() { } run_main --version +run_main version run_main --help ## Register -register "$NUMBER_1" "$TEST_PIN_1" -register "$NUMBER_2" +if [ "$TEST_REGISTER" -eq 1 ]; then + register "$NUMBER_1" "$TEST_PIN_1" + register "$NUMBER_2" +fi sleep 5 run_main listAccounts run_main --output=json listAccounts +run_main --scrub-log listAccounts if [ "$JSON_RPC" -eq 0 ]; then ## DBus @@ -144,6 +149,7 @@ exec 3<> "$FIFO_FILE" echo '{"jsonrpc":"2.0","id":7,"method":"sendTyping","params":{"recipient":"'"$NUMBER_1"'"}}' >&3 echo '{"jsonrpc":"2.0","id":7,"method":"send","params":{"recipient":"'"$NUMBER_1"'","message":"some text"}}' >&3 echo '{"jsonrpc":"2.0","id":7,"method":"send","params":{"recipients":["'"$NUMBER_1"'","'"$NUMBER_2"'"],"message":"some other text"}}' >&3 + echo '{"jsonrpc":"2.0","id":7,"method":"sendReaction","params":{"recipients":["'"$NUMBER_2"'"],"targetAuthor":"'"$NUMBER_1"'","emoji":"👍","targetTimestamp":4756473756}}' >&3 echo '{"jsonrpc":"2.0","id":7,"method":"updateProfile","params":{"givenName":"n1","familyName":"n2","about":"ABA","aboutEmoji":"EMO","avatar":"LICENSE"}}' >&3 echo '{"jsonrpc":"2.0","id":7,"method":"getUserStatus","params":{"recipient":"'"$NUMBER_1"'"}}' >&3 @@ -155,6 +161,7 @@ wait fi run_main -a "$NUMBER_1" setPin "$TEST_PIN_1" +run_main -a "$NUMBER_1" register --reregister run_main -a "$NUMBER_2" removePin ## Contacts @@ -185,14 +192,7 @@ run_main -a "$NUMBER_1" receive run_main -a "$NUMBER_1" updateGroup -g "$GROUP_ID" -m "$NUMBER_2" run_main -a "$NUMBER_1" block -g "$GROUP_ID" run_main -a "$NUMBER_1" unblock -g "$GROUP_ID" - -## Configuration -run_main -a "$NUMBER_1" updateConfiguration --read-receipts=true - -## Identities -run_main -a "$NUMBER_1" listIdentities -run_main -a "$NUMBER_2" listIdentities -run_main -a "$NUMBER_2" trust "$NUMBER_1" -a +run_main -a "$NUMBER_1" submitRateLimitChallenge --challenge 8xxxxxx8-0xx2-4xx9-9xx2-4xxxxxxxxxx7 --captcha signalcaptcha://signal-hcaptcha.5fa.registration.P.h.-K || true ## Basic send/receive for OUTPUT in "plain-text" "json"; do @@ -210,7 +210,7 @@ for OUTPUT in "plain-text" "json"; do done ## Profile -run_main -a "$NUMBER_1" updateProfile --given-name=GIVEN --family-name=FAMILY --about=ABOUT --about-emoji=EMOJI --avatar=LICENSE +run_main -a "$NUMBER_1" updateProfile --given-name=GIVEN --family-name=FAMILY --about=ABOUT --about-emoji=EMOJI --avatar=LICENSE --mobile-coin-address="YWJjCg==" ## Provisioning link "$NUMBER_1" @@ -219,9 +219,19 @@ run_main -a "$NUMBER_1" listDevices run_linked -a "$NUMBER_1" sendSyncRequest run_main -a "$NUMBER_1" sendContacts +## Configuration +run_main -a "$NUMBER_1" updateConfiguration --read-receipts=true + +## Identities +run_main -a "$NUMBER_1" listIdentities +run_main -a "$NUMBER_2" listIdentities +run_main -a "$NUMBER_2" trust "$NUMBER_1" -a + for OUTPUT in "plain-text" "json"; do run_main -a "$NUMBER_1" --output="$OUTPUT" send "$NUMBER_2" -m hi - run_main -a "$NUMBER_2" --output="$OUTPUT" send "$NUMBER_1" -m hi + run_main -a "$NUMBER_1" --output="$OUTPUT" send "$NUMBER_2" -m hi --edit-timestamp 123456677 + run_main -a "$NUMBER_2" --output="$OUTPUT" send "$NUMBER_1" -m hi --text-style "1:1:BOLD" --quote-timestamp 12345 --quote-author "$NUMBER_1" --quote-message hitest --quote-text-style "1:1:BOLD" --preview-url "https://example.com" --preview-title preview --preview-description foo --preview-image LICENSE --story-timestamp 1234567 --story-author "$NUMBER_1" + run_main -a "$NUMBER_1" --output="$OUTPUT" sendPaymentNotification --receipt "YWJjCg==" --note notefoo "$NUMBER_2" run_main -a "$NUMBER_2" --output="$OUTPUT" receive run_main -a "$NUMBER_1" --output="$OUTPUT" receive run_linked -a "$NUMBER_1" --output="$OUTPUT" receive @@ -230,8 +240,11 @@ done run_main -a "$NUMBER_1" removeDevice -d 2 ## Unregister -run_main -a "$NUMBER_1" unregister -run_main -a "$NUMBER_2" unregister --delete-account +if [ "$TEST_REGISTER" -eq 1 ]; then + run_main -a "$NUMBER_1" unregister + run_main -a "$NUMBER_2" unregister --delete-account +fi +run_main -a "$NUMBER_2" deleteLocalAccountData || true if [ ! -z "$GRAALVM_HOME" ]; then "$GRAALVM_HOME"/lib/svm/bin/native-image-configure generate --input-dir=graalvm-config-dir/ --input-dir=graalvm-config-dir-linked/ --input-dir=graalvm-config-dir-main/ --output-dir=graalvm-config-dir//