]> nmode's Git Repositories - signal-cli/commitdiff
Update tests
authorAsamK <asamk@gmx.de>
Wed, 25 Aug 2021 19:27:20 +0000 (21:27 +0200)
committerAsamK <asamk@gmx.de>
Wed, 25 Aug 2021 19:27:20 +0000 (21:27 +0200)
graalvm-config-dir/reflect-config.json
run_tests.sh

index bba5ef4813e38192e8711bd18439c13347fbd4ec..aef740aa890113ac3a73ac15640a82ba3d73bbf4 100644 (file)
   "allDeclaredMethods":true,
   "allDeclaredConstructors":true
 },
   "allDeclaredMethods":true,
   "allDeclaredConstructors":true
 },
+{
+  "name":"org.asamk.signal.commands.ListContactsCommand$JsonContact",
+  "allDeclaredFields":true,
+  "allDeclaredMethods":true,
+  "allDeclaredConstructors":true
+},
+{
+  "name":"org.asamk.signal.commands.ListDevicesCommand$JsonDevice",
+  "allDeclaredFields":true,
+  "allDeclaredMethods":true,
+  "allDeclaredConstructors":true
+},
 {
   "name":"org.asamk.signal.commands.ListGroupsCommand$JsonGroup",
   "allDeclaredFields":true,
   "allDeclaredMethods":true,
   "allDeclaredConstructors":true
 },
 {
   "name":"org.asamk.signal.commands.ListGroupsCommand$JsonGroup",
   "allDeclaredFields":true,
   "allDeclaredMethods":true,
   "allDeclaredConstructors":true
 },
+{
+  "name":"org.asamk.signal.commands.ListGroupsCommand$JsonGroupMember",
+  "allDeclaredFields":true,
+  "allDeclaredMethods":true,
+  "allDeclaredConstructors":true
+},
+{
+  "name":"org.asamk.signal.commands.ListIdentitiesCommand$JsonIdentity",
+  "allDeclaredFields":true,
+  "allDeclaredMethods":true,
+  "allDeclaredConstructors":true
+},
 {
   "name":"org.asamk.signal.json.JsonAttachment",
   "allDeclaredFields":true,
 {
   "name":"org.asamk.signal.json.JsonAttachment",
   "allDeclaredFields":true,
   "allDeclaredConstructors":true
 },
 {
   "allDeclaredConstructors":true
 },
 {
-  "name": "org.asamk.signal.jsonrpc.JsonRpcBulkMessage",
+  "name":"org.asamk.signal.jsonrpc.JsonRpcBulkMessage",
   "allDeclaredFields":true,
   "allDeclaredMethods":true,
   "allDeclaredConstructors":true
 },
 {
   "allDeclaredFields":true,
   "allDeclaredMethods":true,
   "allDeclaredConstructors":true
 },
 {
-  "name": "org.asamk.signal.jsonrpc.JsonRpcException",
+  "name":"org.asamk.signal.jsonrpc.JsonRpcException",
   "allDeclaredFields":true,
   "allDeclaredMethods":true,
   "allDeclaredConstructors":true
 },
 {
   "allDeclaredFields":true,
   "allDeclaredMethods":true,
   "allDeclaredConstructors":true
 },
 {
-  "name": "org.asamk.signal.jsonrpc.JsonRpcMessage",
-  "allDeclaredFields": true,
+  "name":"org.asamk.signal.jsonrpc.JsonRpcMessage",
+  "allDeclaredFields":true,
   "allDeclaredMethods":true,
   "allDeclaredConstructors":true
 },
 {
   "allDeclaredMethods":true,
   "allDeclaredConstructors":true
 },
 {
-  "name": "org.asamk.signal.jsonrpc.JsonRpcRequest",
-  "allDeclaredFields": true,
+  "name":"org.asamk.signal.jsonrpc.JsonRpcRequest",
+  "allDeclaredFields":true,
   "allDeclaredMethods":true,
   "allDeclaredConstructors":true
 },
 {
   "name":"org.asamk.signal.jsonrpc.JsonRpcResponse",
   "allDeclaredMethods":true,
   "allDeclaredConstructors":true
 },
 {
   "name":"org.asamk.signal.jsonrpc.JsonRpcResponse",
-  "allDeclaredFields": true,
+  "allDeclaredFields":true,
+  "allDeclaredMethods":true,
+  "allDeclaredConstructors":true
+},
+{
+  "name":"org.asamk.signal.jsonrpc.JsonRpcResponse$Error",
+  "allDeclaredFields":true,
   "allDeclaredMethods":true,
   "allDeclaredConstructors":true
 },
   "allDeclaredMethods":true,
   "allDeclaredConstructors":true
 },
index 1405ada38db4ae5429c02abfdd4d6f15a83d33db..4ee468455ef7b5820e5434fdff83692ef8e8253f 100755 (executable)
@@ -23,21 +23,21 @@ PATH_LINK="$PATH_TEST_CONFIG/link"
 
 ./gradlew installDist
 
 
 ./gradlew installDist
 
-function run() {
+run() {
   set -x
   "$SIGNAL_CLI" --service-environment="sandbox" $@
   set +x
 }
 
   set -x
   "$SIGNAL_CLI" --service-environment="sandbox" $@
   set +x
 }
 
-function run_main() {
+run_main() {
   run --config="$PATH_MAIN" $@
 }
 
   run --config="$PATH_MAIN" $@
 }
 
-function run_linked() {
+run_linked() {
   run --config="$PATH_LINK" $@
 }
 
   run --config="$PATH_LINK" $@
 }
 
-function register() {
+register() {
   NUMBER=$1
   PIN=$2
   echo -n "Enter a captcha token (https://signalcaptchas.org/registration/generate.html): "
   NUMBER=$1
   PIN=$2
   echo -n "Enter a captcha token (https://signalcaptchas.org/registration/generate.html): "
@@ -52,7 +52,7 @@ function register() {
   fi
 }
 
   fi
 }
 
-function link() {
+link() {
   NUMBER=$1
   LINK_CODE_FILE="$PATH_TEST_CONFIG/link_code"
   rm -f "$LINK_CODE_FILE"
   NUMBER=$1
   LINK_CODE_FILE="$PATH_TEST_CONFIG/link_code"
   rm -f "$LINK_CODE_FILE"
@@ -76,6 +76,40 @@ register "$NUMBER_2"
 
 sleep 5
 
 
 sleep 5
 
+# JSON-RPC
+FIFO_FILE="${PATH_MAIN}/dbus-fifo"
+
+rm -f "$FIFO_FILE"
+mkfifo "$FIFO_FILE"
+
+run_main -u "$NUMBER_1" send "$NUMBER_2" -m hi
+run_main -u "$NUMBER_2" jsonRpc < "$FIFO_FILE" &
+
+exec 3<> "$FIFO_FILE"
+  echo '{"jsonrpc":"2.0","id":"id","method":"updateContact","params":{"recipient":"'"$NUMBER_1"'","name":"NUMBER_1","expiration":10}}' >&3
+  echo '{"jsonrpc":"2.0","id":5,"method":"block","params":{"recipient":"'"$NUMBER_1"'"}}' >&3
+  echo '{"jsonrpc":"2.0","id":null,"method":"unblock","params":{"recipient":"'"$NUMBER_1"'"}}' >&3
+  echo '{"jsonrpc":"2.0","id":"id","method":"listContacts"}' >&3
+  echo '{"jsonrpc":"2.0","id":"id","method":"listGroups"}' >&3
+  echo '{"jsonrpc":"2.0","id":"id","method":"listDevices"}' >&3
+  echo '{"jsonrpc":"2.0","id":"id","method":"listIdentities"}' >&3
+  echo '{"jsonrpc":"2.0","id":"id","method":"sendSyncRequest"}' >&3
+  echo '{"jsonrpc":"2.0","id":"id","method":"sendContacts"}' >&3
+  echo '{"jsonrpc":"2.0","id":"id","method":"version"}' >&3
+  echo '{"jsonrpc":"2.0","id":"id","method":"updateAccount"}' >&3
+  echo '{"jsonrpc":"2.0","id":7,"method":"sendReceipt","params":{"recipient":"'"$NUMBER_1"'","targetTimestamp":1629919505575}}' >&3
+  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":"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
+
+  # Error expected:
+  echo '{"jsonrpc":"2.0","id":7,"method":"sendReceipt","params":{"recipient":5}}' >&3
+exec 3>&-
+
+wait
+
 run_main -u "$NUMBER_1" setPin "$TEST_PIN_1"
 run_main -u "$NUMBER_2" removePin
 
 run_main -u "$NUMBER_1" setPin "$TEST_PIN_1"
 run_main -u "$NUMBER_2" removePin