Robot Test: Included Test are
Feature 1415 RBAC visibility of packeges and instances
Feature 7921 MongoDb File system
Feature 8047 osmclient package creation and validation
Manual VNF/VDU scaling using osmclient
Feature 7326 Disable port security for ns at network level

Change-Id: I1e936595a4af9e6c707f22c2719438310e646b35
Signed-off-by: yadavmr <my00514913@techmahindra.com>
diff --git a/robot-systest/lib/cli/network_slicing_lib.robot b/robot-systest/lib/cli/network_slicing_lib.robot
index 8ed3e63..9a3ff37 100644
--- a/robot-systest/lib/cli/network_slicing_lib.robot
+++ b/robot-systest/lib/cli/network_slicing_lib.robot
@@ -36,8 +36,8 @@
     [Arguments]  ${nst_pkg}
 
     ${rc}   ${stdout}=      Run and Return RC and Output	    osm nst-create ${nst_pkg}
-    Should Be Equal As Integers 	${rc}	  ${success_return_code}
     log     ${stdout}
+    Should Be Equal As Integers 	${rc}	  ${success_return_code}
     [Return]  ${stdout}
 
 
@@ -46,8 +46,8 @@
     [Arguments]  ${nst}
 
     ${rc}   ${stdout}=      Run and Return RC and Output	    osm nst-delete ${nst}
-    Should Be Equal As Integers 	${rc}	  ${success_return_code}
     log     ${stdout}
+    Should Be Equal As Integers 	${rc}	  ${success_return_code}
     [Return]  ${stdout}
 
 
@@ -66,8 +66,8 @@
     [Arguments]  ${nsi_name}    ${nst_name}    ${vim}    ${config}
 
     ${rc}   ${stdout}=      Run and Return RC and Output    osm nsi-create --nsi_name ${nsi_name} --nst_name ${nst_name} --vim_account ${vim} --config ${config}
-    Should Be Equal As Integers    ${rc}    ${success_return_code}
     log     ${stdout}
+    Should Be Equal As Integers    ${rc}    ${success_return_code}
     Append To List     ${nsi_list}       ${nsi_name}
 
 
@@ -75,8 +75,8 @@
     [Arguments]  ${nsi_name}    ${nst_name}    ${vim}
 
     ${rc}   ${stdout}=      Run and Return RC and Output    osm nsi-create --nsi_name ${nsi_name} --nst_name ${nst_name} --vim_account ${vim}
-    Should Be Equal As Integers    ${rc}    ${success_return_code}
     log     ${stdout}
+    Should Be Equal As Integers    ${rc}    ${success_return_code}
     Append To List     ${nsi_list}       ${nsi_name}
 
 
@@ -84,8 +84,8 @@
     [Arguments]  ${nsi_name}
 
     ${rc}   ${stdout}=      Run and Return RC and Output    osm nsi-list --filter name="${nsi_name}"
-    Should Be Equal As Integers    ${rc}    ${success_return_code}
     log     ${stdout}
+    Should Be Equal As Integers    ${rc}    ${success_return_code}
     Should Not Contain      ${stdout}   failed
 
 
@@ -93,8 +93,8 @@
     [Arguments]  ${nsi_name}
 
     ${rc}   ${stdout}=      Run and Return RC and Output    osm nsi-list --filter name="${nsi_name}"
-    Should Be Equal As Integers    ${rc}    ${success_return_code}
     log     ${stdout}
+    Should Be Equal As Integers    ${rc}    ${success_return_code}
     Should Contain Any      ${stdout}   configured    failed
 
 
@@ -103,8 +103,8 @@
     [Arguments]  ${nsi}
 
     ${rc}   ${stdout}=      Run and Return RC and Output    osm nsi-delete ${nsi}
-    Should Be Equal As Integers    ${rc}    ${success_return_code}
     log     ${stdout}
+    Should Be Equal As Integers    ${rc}    ${success_return_code}
 
     WAIT UNTIL KEYWORD SUCCEEDS  ${delete_max_wait_time}   ${delete_pol_time}   Check For NSI Instance To Be Delete   ${nsi}
 
@@ -113,6 +113,6 @@
     [Arguments]  ${nsi}
 
     ${rc}   ${stdout}=      Run and Return RC and Output    osm nsi-list
-    Should Be Equal As Integers    ${rc}    ${success_return_code}
     log     ${stdout}
+    Should Be Equal As Integers    ${rc}    ${success_return_code}
     Should Not Contain      ${stdout}   ${nsi}
diff --git a/robot-systest/lib/cli/ns_lib.robot b/robot-systest/lib/cli/ns_lib.robot
index 254bc6a..e0eb0c2 100644
--- a/robot-systest/lib/cli/ns_lib.robot
+++ b/robot-systest/lib/cli/ns_lib.robot
@@ -40,6 +40,23 @@
     Should Be Equal As Integers    ${rc}    ${success_return_code}
 
 
+Get NS Instance ID
+    [Arguments]    ${ns_name}
+
+    ${rc}   ${stdout}=      Run and Return RC and Output    osm ns-list --filter name="${ns_name}" | awk 'NR==4{print $4}'
+    log     ${stdout}
+    [Return]    ${stdout}
+
+
+Verify All JUJU Applications Status
+    [Arguments]    ${ns}    ${api_ip}    ${api_port}    ${username}    ${password}    ${api_cert_path}
+
+    ${juju_model}=    Get NS Instance ID    ${ns}
+
+    Import Library    robot_juju.JujuLibrary    ${api_ip}    ${api_port}    ${juju_model}    ${username}    ${password}    ${api_cert_path}
+    Assert status of applications is  ${status_active}
+
+
 Launch Network Services and Return
     [Arguments]  ${vim_name}  ${ns_config}=''
     [Documentation]  Get Configuration parameter to create Newtork service
@@ -144,3 +161,33 @@
     log     ${stdout}
     Should Be Equal As Integers    ${rc}    ${success_return_code}
     WAIT UNTIL KEYWORD SUCCEEDS    ${ns_delete_max_wait_time}   ${ns_delete_pol_time}   Check For NS Instance To Be Delete   ${ns}
+
+
+Perform VNF Scale-in Operation
+    [Arguments]  ${ns}    ${vnf_member}    ${scaling_group}
+
+    ${rc}    ${nsr}=    Run and Return RC and Output    osm ns-show ${ns} --literal
+    ${scaled_vnf}=    Get Scaled Vnf    ${nsr}
+    log to console  Scaled VNF befor scale-in operation is ${scaled_vnf}
+    ${rc}   ${stdout}=      Run and Return RC and Output    osm vnf-scale --scale-in --scaling-group ${scaling_group} ${ns} ${vnf_member}
+    Should Be Equal As Integers    ${rc}    ${success_return_code}
+    log     ${stdout}
+    Sleep    1m    Waiting for scale-in operation to complete
+    ${rc}    ${nsr}=    Run and Return RC and Output    osm ns-show ${ns} --literal
+    ${scaled_vnf}=    Get Scaled Vnf    ${nsr}
+    log to console  Scaled VNF after scale-in operation is ${scaled_vnf}
+
+
+Perform VNF Scale-out Operation
+    [Arguments]  ${ns}    ${vnf_member}    ${scaling_group}
+
+    ${rc}    ${nsr}=    Run and Return RC and Output    osm ns-show ${ns} --literal
+    ${scaled_vnf}=    Get Scaled Vnf    ${nsr}
+    log to console  Scaled VNF befor scale-out operation is ${scaled_vnf}
+    ${rc}   ${stdout}=      Run and Return RC and Output    osm vnf-scale --scale-out --scaling-group ${scaling_group} ${ns} ${vnf_member}
+    Should Be Equal As Integers    ${rc}    ${success_return_code}
+    log     ${stdout}
+    Sleep    1m    Waiting for scale-out operation to complete
+    ${rc}    ${nsr}=    Run and Return RC and Output    osm ns-show ${ns} --literal
+    ${scaled_vnf}=    Get Scaled Vnf    ${nsr}
+    log to console  Scaled VNF befor scale-out operation is ${scaled_vnf}
diff --git a/robot-systest/lib/cli/osm_package_tools_lib.robot b/robot-systest/lib/cli/osm_package_tools_lib.robot
new file mode 100644
index 0000000..c8a864c
--- /dev/null
+++ b/robot-systest/lib/cli/osm_package_tools_lib.robot
@@ -0,0 +1,88 @@
+# All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+##
+
+## Change log:
+# 1. Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 18-Dec-2019
+##
+
+*** Keywords ***
+Create OSM NS Package
+    [Arguments]  ${pkg_name}
+    ${ns_pkg}=    Catenate	SEPARATOR=_     ${pkg_name}      ns
+    ${ns_yaml}=   Catenate	SEPARATOR=_     ${pkg_name}      nsd
+    ${ns_yaml}=   Catenate	SEPARATOR=.     ${ns_yaml}      yaml
+    ${nsd_path}=    Join Path    ${ns_pkg}    ${ns_yaml}
+    ${rc}   ${stdout}=      Run and Return RC and Output    osm package-create ns ${pkg_name}
+    Should Be Equal As Integers    ${rc}    ${success_return_code}
+    File Should Exist    ${nsd_path}
+    log  ${stdout}
+
+
+Create OSM VNF Package
+    [Arguments]  ${pkg_name}
+    ${vnf_pkg}=    Catenate    SEPARATOR=_     ${pkg_name}      vnf
+    ${vnf_yaml}=   Catenate	   SEPARATOR=_     ${pkg_name}      vnfd
+    ${vnf_yaml}=   Catenate	   SEPARATOR=.     ${vnf_yaml}      yaml
+    ${vnfd_path}=    Join Path    ${vnf_pkg}    ${vnf_yaml}
+    ${rc}   ${stdout}=      Run and Return RC and Output    osm package-create vnf ${pkg_name}
+    Should Be Equal As Integers    ${rc}    ${success_return_code}
+    File Should Exist    ${vnfd_path}
+    log  ${stdout}
+
+
+Validate OSM NS Package
+    [Arguments]  ${pkg_name}
+    ${ns_pkg}=    Catenate	SEPARATOR=_     ${pkg_name}      ns
+    ${rc}   ${stdout}=      Run and Return RC and Output    osm package-validate ${ns_pkg}
+    Should Be Equal As Integers    ${rc}    ${success_return_code}
+    Verify Package Validation Result    ${ns_pkg}
+    log  ${stdout}
+
+
+Validate OSM VNF Package
+    [Arguments]  ${pkg_name}
+    ${vnf_pkg}= 	Catenate	SEPARATOR=_     ${pkg_name}      vnf
+    ${rc}   ${stdout}=      Run and Return RC and Output    osm package-validate ${vnf_pkg}
+    Should Be Equal As Integers    ${rc}    ${success_return_code}
+    Verify Package Validation Result    ${vnf_pkg}
+    log  ${stdout}
+
+
+Verify Package Validation Result
+    [Arguments]  ${pkg}
+    ${rc}   ${stdout}=      Run and Return RC and Output    osm package-validate ${pkg} | awk 'NR==6{print $6}'
+    Should Be Equal As Integers    ${rc}    ${success_return_code}
+    Should Not Contain    ${stdout}    ERROR
+    log  ${stdout}
+
+
+Build OSM VNF Package
+    [Arguments]  ${pkg_name}
+    ${vnf_pkg}= 	Catenate	SEPARATOR=_     ${pkg_name}      vnf
+    ${vnf_pkg_tar}= 	Catenate	SEPARATOR=.     ${vnf_pkg}      tar    gz
+    ${rc}   ${stdout}=      Run and Return RC and Output    osm package-build ${vnf_pkg}
+    Should Be Equal As Integers    ${rc}    ${success_return_code}
+    File Should Exist    ${vnf_pkg_tar}
+    log  ${stdout}
+
+
+Build OSM NS Package
+    [Arguments]  ${pkg_name}
+    ${ns_pkg}= 	  Catenate	  SEPARATOR=_     ${pkg_name}      ns
+    ${ns_pkg_tar}= 	  Catenate	  SEPARATOR=.     ${ns_pkg}      tar    gz
+    ${rc}   ${stdout}=      Run and Return RC and Output    osm package-build ${ns_pkg}
+    Should Be Equal As Integers    ${rc}    ${success_return_code}
+    File Should Exist    ${ns_pkg_tar}
+    log  ${stdout}
diff --git a/robot-systest/lib/cli/vim_account_lib.robot b/robot-systest/lib/cli/vim_account_lib.robot
index 8d01b39..c3c8242 100644
--- a/robot-systest/lib/cli/vim_account_lib.robot
+++ b/robot-systest/lib/cli/vim_account_lib.robot
@@ -63,8 +63,9 @@
 
 Delete Vim Account
     [Documentation]  delete vim account details
+    [Arguments]  ${vim_name}=${vim-name}
 
-    ${rc}   ${stdout}=      Run and Return RC and Output	    osm vim-delete ${vim-name}
+    ${rc}   ${stdout}=      Run and Return RC and Output	    osm vim-delete ${vim_name}
     log  ${stdout}
     Should Be Equal As Integers 	${rc}    ${success_return_code}