SETUPS_DIR=../../../source/diameter/stack/setups
MSGDTD=../../../include/anna/diameter/codec/message.dtd
DCTDTD=../../../include/anna/diameter/stack/dictionary.dtd
-BASE_PROT=commands_baseProtocol.xml
SERVICES=./resources/services_examples
STACK_EXAMPLES=./resources/stack_examples
SRVDTD=$SERVICES/services.dtd
chmod a+x run.sh
}
-createDictionaryPaths () {
- echo "Creating dictionaries ..."
-
- for i in stacks/*commands*xml
- do
- stacks/dependence.sh $i >/dev/null
- stack=`basename $i`
- if test "$stack" != "$BASE_PROT"
- then
- > .dictionary-${stack}
- for j in `cat ${i}.dep`
- do
- echo -n "${j} " >> .dictionary-${stack}
- done
- echo "stacks/$BASE_PROT stacks/${stack}" >> .dictionary-${stack}
- fi
- done
-
- # Create autonomous dictionaries:
- mkdir stacks/autonomous
- for i in `ls .dictionary-*`
- do
- name=$(echo $i | cut -d\- -f2)
- $STACKMGMT_EXEC `cat $i` >/dev/null
- mv result.xml stacks/autonomous/$name
- done
-
- # Cleanup:
- rm -f stacks/*.dep
- rm -f .dictionary-*
- rm -f example_diameter_stackManagement.trace*
-
- # Default:
- ln -s stacks/autonomous/commands_qosControl.xml dictionary.xml
-}
-
#############
# EXECUTION #
#############
mkdir -p $DPATH/counters
mkdir -p $DPATH/test-reports
[ "$option" = "b" ] && mkdir -p $DPATH/services
+
+# ADML executable:
if [ "$EXEC" = "$EXEC_installed" ]
then
ln -s $EXEC_installed $DPATH/ADML-launcher
else
cp $EXEC $DPATH/ADML-launcher
fi
+
+# Stack management tool:
+if [ "$STACKMGMT_EXEC" = "$STACKMGMT_EXEC_installed" ]
+then
+ ln -s $STACKMGMT_EXEC_installed $DPATH/stacks/stack-mgmt
+else
+ cp $STACKMGMT_EXEC $DPATH/stack-mgmt
+fi
+
cp -rL $DEPLOYMENTS_DIR/* $DPATH
cp $SETUPS_DIR/*xml $DPATH/stacks
cp $SETUPS_DIR/*sh $DPATH/stacks
echo "Preparing ..."
cd $DPATH
createRunScript $option
-createDictionaryPaths
+stacks/makeAutonomous.sh commands_qosControl.xml ./stack-mgmt
+ln -s stacks/autonomous.commands_qosControl.xml dictionary.xml
cd - >/dev/null
# Help:
--- /dev/null
+#!/bin/bash
+
+#############
+# VARIABLES #
+#############
+BASE_PROTOCOL_XML=commands_baseProtocol.xml
+
+#############
+# FUNCTIONS #
+#############
+_exit () {
+ echo
+ echo $1
+ echo
+ exit 1
+}
+
+usage () {
+ echo
+ echo
+ echo "Usage: makeAutonomous.sh <incomplete dictionary> <stack management executable>"
+ echo
+ echo " For example:"
+ echo " makeAutonomous.sh commands_qosControl.xml ./stack-mgmt"
+ echo
+ echo " A new dictionary will be created: autonomous.commands_qosControl.xml"
+ _exit
+}
+
+#############
+# EXECUTION #
+#############
+[ -z "$2" ] && usage
+
+COMMAND_XML=$1
+[ "$COMMAND_XML" = "$BASE_PROTOCOL_XML" ] && _exit "$COMMAND_XML skipped !"
+
+STACK_EXE=$2
+target=autonomous.${COMMAND_XML}
+cd `dirname $0`
+
+echo -n "Creating $target ... "
+0>.dict_list
+./dependence.sh $COMMAND_XML >/dev/null
+for i in `cat ${COMMAND_XML}.dep`; do echo -n "$i " >> .dict_list ; done
+echo "$BASE_PROTOCOL_XML $COMMAND_XML" >> .dict_list
+
+# Create autonomous dictionary:
+$STACK_EXE `cat .dict_list` >/dev/null
+mv result.xml $target
+
+# Cleanup:
+rm -f *.dep
+rm -f example_diameter_stackManagement.trace*
+rm .dict_list
+echo "Done!"
+