2 Documentation A test suite which contains keywords of ODL micro which are used commonly.
4 Library OperatingSystem
9 Library RequestsLibrary
15 [Documentation] Create SSH Connection and deploy odl micro
16 SSHLibrary.Open_Connection ${ODL_SYSTEM_IP} alias=ODL_System
17 SSHLibrary.Set_Client_Configuration timeout=10s
18 SSHLibrary.Set_Client_Configuration prompt=${ODL_SYSTEM_PROMPT}
19 SSHKeywords.Flexible_SSH_Login ${ODL_SYSTEM_USER} ${ODL_SYSTEM_PASSWORD} delay=4s
20 ${file_name} = NexusKeywords.Deploy_Test_Tool odl-micro micro-netconf micro ${BASE_URL} build_version=${ODL_MICRO_VERSION} build_location=org/opendaylight/odlmicro
21 BuiltIn.Set_Suite_Variable ${FILENAME} ${filename}
24 [Documentation] Run ODL Micro
25 SSHLibrary.Switch_Connection ODL_System
26 SSHLibrary.Write tar -xvf ${FILE_NAME} -C ${ODL_MICRO_WORKSPACE}/
27 SSHLibrary.Write cd ${ODL_MICRO_WORKSPACE}/micro-netconf-${ODL_MICRO_VERSION}
28 ${response} = SSHLibrary.Execute_Command ls
29 BuiltIn.Log ${response}
30 ${command} = NexusKeywords.Compose_Full_Java_Command -Xms128M -Xmx2048m -XX:+UnlockDiagnosticVMOptions -XX:+HeapDumpOnOutOfMemoryError -XX:+DisableExplicitGC -Dcom.sun.management.jmxremote -Dfile.encoding=UTF-8 -Djava.security.egd=file:/dev/./urandom -cp "etc/initial/:lib/*" org.opendaylight.netconf.micro.NetconfMain > /tmp/odlmicro.log 2>&1
31 BuiltIn.Log ${command}
32 SSHLibrary.Write ${command}
35 [Arguments] ${process_name}
36 ${pid} = SSHLibrary.Execute Command ps -fu ${ODL_SYSTEM_USER} | grep "${process_name}" | grep -v "grep" | awk '{print $2}'
40 [Arguments] ${portno} ${session}=ODL_Micro_instance
41 SSHLibrary.Switch_Connection ${session}
42 SSHLibrary.Write netstat -tunpl
43 SSHLibrary.Read Until Regexp .*${portno}
46 [Arguments] ${process_name}
47 SSHLibrary.Open_Connection ${ODL_SYSTEM_IP} alias=ODL_Micro_instance
48 SSHLibrary.Set_Client_Configuration timeout=10s
49 SSHLibrary.Set_Client_Configuration prompt=${ODL_SYSTEM_PROMPT}
50 SSHKeywords.Flexible_SSH_Login ${ODL_SYSTEM_USER} ${ODL_SYSTEM_PASSWORD} delay=4s
51 ${mock_pid} Get pid ${process_name}
52 BuiltIn.Run_Keyword_If '${mock_pid}' == '${EMPTY}' BuiltIn.Fail No ${process_name} process is running
55 [Arguments] ${process_name} ${ssh_alias}=ODL_Micro_instance
56 SSHLibrary.Switch_Connection ${ssh_alias}
57 ${mock_pid} Get pid ${process_name}
58 SSHLibrary.Execute_Command kill -9 ${mock_pid}
60 Download Netconf Testtool
61 [Documentation] Download netconf testtool from opendaylight nexus
62 SSHLibrary.Open_Connection ${TOOLS_SYSTEM_IP} alias=Netconf_System
63 SSHLibrary.Set_Client_Configuration timeout=10s
64 SSHLibrary.Set_Client_Configuration prompt=${TOOLS_SYSTEM_PROMPT}
65 SSHKeywords.Flexible_SSH_Login ${TOOLS_SYSTEM_USER} ${TOOLS_SYSTEM_PASSWORD} delay=4s
66 ${file_name} = NexusKeywords.Deploy_Test_Tool netconf netconf-testtool build_version=${NETCONF_TESTTOOL_VERSION} build_location=org/opendaylight/netconf
67 Set Global Variable ${NETCONF_FILENAME} ${filename}
68 ${file_name} = NexusKeywords.Deploy_Test_Tool netconf netconf-testtool rest-perf-client build_version=${NETCONF_TESTTOOL_VERSION} build_location=org/opendaylight/netconf
69 Set Global Variable ${RESTPERF_FILENAME} ${filename}
72 [Arguments] ${ssh_alias}=Netconf_System
73 NetconfKeywords.Start_Testtool ${NETCONF_FILENAME} device-count=1 schemas=${CURDIR}/../variables/netconf/CRUD/schemas