Completed test case automation (shell scripting resources). Pending new features...
[anna.git] / example / diameter / launcher / resources / ft-client / tests / case_1.sh
index 7eca089..b353c63 100755 (executable)
@@ -1,9 +1,15 @@
 #!/bin/bash
 
+# In this test we will send a incorrect message (AAR) to the server peer:
+#       Warning | source/diameter/codec/Message.cpp (387) | Internal Avp decoding error (avp code = 443): Avp format error, the avp length is incorrect (must be multiple of 4 on grouped type)
+#
+# The server shall answer with the FailedAVP and we will check this to validate the test.
+
 #############
 # VARIABLES #
 #############
-
+# Paths from the point of view of ADL executable:
+REQ1_HEX=./hex_examples/aar-bad.hex
 
 #############
 # FUNCTIONS #
@@ -20,5 +26,22 @@ cd `dirname $0`
 # Source utils:
 source common.sh
 
-# xxxx
-echo "testing ..."
+# Clean traffic traces:
+rm ../launcher.log*
+
+# Send incorrect AAR:
+send_hex $REQ1_HEX &
+
+# Monitor activity:
+monitor_4_message ../launcher.log.recvfe 10
+
+# Check if message was received:
+[ $? -ne 0 ] && test_failed "Missing answer from the server"
+
+# Check launcher.log.recvfe:
+check_pattern "<avp name=\"Result-Code\" data=\"5004\" alias=\"DIAMETER_INVALID_AVP_VALUE\"/>" ../launcher.log.recvfe
+check_pattern "<avp name=\"Failed-AVP\">( *)<avp name=\"Subscription-Id\"" ../launcher.log.recvfe
+
+# Test OK
+test_ok "Received answer to bad-aar message indicating Failed-AVP as Subscription-Id"
+