From b5ac0a412e1958cdff581d14b818bf042293267f Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Fri, 18 Aug 2017 16:20:33 +0200 Subject: Add domino package MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's required by Functest to ease integrating all OPNFV projects and their requirements. It also synchronizes requirements with stable/ocata and renames domino-cli to domino_cli to conform with common module names. It defines scripts and console_scripts to rely on $PATH. run_multimode.sh is adapted to correctly call client, cli and server. It should be noted that run.sh can raise conflicts if it's already provided by another OPNFV package and that run_on_remote_nodes.sh is not fully updated. Otherwise it obliges all OPNFV installers to be updated as well. run.sh is unchanged and it's called by releng from local directory. It may rise runtime issues if several files are not loaded via pkg_resources. Change-Id: Ibd9dd56f316609180aa432c6b7ee5a375d9af674 Signed-off-by: Cédric Ollivier --- tests/run.sh | 24 ++++++++++++------------ tests/run_multinode.sh | 44 ++++++++++++++++++++++---------------------- tests/run_on_remotenodes.sh | 20 ++++++++++---------- tests/test_partitioner.py | 7 ++++--- 4 files changed, 48 insertions(+), 47 deletions(-) (limited to 'tests') diff --git a/tests/run.sh b/tests/run.sh index 7da8f36..3971009 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -111,42 +111,42 @@ start_client2 sleep 1 echo "Test Heartbeat" -python domino-cli.py $CLIENT1_CLIPORT heartbeat +python domino_cli.py $CLIENT1_CLIPORT heartbeat sleep 1 echo "Test Subscribe API" -python domino-cli.py $CLIENT1_CLIPORT subscribe -t hot \ +python domino_cli.py $CLIENT1_CLIPORT subscribe -t hot \ -l tosca.policies.Placement:properties:region:nova-1 sleep 1 -python domino-cli.py $CLIENT1_CLIPORT subscribe -t dummy1,dummy2 --top OVERWRITE +python domino_cli.py $CLIENT1_CLIPORT subscribe -t dummy1,dummy2 --top OVERWRITE sleep 1 -python domino-cli.py $CLIENT1_CLIPORT subscribe -t dummy1,dummy2 --top DELETE +python domino_cli.py $CLIENT1_CLIPORT subscribe -t dummy1,dummy2 --top DELETE sleep 1 -python domino-cli.py $CLIENT1_CLIPORT subscribe \ +python domino_cli.py $CLIENT1_CLIPORT subscribe \ -l tosca.policies.Placement:properties:region:nova-2 sleep 1 -python domino-cli.py $CLIENT1_CLIPORT subscribe \ +python domino_cli.py $CLIENT1_CLIPORT subscribe \ -l tosca.policies.Placement:properties:region:nova-3 \ --lop OVERWRITE sleep 1 -python domino-cli.py $CLIENT1_CLIPORT subscribe \ +python domino_cli.py $CLIENT1_CLIPORT subscribe \ -l tosca.policies.Placement:properties:region:nova-3 \ --lop DELETE sleep 1 echo "Test Publish API" -python domino-cli.py $CLIENT1_CLIPORT publish -t "$toscafile_test1" +python domino_cli.py $CLIENT1_CLIPORT publish -t "$toscafile_test1" sleep 1 -python domino-cli.py $CLIENT1_CLIPORT subscribe \ +python domino_cli.py $CLIENT1_CLIPORT subscribe \ -l tosca.policies.Placement.Geolocation:properties:region:us-west-1 sleep 1 -python domino-cli.py $CLIENT2_CLIPORT publish -t "$toscafile_test1" +python domino_cli.py $CLIENT2_CLIPORT publish -t "$toscafile_test1" sleep 1 -TUID=$(python domino-cli.py $CLIENT2_CLIPORT list-tuids | cut -c3-34) +TUID=$(python domino_cli.py $CLIENT2_CLIPORT list-tuids | cut -c3-34) echo $TUID sleep 1 -python domino-cli.py $CLIENT2_CLIPORT publish -t "$toscafile_test1" -k "$TUID" +python domino_cli.py $CLIENT2_CLIPORT publish -t "$toscafile_test1" -k "$TUID" #echo "Stopping Domino Client 1..." #stop_client1 diff --git a/tests/run_multinode.sh b/tests/run_multinode.sh index 7da8f36..5ccdf65 100755 --- a/tests/run_multinode.sh +++ b/tests/run_multinode.sh @@ -26,31 +26,31 @@ server_log=./tests/logdata/server.log start_server() { - pgrep -f "python DominoServer.py" && return 0 - python DominoServer.py --log "$LOGLEVEL" > "$server_log" 2>&1 & + pgrep -f "DominoServer" && return 0 + DominoServer --log "$LOGLEVEL" > "$server_log" 2>&1 & } stop_server() { - pgrep -f "python DominoServer.py" || return 0 - kill $(pgrep -f "python DominoServer.py") + pgrep -f "DominoServer" || return 0 + kill $(pgrep -f "DominoServer") #cat server.log } start_client1() { - #pgrep -f "python DominoClient.py -p $CLIENT1_PORT" && return 0 - python DominoClient.py -p $CLIENT1_PORT --cliport $CLIENT1_CLIPORT \ + #pgrep -f "DominoClient -p $CLIENT1_PORT" && return 0 + DominoClient -p $CLIENT1_PORT --cliport $CLIENT1_CLIPORT \ --log "$LOGLEVEL" > "$client1_log" 2>&1 & } start_client2() { - #pgrep -f "python DominoClient.py -p $CLIENT2_PORT" && return 0 - python DominoClient.py -p $CLIENT2_PORT --cliport $CLIENT2_CLIPORT \ + #pgrep -f "DominoClient -p $CLIENT2_PORT" && return 0 + DominoClient -p $CLIENT2_PORT --cliport $CLIENT2_CLIPORT \ --log "$LOGLEVEL" > "$client2_log" 2>&1 & } stop_clients() { - pgrep -f "python DominoClient.py" || return 0 - kill $(pgrep -f "python DominoClient.py") + pgrep -f "DominoClient" || return 0 + kill $(pgrep -f "DominoClient") #cat client1.log } @@ -111,42 +111,42 @@ start_client2 sleep 1 echo "Test Heartbeat" -python domino-cli.py $CLIENT1_CLIPORT heartbeat +domino_cli $CLIENT1_CLIPORT heartbeat sleep 1 echo "Test Subscribe API" -python domino-cli.py $CLIENT1_CLIPORT subscribe -t hot \ +domino_cli $CLIENT1_CLIPORT subscribe -t hot \ -l tosca.policies.Placement:properties:region:nova-1 sleep 1 -python domino-cli.py $CLIENT1_CLIPORT subscribe -t dummy1,dummy2 --top OVERWRITE +domino_cli $CLIENT1_CLIPORT subscribe -t dummy1,dummy2 --top OVERWRITE sleep 1 -python domino-cli.py $CLIENT1_CLIPORT subscribe -t dummy1,dummy2 --top DELETE +domino_cli $CLIENT1_CLIPORT subscribe -t dummy1,dummy2 --top DELETE sleep 1 -python domino-cli.py $CLIENT1_CLIPORT subscribe \ +domino_cli $CLIENT1_CLIPORT subscribe \ -l tosca.policies.Placement:properties:region:nova-2 sleep 1 -python domino-cli.py $CLIENT1_CLIPORT subscribe \ +domino_cli $CLIENT1_CLIPORT subscribe \ -l tosca.policies.Placement:properties:region:nova-3 \ --lop OVERWRITE sleep 1 -python domino-cli.py $CLIENT1_CLIPORT subscribe \ +domino_cli $CLIENT1_CLIPORT subscribe \ -l tosca.policies.Placement:properties:region:nova-3 \ --lop DELETE sleep 1 echo "Test Publish API" -python domino-cli.py $CLIENT1_CLIPORT publish -t "$toscafile_test1" +domino_cli $CLIENT1_CLIPORT publish -t "$toscafile_test1" sleep 1 -python domino-cli.py $CLIENT1_CLIPORT subscribe \ +domino_cli $CLIENT1_CLIPORT subscribe \ -l tosca.policies.Placement.Geolocation:properties:region:us-west-1 sleep 1 -python domino-cli.py $CLIENT2_CLIPORT publish -t "$toscafile_test1" +domino_cli $CLIENT2_CLIPORT publish -t "$toscafile_test1" sleep 1 -TUID=$(python domino-cli.py $CLIENT2_CLIPORT list-tuids | cut -c3-34) +TUID=$(domino_cli $CLIENT2_CLIPORT list-tuids | cut -c3-34) echo $TUID sleep 1 -python domino-cli.py $CLIENT2_CLIPORT publish -t "$toscafile_test1" -k "$TUID" +domino_cli $CLIENT2_CLIPORT publish -t "$toscafile_test1" -k "$TUID" #echo "Stopping Domino Client 1..." #stop_client1 diff --git a/tests/run_on_remotenodes.sh b/tests/run_on_remotenodes.sh index f60f469..a371427 100755 --- a/tests/run_on_remotenodes.sh +++ b/tests/run_on_remotenodes.sh @@ -132,30 +132,30 @@ if [ "$IS_IPandKEY_CONFIGURED" = "true" ]; then echo "Test Heartbeat" - ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_2" "sh -c 'cd domino; python domino-cli.py $CLIENT1_CLIPORT heartbeat'" + ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_2" "sh -c 'cd domino; python domino_cli.py $CLIENT1_CLIPORT heartbeat'" sleep 1 echo "Test Subscribe API" - ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_2" "sh -c 'cd domino; python domino-cli.py $CLIENT1_CLIPORT subscribe -t hot -l tosca.policies.Placement:properties:region:nova-1'" + ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_2" "sh -c 'cd domino; python domino_cli.py $CLIENT1_CLIPORT subscribe -t hot -l tosca.policies.Placement:properties:region:nova-1'" sleep 1 - ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_2" "sh -c 'cd domino; python domino-cli.py $CLIENT1_CLIPORT subscribe -t dummy1,dummy2 --top OVERWRITE'" + ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_2" "sh -c 'cd domino; python domino_cli.py $CLIENT1_CLIPORT subscribe -t dummy1,dummy2 --top OVERWRITE'" sleep 1 - ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_2" "sh -c 'cd domino; python domino-cli.py $CLIENT1_CLIPORT subscribe -t dummy1,dummy2 --top DELETE'" + ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_2" "sh -c 'cd domino; python domino_cli.py $CLIENT1_CLIPORT subscribe -t dummy1,dummy2 --top DELETE'" sleep 1 - ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_2" "sh -c 'cd domino; python domino-cli.py $CLIENT1_CLIPORT subscribe -l tosca.policies.Placement:properties:region:nova-2'" + ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_2" "sh -c 'cd domino; python domino_cli.py $CLIENT1_CLIPORT subscribe -l tosca.policies.Placement:properties:region:nova-2'" sleep 1 - ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_2" "sh -c 'cd domino; python domino-cli.py $CLIENT1_CLIPORT subscribe -l tosca.policies.Placement:properties:region:nova-3 --lop OVERWRITE'" + ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_2" "sh -c 'cd domino; python domino_cli.py $CLIENT1_CLIPORT subscribe -l tosca.policies.Placement:properties:region:nova-3 --lop OVERWRITE'" sleep 1 - ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_2" "sh -c 'cd domino; python domino-cli.py $CLIENT1_CLIPORT subscribe -l tosca.policies.Placement:properties:region:nova-3 --lop DELETE'" + ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_2" "sh -c 'cd domino; python domino_cli.py $CLIENT1_CLIPORT subscribe -l tosca.policies.Placement:properties:region:nova-3 --lop DELETE'" sleep 1 echo "Test Publish API" - ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_3" "sh -c 'cd domino; python domino-cli.py $CLIENT2_CLIPORT publish -t "$toscafile_test1"'" + ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_3" "sh -c 'cd domino; python domino_cli.py $CLIENT2_CLIPORT publish -t "$toscafile_test1"'" sleep 1 - ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_2" "sh -c 'cd domino; python domino-cli.py $CLIENT1_CLIPORT subscribe -l tosca.policies.Placement.Geolocation:properties:region:us-west-1'" + ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_2" "sh -c 'cd domino; python domino_cli.py $CLIENT1_CLIPORT subscribe -l tosca.policies.Placement.Geolocation:properties:region:us-west-1'" sleep 1 - ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_3" "sh -c 'cd domino; python domino-cli.py $CLIENT2_CLIPORT publish -t "$toscafile_test1"'" + ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_3" "sh -c 'cd domino; python domino_cli.py $CLIENT2_CLIPORT publish -t "$toscafile_test1"'" echo "done" diff --git a/tests/test_partitioner.py b/tests/test_partitioner.py index 5634c01..439f84c 100755 --- a/tests/test_partitioner.py +++ b/tests/test_partitioner.py @@ -20,7 +20,8 @@ sys.path.insert(0, glob.glob('./lib')[0]) from mapper import * from partitioner import * -def main(argv): +def main(): + argv = sys.argv[1:] try: #tosca = ToscaTemplate(argv[0]) tpl = yaml.load(file(argv[0],'r')) @@ -52,6 +53,6 @@ def main(argv): except: print('Unexpected error: %s', sys.exc_info()[0]) raise -if __name__ == "__main__": - main(sys.argv[1:]) +if __name__ == "__main__": + sys.exit(main()) -- cgit 1.2.3-korg