From: beierlm Date: Fri, 23 Oct 2020 18:54:56 +0000 (-0400) Subject: Merge branch 'v8.0' X-Git-Tag: release-v9.0-start~50 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=b1a1c46a60aa4981c7b01e9d6ff95958db7749a5;hp=c52339680d17351fd5c873d82292d4c63af81c70;p=osm%2Fdevops.git Merge branch 'v8.0' Change-Id: I96d3bae3abca7b2a5f66bca591b4358d6c921f3d Signed-off-by: beierlm --- diff --git a/docker/Keystone/Dockerfile b/docker/Keystone/Dockerfile index 3880e96d..c3ab344c 100644 --- a/docker/Keystone/Dockerfile +++ b/docker/Keystone/Dockerfile @@ -61,8 +61,10 @@ ENV SERVICE_PROJECT service # ldap # ENV LDAP_AUTHENTICATION_DOMAIN_NAME no default # ENV LDAP_URL ldap://localhost -# ENV LDAP_BIND_USER no defauslt +# ENV LDAP_BIND_USER no default # ENV LDAP_BIND_PASSWORD no default +# ENV LDAP_CHASE_REFERRALS no default +# ENV LDAP_PAGE_SIZE 0 # ENV LDAP_USER_TREE_DN no default # ENV LDAP_USER_OBJECTCLASS inetOrgPerson # ENV LDAP_USER_ID_ATTRIBUTE cn @@ -73,6 +75,8 @@ ENV SERVICE_PROJECT service # ENV LDAP_USER_ENABLED_MASK 0 # ENV LDAP_USER_ENABLED_DEFAULT true # ENV LDAP_USER_ENABLED_INVERT false +# ENV LDAP_GROUP_OBJECTCLASS groupOfNames +# ENV LDAP_GROUP_TREE_DN no default # ENV LDAP_USE_STARTTLS false # ENV LDAP_TLS_CACERT_BASE64 no default # ENV LDAP_TLS_REQ_CERT demand diff --git a/docker/Keystone/scripts/start.sh b/docker/Keystone/scripts/start.sh index 78c7820a..0e7af80e 100755 --- a/docker/Keystone/scripts/start.sh +++ b/docker/Keystone/scripts/start.sh @@ -123,6 +123,12 @@ EOF if [ $LDAP_BIND_PASSWORD ]; then echo "password = $LDAP_BIND_PASSWORD" >> /etc/keystone/domains/keystone.$LDAP_AUTHENTICATION_DOMAIN_NAME.conf fi + if [ $LDAP_CHASE_REFERRALS ]; then + echo "chase_referrals = $LDAP_CHASE_REFERRALS" >> /etc/keystone/domains/keystone.$LDAP_AUTHENTICATION_DOMAIN_NAME.conf + fi + if [ $LDAP_PAGE_SIZE ]; then + echo "page_size = $LDAP_PAGE_SIZE" >> /etc/keystone/domains/keystone.$LDAP_AUTHENTICATION_DOMAIN_NAME.conf + fi if [ $LDAP_USER_TREE_DN ]; then echo "user_tree_dn = $LDAP_USER_TREE_DN" >> /etc/keystone/domains/keystone.$LDAP_AUTHENTICATION_DOMAIN_NAME.conf fi @@ -153,6 +159,12 @@ EOF if [ $LDAP_USER_ENABLED_INVERT ]; then echo "user_enabled_invert = $LDAP_USER_ENABLED_INVERT" >> /etc/keystone/domains/keystone.$LDAP_AUTHENTICATION_DOMAIN_NAME.conf fi + if [ $LDAP_GROUP_OBJECTCLASS ]; then + echo "group_objectclass = $LDAP_GROUP_OBJECTCLASS" >> /etc/keystone/domains/keystone.$LDAP_AUTHENTICATION_DOMAIN_NAME.conf + fi + if [ $LDAP_GROUP_TREE_DN ]; then + echo "group_tree_dn = $LDAP_GROUP_TREE_DN" >> /etc/keystone/domains/keystone.$LDAP_AUTHENTICATION_DOMAIN_NAME.conf + fi if [ $LDAP_USE_STARTTLS ] && [ "$LDAP_USE_STARTTLS" == "true" ]; then echo "use_tls = true" >> /etc/keystone/domains/keystone.$LDAP_AUTHENTICATION_DOMAIN_NAME.conf mkdir -p /etc/keystone/ssl/certs/ diff --git a/installers/charm/build.sh b/installers/charm/build.sh index 17eea948..1c017ba1 100755 --- a/installers/charm/build.sh +++ b/installers/charm/build.sh @@ -1,3 +1,4 @@ +#!/bin/bash # Copyright 2020 Canonical Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,8 +12,9 @@ # 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. -#!/bin/bash + set -eux + function build() { cd $1 && tox -e build && cd .. } @@ -23,3 +25,6 @@ build 'nbi-k8s' build 'pol-k8s' build 'ro-k8s' build 'ui-k8s' +build 'keystone' +build 'ng-ui' +build 'pla' \ No newline at end of file diff --git a/installers/charm/bundles/osm-ha/bundle.yaml b/installers/charm/bundles/osm-ha/bundle.yaml index ea3d7a14..f60082e0 100644 --- a/installers/charm/bundles/osm-ha/bundle.yaml +++ b/installers/charm/bundles/osm-ha/bundle.yaml @@ -82,7 +82,7 @@ applications: gui-x: 0 gui-y: 50 nbi-k8s: - charm: "cs:~charmed-osm/nbi-k8s" + charm: "%(prefix)s/nbi-k8s%(suffix)s" channel: "%(channel)s" scale: 3 series: kubernetes @@ -91,11 +91,12 @@ applications: options: log_level: "INFO" DATABASE_COMMONKEY: osm + auth-backend: keystone annotations: gui-x: 0 gui-y: -200 ro-k8s: - charm: "cs:~charmed-osm/ro-k8s" + charm: "%(prefix)s/ro-k8s%(suffix)s" channel: "%(channel)s" scale: 3 series: kubernetes @@ -109,7 +110,7 @@ applications: gui-x: -250 gui-y: 300 ui-k8s: - charm: "cs:~charmed-osm/ui-k8s" + charm: "%(prefix)s/ui-k8s%(suffix)s" channel: "%(channel)s" scale: 3 series: kubernetes @@ -132,7 +133,7 @@ applications: gui-x: 500 gui-y: 100 lcm-k8s: - charm: "cs:~charmed-osm/lcm-k8s" + charm: "%(prefix)s/lcm-k8s%(suffix)s" channel: "%(channel)s" scale: 3 series: kubernetes @@ -151,7 +152,7 @@ applications: gui-x: -250 gui-y: 50 mon-k8s: - charm: "cs:~charmed-osm/mon-k8s" + charm: "%(prefix)s/mon-k8s%(suffix)s" channel: "%(channel)s" scale: 3 series: kubernetes @@ -173,7 +174,7 @@ applications: gui-x: 250 gui-y: 50 pol-k8s: - charm: "cs:~charmed-osm/pol-k8s" + charm: "%(prefix)s/pol-k8s%(suffix)s" channel: "%(channel)s" scale: 3 series: kubernetes @@ -214,6 +215,14 @@ applications: annotations: gui-x: 250 gui-y: 550 + keystone: + charm: '%(prefix)s/keystone%(suffix)s' + channel: '%(channel)s' + scale: 1 + series: kubernetes + annotations: + gui-x: -250 + gui-y: 550 relations: - - "kafka-k8s:zookeeper" @@ -254,3 +263,7 @@ relations: - "mongodb-k8s:mongo" - - 'ng-ui:nbi' - 'nbi-k8s:nbi' + - - 'keystone:db' + - 'mariadb-k8s:mysql' + - - 'keystone:keystone' + - 'nbi-k8s:keystone' diff --git a/installers/charm/bundles/osm/bundle.yaml b/installers/charm/bundles/osm/bundle.yaml index c4567aca..a3ac4085 100644 --- a/installers/charm/bundles/osm/bundle.yaml +++ b/installers/charm/bundles/osm/bundle.yaml @@ -91,6 +91,7 @@ applications: options: log_level: "INFO" DATABASE_COMMONKEY: osm + auth-backend: keystone annotations: gui-x: 0 gui-y: -200 @@ -214,6 +215,14 @@ applications: annotations: gui-x: 250 gui-y: 550 + keystone: + charm: '%(prefix)s/keystone%(suffix)s' + channel: '%(channel)s' + scale: 1 + series: kubernetes + annotations: + gui-x: -250 + gui-y: 550 relations: - - "kafka-k8s:zookeeper" @@ -254,3 +263,7 @@ relations: - "mongodb-k8s:mongo" - - 'ng-ui:nbi' - 'nbi-k8s:nbi' + - - 'keystone:db' + - 'mariadb-k8s:mysql' + - - 'keystone:keystone' + - 'nbi-k8s:keystone' diff --git a/installers/charm/interfaces/keystone/interface.yaml b/installers/charm/interfaces/keystone/interface.yaml new file mode 100644 index 00000000..be1d09bd --- /dev/null +++ b/installers/charm/interfaces/keystone/interface.yaml @@ -0,0 +1,16 @@ +# Copyright 2020 Canonical Ltd. +# +# 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. +name: keystone +summary: Keystone Interface +version: 1 diff --git a/installers/charm/interfaces/keystone/provides.py b/installers/charm/interfaces/keystone/provides.py new file mode 100644 index 00000000..bda5d2f4 --- /dev/null +++ b/installers/charm/interfaces/keystone/provides.py @@ -0,0 +1,63 @@ +# Copyright 2020 Canonical Ltd. +# +# 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. +from charms.reactive import Endpoint +from charms.reactive import when +from charms.reactive import set_flag, clear_flag + + +class KeystoneProvides(Endpoint): + @when("endpoint.{endpoint_name}.joined") + def _joined(self): + set_flag(self.expand_name("{endpoint_name}.joined")) + + @when("endpoint.{endpoint_name}.changed") + def _changed(self): + set_flag(self.expand_name("{endpoint_name}.ready")) + + @when("endpoint.{endpoint_name}.departed") + def _departed(self): + set_flag(self.expand_name("{endpoint_name}.departed")) + clear_flag(self.expand_name("{endpoint_name}.joined")) + + def publish_info( + self, + host, + port, + keystone_db_password, + region_id, + user_domain_name, + project_domain_name, + admin_username, + admin_password, + admin_project_name, + username, + password, + service, + ): + for relation in self.relations: + relation.to_publish["host"] = host + relation.to_publish["port"] = port + relation.to_publish["keystone_db_password"] = keystone_db_password + relation.to_publish["region_id"] = region_id + relation.to_publish["user_domain_name"] = user_domain_name + relation.to_publish["project_domain_name"] = project_domain_name + relation.to_publish["admin_username"] = admin_username + relation.to_publish["admin_password"] = admin_password + relation.to_publish["admin_project_name"] = admin_project_name + relation.to_publish["username"] = username + relation.to_publish["password"] = password + relation.to_publish["service"] = service + + def mark_complete(self): + clear_flag(self.expand_name("{endpoint_name}.joined")) diff --git a/installers/charm/interfaces/keystone/requires.py b/installers/charm/interfaces/keystone/requires.py new file mode 100644 index 00000000..c0d8d473 --- /dev/null +++ b/installers/charm/interfaces/keystone/requires.py @@ -0,0 +1,72 @@ +# Copyright 2020 Canonical Ltd. +# +# 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. +from charms.reactive import Endpoint +from charms.reactive import when +from charms.reactive import set_flag, clear_flag + + +class KeystoneRequires(Endpoint): + @when("endpoint.{endpoint_name}.joined") + def _joined(self): + set_flag(self.expand_name("{endpoint_name}.joined")) + + @when("endpoint.{endpoint_name}.changed") + def _changed(self): + if len(self.keystones()) > 0: + set_flag(self.expand_name("{endpoint_name}.ready")) + else: + clear_flag(self.expand_name("{endpoint_name}.ready")) + + @when("endpoint.{endpoint_name}.departed") + def _departed(self): + set_flag(self.expand_name("{endpoint_name}.departed")) + clear_flag(self.expand_name("{endpoint_name}.joined")) + clear_flag(self.expand_name("{endpoint_name}.ready")) + + def keystones(self): + """ + Return Keystone Data: + [{ + 'host': , + 'port': , + 'keystone_db_password: , + 'region_id: , + 'admin_username: , + 'admin_password: , + 'admin_project_name: , + 'username: , + 'password: , + 'service: + }] + """ + keystones = [] + for relation in self.relations: + for unit in relation.units: + data = { + "host": unit.received["host"], + "port": unit.received["port"], + "keystone_db_password": unit.received["keystone_db_password"], + "region_id": unit.received["region_id"], + "user_domain_name": unit.received["user_domain_name"], + "project_domain_name": unit.received["project_domain_name"], + "admin_username": unit.received["admin_username"], + "admin_password": unit.received["admin_password"], + "admin_project_name": unit.received["admin_project_name"], + "username": unit.received["username"], + "password": unit.received["password"], + "service": unit.received["service"], + } + if all(data.values()): + keystones.append(data) + return keystones diff --git a/installers/charm/keystone/.gitignore b/installers/charm/keystone/.gitignore new file mode 100644 index 00000000..97fc8b44 --- /dev/null +++ b/installers/charm/keystone/.gitignore @@ -0,0 +1,17 @@ +# Copyright 2020 Canonical Ltd. +# +# 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. +.vscode +.tox +build +keystone.charm \ No newline at end of file diff --git a/installers/charm/keystone/.yamllint.yaml b/installers/charm/keystone/.yamllint.yaml new file mode 100644 index 00000000..08ab437b --- /dev/null +++ b/installers/charm/keystone/.yamllint.yaml @@ -0,0 +1,25 @@ +# Copyright 2020 Canonical Ltd. +# +# 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. +--- +extends: default + +yaml-files: + - "*.yaml" + - "*.yml" + - ".yamllint" +ignore: | + .tox + build/ + mod/ + lib/ diff --git a/installers/charm/keystone/README.md b/installers/charm/keystone/README.md new file mode 100644 index 00000000..1ca9764c --- /dev/null +++ b/installers/charm/keystone/README.md @@ -0,0 +1,17 @@ + +# Keystone operator Charm for Kubernetes + +## Requirements + diff --git a/installers/charm/keystone/config.yaml b/installers/charm/keystone/config.yaml new file mode 100644 index 00000000..06ea0603 --- /dev/null +++ b/installers/charm/keystone/config.yaml @@ -0,0 +1,252 @@ +# Copyright 2020 Canonical Ltd. +# +# 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. +options: + image: + type: string + default: opensourcemano/keystone:latest + description: The docker image to install. + image_username: + type: string + description: | + The username for accessing the registry specified in image. + default: "" + image_password: + type: string + description: | + The password associated with image_username for accessing + the registry specified in image. + default: "" + max_file_size: + type: int + description: | + The maximum file size, in megabytes. + + If there is a reverse proxy in front of Keystone, it may + need to be configured to handle the requested size. + default: 5 + ingress_whitelist_source_range: + type: string + description: | + A comma-separated list of CIDRs to store in the + ingress.kubernetes.io/whitelist-source-range annotation. + + This can be used to lock down access to + Keystone based on source IP address. + default: "" + tls_secret_name: + type: string + description: TLS Secret name + default: "" + site_url: + type: string + description: Ingress URL + default: "" + region_id: + type: string + description: Region ID to be created when starting the service + default: RegionOne + keystone_db_password: + type: string + description: Keystone DB Password + default: admin + admin_username: + type: string + description: Admin username to be created when starting the service + default: admin + admin_password: + type: string + description: Admin password to be created when starting the service + default: admin + admin_project: + type: string + description: Admin project to be created when starting the service + default: admin + service_username: + type: string + description: Service Username to be created when starting the service + default: nbi + service_password: + type: string + description: Service Password to be created when starting the service + default: nbi + service_project: + type: string + description: Service Project to be created when starting the service + default: service + user_domain_name: + type: string + description: User domain name (Hardcoded in the container start.sh script) + default: default + project_domain_name: + type: string + description: | + Project domain name (Hardcoded in the container start.sh script) + default: default + token_expiration: + type: int + description: Token keys expiration in seconds + default: 172800 + ldap_enabled: + type: boolean + description: Boolean to enable/disable LDAP authentication + default: false + ldap_authentication_domain_name: + type: string + description: Name of the domain which use LDAP authentication + default: "" + ldap_url: + type: string + description: URL of the LDAP server + default: "ldap://localhost" + ldap_bind_user: + type: string + description: User to bind and search for users + default: "" + ldap_bind_password: + type: string + description: Password to bind and search for users + default: "" + ldap_chase_referrals: + type: string + description: | + Sets keystone’s referral chasing behavior across directory partitions. + If left unset, the system’s default behavior will be used. + default: "" + ldap_page_size: + type: int + description: | + Defines the maximum number of results per page that keystone should + request from the LDAP server when listing objects. A value of zero (0) + disables paging. + default: 0 + ldap_user_tree_dn: + type: string + description: | + Root of the tree in LDAP server in which Keystone will search for users + default: "" + ldap_user_objectclass: + type: string + description: | + LDAP object class that Keystone will filter on within user_tree_dn to + find user objects. Any objects of other classes will be ignored. + default: inetOrgPerson + ldap_user_id_attribute: + type: string + description: | + This set of options define the mapping to LDAP attributes for the three + key user attributes supported by Keystone. The LDAP attribute chosen for + user_id must be something that is immutable for a user and no more than + 64 characters in length. Notice that Distinguished Name (DN) may be + longer than 64 characters and thus is not suitable. An uid, or mail may + be appropriate. + default: cn + ldap_user_name_attribute: + type: string + description: | + This set of options define the mapping to LDAP attributes for the three + key user attributes supported by Keystone. The LDAP attribute chosen for + user_id must be something that is immutable for a user and no more than + 64 characters in length. Notice that Distinguished Name (DN) may be + longer than 64 characters and thus is not suitable. An uid, or mail may + be appropriate. + default: sn + ldap_user_pass_attribute: + type: string + description: | + This set of options define the mapping to LDAP attributes for the three + key user attributes supported by Keystone. The LDAP attribute chosen for + user_id must be something that is immutable for a user and no more than + 64 characters in length. Notice that Distinguished Name (DN) may be + longer than 64 characters and thus is not suitable. An uid, or mail may + be appropriate. + default: userPassword + ldap_user_filter: + type: string + description: | + This filter option allow additional filter (over and above + user_objectclass) to be included into the search of user. One common use + of this is to provide more efficient searching, where the recommended + search for user objects is (&(objectCategory=person)(objectClass=user)). + By specifying user_objectclass as user and user_filter as + objectCategory=person in the Keystone configuration file, this can be + achieved. + default: "" + ldap_user_enabled_attribute: + type: string + description: | + In Keystone, a user entity can be either enabled or disabled. Setting + the above option will give a mapping to an equivalent attribute in LDAP, + allowing your LDAP management tools to disable a user. + default: enabled + ldap_user_enabled_mask: + type: int + description: | + Some LDAP schemas, rather than having a dedicated attribute for user + enablement, use a bit within a general control attribute (such as + userAccountControl) to indicate this. Setting user_enabled_mask will + cause Keystone to look at only the status of this bit in the attribute + specified by user_enabled_attribute, with the bit set indicating the + user is enabled. + default: 0 + ldap_user_enabled_default: + type: boolean + description: | + Most LDAP servers use a boolean or bit in a control field to indicate + enablement. However, some schemas might use an integer value in an + attribute. In this situation, set user_enabled_default to the integer + value that represents a user being enabled. + default: true + ldap_user_enabled_invert: + type: boolean + description: | + Some LDAP schemas have an “account locked” attribute, which is the + equivalent to account being “disabled.” In order to map this to the + Keystone enabled attribute, you can utilize the user_enabled_invert + setting in conjunction with user_enabled_attribute to map the lock + status to disabled in Keystone. + default: false + ldap_group_objectclass: + type: string + description: The LDAP object class to use for groups. + default: groupOfNames + ldap_group_tree_dn: + type: string + description: The search base to use for groups. + default: "" + ldap_use_starttls: + type: boolean + description: | + Enable Transport Layer Security (TLS) for providing a secure connection + from Keystone to LDAP (StartTLS, not LDAPS). + default: false + ldap_tls_cacert_base64: + type: string + description: | + CA certificate in Base64 format (if you have the PEM file, text inside + "-----BEGIN CERTIFICATE-----"/"-----END CERTIFICATE-----" tags). + default: "" + ldap_tls_req_cert: + type: string + description: | + Defines how the certificates are checked for validity in the client + (i.e., Keystone end) of the secure connection (this doesn’t affect what + level of checking the server is doing on the certificates it receives + from Keystone). Possible values are "demand", "never", and "allow". The + default of demand means the client always checks the certificate and + will drop the connection if it is not provided or invalid. never is the + opposite—it never checks it, nor requires it to be provided. allow means + that if it is not provided then the connection is allowed to continue, + but if it is provided it will be checked—and if invalid, the connection + will be dropped. + default: demand diff --git a/installers/charm/keystone/metadata.yaml b/installers/charm/keystone/metadata.yaml new file mode 100644 index 00000000..c04c121d --- /dev/null +++ b/installers/charm/keystone/metadata.yaml @@ -0,0 +1,30 @@ +# Copyright 2020 Canonical Ltd. +# +# 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. +name: keystone +summary: A Keystone K8s charm +description: | + A CAAS charm to deploy Keystone +series: + - kubernetes +min-juju-version: 2.8.0 +requires: + db: + interface: mysql + limit: 1 +provides: + keystone: + interface: keystone +deployment: + type: stateless + service: cluster diff --git a/installers/charm/keystone/requirements.txt b/installers/charm/keystone/requirements.txt new file mode 100644 index 00000000..5a4c0afd --- /dev/null +++ b/installers/charm/keystone/requirements.txt @@ -0,0 +1,15 @@ +# Copyright 2020 Canonical Ltd. +# +# 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. +cryptography +ops diff --git a/installers/charm/keystone/src/charm.py b/installers/charm/keystone/src/charm.py new file mode 100755 index 00000000..ef16690a --- /dev/null +++ b/installers/charm/keystone/src/charm.py @@ -0,0 +1,441 @@ +#!/usr/bin/env python3 +# Copyright 2020 Canonical Ltd. +# +# 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. + +import json +import logging +from datetime import datetime +from typing import ( + Any, + Dict, + List, + NoReturn, + Tuple, +) +from urllib.parse import urlparse + +from cryptography.fernet import Fernet + +from ops.charm import CharmBase, EventBase +from ops.framework import StoredState +from ops.main import main +from ops.model import ( + ActiveStatus, + BlockedStatus, + # MaintenanceStatus, + WaitingStatus, + # ModelError, +) + +LOGGER = logging.getLogger(__name__) + +REQUIRED_SETTINGS = [] + +# This is hardcoded in the keystone container script +DATABASE_NAME = "keystone" + +# We expect the keystone container to use the default port +KEYSTONE_PORT = 5000 + +# Number of keys need might need to be adjusted in the future +NUMBER_FERNET_KEYS = 2 +NUMBER_CREDENTIAL_KEYS = 2 + +# Path for keys +CREDENTIAL_KEYS_PATH = "/etc/keystone/credential-keys" +FERNET_KEYS_PATH = "/etc/keystone/fernet-keys" + + +class KeystoneCharm(CharmBase): + """Keystone K8s Charm""" + + state = StoredState() + + def __init__(self, *args) -> NoReturn: + """Constructor of the Charm object. + Initializes internal state and register events it can handle. + """ + super().__init__(*args) + self.state.set_default(db_host=None) + self.state.set_default(db_port=None) + self.state.set_default(db_user=None) + self.state.set_default(db_password=None) + self.state.set_default(pod_spec=None) + self.state.set_default(fernet_keys=None) + self.state.set_default(credential_keys=None) + self.state.set_default(keys_timestamp=0) + + # Register all of the events we want to observe + self.framework.observe(self.on.config_changed, self.configure_pod) + self.framework.observe(self.on.start, self.configure_pod) + self.framework.observe(self.on.upgrade_charm, self.configure_pod) + self.framework.observe(self.on.leader_elected, self.configure_pod) + self.framework.observe(self.on.update_status, self.configure_pod) + + # Register relation events + self.framework.observe( + self.on.db_relation_changed, self._on_db_relation_changed + ) + self.framework.observe( + self.on.keystone_relation_joined, self._publish_keystone_info + ) + + def _publish_keystone_info(self, event: EventBase) -> NoReturn: + """Publishes keystone information for NBI usage through the keystone + relation. + + Args: + event (EventBase): Keystone relation event to update NBI. + """ + config = self.model.config + if self.unit.is_leader(): + rel_data = { + "host": f"http://{self.app.name}:{KEYSTONE_PORT}/v3", + "port": str(KEYSTONE_PORT), + "keystone_db_password": config["keystone_db_password"], + "region_id": config["region_id"], + "user_domain_name": config["user_domain_name"], + "project_domain_name": config["project_domain_name"], + "admin_username": config["admin_username"], + "admin_password": config["admin_password"], + "admin_project_name": config["admin_project"], + "username": config["service_username"], + "password": config["service_password"], + "service": config["service_project"], + } + for k, v in rel_data.items(): + event.relation.data[self.model.unit][k] = v + + def _on_db_relation_changed(self, event: EventBase) -> NoReturn: + """Reads information about the DB relation, in order for keystone to + access it. + + Args: + event (EventBase): DB relation event to access database + information. + """ + self.state.db_host = event.relation.data[event.unit].get("host") + self.state.db_port = event.relation.data[event.unit].get("port", 3306) + self.state.db_user = "root" # event.relation.data[event.unit].get("user") + self.state.db_password = event.relation.data[event.unit].get("root_password") + if self.state.db_host: + self.configure_pod(event) + + def _check_settings(self) -> str: + """Check if there any settings missing from Keystone configuration. + + Returns: + str: Information about the problems found (if any). + """ + problems = [] + config = self.model.config + + for setting in REQUIRED_SETTINGS: + if not config.get(setting): + problem = f"missing config {setting}" + problems.append(problem) + + return ";".join(problems) + + def _make_pod_image_details(self) -> Dict[str, str]: + """Generate the pod image details. + + Returns: + Dict[str, str]: pod image details. + """ + config = self.model.config + image_details = { + "imagePath": config["image"], + } + if config["image_username"]: + image_details.update( + { + "username": config["image_username"], + "password": config["image_password"], + } + ) + return image_details + + def _make_pod_ports(self) -> List[Dict[str, Any]]: + """Generate the pod ports details. + + Returns: + List[Dict[str, Any]]: pod ports details. + """ + return [ + {"name": "keystone", "containerPort": KEYSTONE_PORT, "protocol": "TCP"}, + ] + + def _make_pod_envconfig(self) -> Dict[str, Any]: + """Generate pod environment configuraiton. + + Returns: + Dict[str, Any]: pod environment configuration. + """ + config = self.model.config + + envconfig = { + "DB_HOST": self.state.db_host, + "DB_PORT": self.state.db_port, + "ROOT_DB_USER": self.state.db_user, + "ROOT_DB_PASSWORD": self.state.db_password, + "KEYSTONE_DB_PASSWORD": config["keystone_db_password"], + "REGION_ID": config["region_id"], + "KEYSTONE_HOST": self.app.name, + "ADMIN_USERNAME": config["admin_username"], + "ADMIN_PASSWORD": config["admin_password"], + "ADMIN_PROJECT": config["admin_project"], + "SERVICE_USERNAME": config["service_username"], + "SERVICE_PASSWORD": config["service_password"], + "SERVICE_PROJECT": config["service_project"], + } + + if config.get("ldap_enabled"): + envconfig["LDAP_AUTHENTICATION_DOMAIN_NAME"] = config[ + "ldap_authentication_domain_name" + ] + envconfig["LDAP_URL"] = config["ldap_url"] + envconfig["LDAP_PAGE_SIZE"] = config["ldap_page_size"] + envconfig["LDAP_USER_OBJECTCLASS"] = config["ldap_user_objectclass"] + envconfig["LDAP_USER_ID_ATTRIBUTE"] = config["ldap_user_id_attribute"] + envconfig["LDAP_USER_NAME_ATTRIBUTE"] = config["ldap_user_name_attribute"] + envconfig["LDAP_USER_PASS_ATTRIBUTE"] = config["ldap_user_pass_attribute"] + envconfig["LDAP_USER_ENABLED_MASK"] = config["ldap_user_enabled_mask"] + envconfig["LDAP_USER_ENABLED_DEFAULT"] = config["ldap_user_enabled_default"] + envconfig["LDAP_USER_ENABLED_INVERT"] = config["ldap_user_enabled_invert"] + envconfig["LDAP_GROUP_OBJECTCLASS"] = config["ldap_group_objectclass"] + + if config["ldap_bind_user"]: + envconfig["LDAP_BIND_USER"] = config["ldap_bind_user"] + + if config["ldap_bind_password"]: + envconfig["LDAP_BIND_PASSWORD"] = config["ldap_bind_password"] + + if config["ldap_user_tree_dn"]: + envconfig["LDAP_USER_TREE_DN"] = config["ldap_user_tree_dn"] + + if config["ldap_user_filter"]: + envconfig["LDAP_USER_FILTER"] = config["ldap_user_filter"] + + if config["ldap_user_enabled_attribute"]: + envconfig["LDAP_USER_ENABLED_ATTRIBUTE"] = config[ + "ldap_user_enabled_attribute" + ] + + if config["ldap_chase_referrals"]: + envconfig["LDAP_CHASE_REFERRALS"] = config["ldap_chase_referrals"] + + if config["ldap_group_tree_dn"]: + envconfig["LDAP_GROUP_TREE_DN"] = config["ldap_group_tree_dn"] + + if config["ldap_use_starttls"]: + envconfig["LDAP_USE_STARTTLS"] = config["ldap_use_starttls"] + envconfig["LDAP_TLS_CACERT_BASE64"] = config["ldap_tls_cacert_base64"] + envconfig["LDAP_TLS_REQ_CERT"] = config["ldap_tls_req_cert"] + + return envconfig + + def _make_pod_ingress_resources(self) -> List[Dict[str, Any]]: + """Generate pod ingress resources. + + Returns: + List[Dict[str, Any]]: pod ingress resources. + """ + site_url = self.model.config["site_url"] + + if not site_url: + return + + parsed = urlparse(site_url) + + if not parsed.scheme.startswith("http"): + return + + max_file_size = self.model.config["max_file_size"] + ingress_whitelist_source_range = self.model.config[ + "ingress_whitelist_source_range" + ] + + annotations = { + "nginx.ingress.kubernetes.io/proxy-body-size": "{}m".format(max_file_size) + } + + if ingress_whitelist_source_range: + annotations[ + "nginx.ingress.kubernetes.io/whitelist-source-range" + ] = ingress_whitelist_source_range + + ingress_spec_tls = None + + if parsed.scheme == "https": + ingress_spec_tls = [{"hosts": [parsed.hostname]}] + tls_secret_name = self.model.config["tls_secret_name"] + if tls_secret_name: + ingress_spec_tls[0]["secretName"] = tls_secret_name + else: + annotations["nginx.ingress.kubernetes.io/ssl-redirect"] = "false" + + ingress = { + "name": "{}-ingress".format(self.app.name), + "annotations": annotations, + "spec": { + "rules": [ + { + "host": parsed.hostname, + "http": { + "paths": [ + { + "path": "/", + "backend": { + "serviceName": self.app.name, + "servicePort": KEYSTONE_PORT, + }, + } + ] + }, + } + ], + }, + } + if ingress_spec_tls: + ingress["spec"]["tls"] = ingress_spec_tls + + return [ingress] + + def _generate_keys(self) -> Tuple[List[str], List[str]]: + """Generating new fernet tokens. + + Returns: + Tuple[List[str], List[str]]: contains two lists of strings. First + list contains strings that represent + the keys for fernet and the second + list contains strins that represent + the keys for credentials. + """ + fernet_keys = [ + Fernet.generate_key().decode() for _ in range(NUMBER_FERNET_KEYS) + ] + credential_keys = [ + Fernet.generate_key().decode() for _ in range(NUMBER_CREDENTIAL_KEYS) + ] + + return (fernet_keys, credential_keys) + + def _make_pod_files( + self, fernet_keys: List[str], credential_keys: List[str] + ) -> List[Dict[str, Any]]: + """Generating ConfigMap information. + + Args: + fernet_keys (List[str]): keys for fernet. + credential_keys (List[str]): keys for credentials. + + Returns: + List[Dict[str, Any]]: ConfigMap information. + """ + files = [ + { + "name": "fernet-keys", + "mountPath": FERNET_KEYS_PATH, + "files": [ + {"path": str(key_id), "content": value} + for (key_id, value) in enumerate(fernet_keys) + ], + } + ] + + files.append( + { + "name": "credential-keys", + "mountPath": CREDENTIAL_KEYS_PATH, + "files": [ + {"path": str(key_id), "content": value} + for (key_id, value) in enumerate(credential_keys) + ], + } + ) + + return files + + def configure_pod(self, event: EventBase) -> NoReturn: + """Assemble the pod spec and apply it, if possible. + + Args: + event (EventBase): Hook or Relation event that started the + function. + """ + if not self.state.db_host: + self.unit.status = WaitingStatus("Waiting for database relation") + event.defer() + return + + if not self.unit.is_leader(): + self.unit.status = ActiveStatus("ready") + return + + if fernet_keys := self.state.fernet_keys: + fernet_keys = json.loads(fernet_keys) + + if credential_keys := self.state.credential_keys: + credential_keys = json.loads(credential_keys) + + now = datetime.now().timestamp() + keys_timestamp = self.state.keys_timestamp + token_expiration = self.model.config["token_expiration"] + + valid_keys = (now - keys_timestamp) < token_expiration + if not credential_keys or not fernet_keys or not valid_keys: + fernet_keys, credential_keys = self._generate_keys() + self.state.fernet_keys = json.dumps(fernet_keys) + self.state.credential_keys = json.dumps(credential_keys) + self.state.keys_timestamp = now + + # Check problems in the settings + problems = self._check_settings() + if problems: + self.unit.status = BlockedStatus(problems) + return + + self.unit.status = BlockedStatus("Assembling pod spec") + image_details = self._make_pod_image_details() + ports = self._make_pod_ports() + env_config = self._make_pod_envconfig() + ingress_resources = self._make_pod_ingress_resources() + files = self._make_pod_files(fernet_keys, credential_keys) + + pod_spec = { + "version": 3, + "containers": [ + { + "name": self.framework.model.app.name, + "imageDetails": image_details, + "ports": ports, + "envConfig": env_config, + "volumeConfig": files, + } + ], + "kubernetesResources": {"ingressResources": ingress_resources or []}, + } + + if self.state.pod_spec != ( + pod_spec_json := json.dumps(pod_spec, sort_keys=True) + ): + self.state.pod_spec = pod_spec_json + self.model.pod.set_spec(pod_spec) + + self.unit.status = ActiveStatus("ready") + + +if __name__ == "__main__": + main(KeystoneCharm) diff --git a/installers/charm/keystone/tox.ini b/installers/charm/keystone/tox.ini new file mode 100644 index 00000000..cff5193b --- /dev/null +++ b/installers/charm/keystone/tox.ini @@ -0,0 +1,47 @@ +# Copyright 2020 Canonical Ltd. +# +# 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. +[tox] +envlist = pep8 +skipsdist = True + +[testenv] +setenv = VIRTUAL_ENV={envdir} + PYTHONHASHSEED=0 +install_command = + pip install {opts} {packages} + +[testenv:build] +basepython = python3 +passenv=HTTP_PROXY HTTPS_PROXY NO_PROXY +whitelist_externals = charmcraft + rm + unzip +commands = + rm -rf release + charmcraft build + unzip keystone.charm -d release + +[testenv:lint] +basepython = python3 +deps = + black + yamllint + flake8 +commands = + black --check --diff . --exclude "build/|.tox/|mod/|lib/" + yamllint . + flake8 . --max-line-length=100 --exclude "build/ .tox/ mod/ lib/" + +[testenv:venv] +commands = {posargs} diff --git a/installers/charm/lcm-k8s/reactive/lcm.py b/installers/charm/lcm-k8s/reactive/lcm.py index 3ada8cb2..1cb46610 100644 --- a/installers/charm/lcm-k8s/reactive/lcm.py +++ b/installers/charm/lcm-k8s/reactive/lcm.py @@ -11,17 +11,23 @@ # 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. -from charms.layer.caas_base import pod_spec_set -from charms.reactive import endpoint_from_flag -from charms.reactive import when, when_not, hook -from charms.reactive.flags import set_flag, clear_flag +import logging +import yaml + from charmhelpers.core.hookenv import ( log, metadata, config, ) from charms import layer -import yaml +from charms.layer.caas_base import pod_spec_set +from charms.reactive import endpoint_from_flag +from charms.reactive import when, when_not, hook +from charms.reactive.flags import set_flag, clear_flag + + +logger = logging.getLogger(__name__) + @hook("upgrade-charm") @when("leadership.is_leader") @@ -37,18 +43,21 @@ def restart(): @when_not("kafka.ready") @when_not("lcm-k8s.configured") +@when("leadership.is_leader") def waiting_for_kafka(): layer.status.waiting("Waiting for kafka to be ready") @when_not("mongo.ready") @when_not("lcm-k8s.configured") +@when("leadership.is_leader") def waiting_for_mongo(): layer.status.waiting("Waiting for mongo to be ready") @when_not("ro.ready") @when_not("lcm-k8s.configured") +@when("leadership.is_leader") def waiting_for_ro(): layer.status.waiting("Waiting for ro to be ready") @@ -96,7 +105,14 @@ def configure(): layer.status.blocked("k8s spec failed to deploy: {}".format(e)) +@when("kafka.ready", "mongo.ready", "ro.ready") +@when_not("leadership.is_leader") +def non_leaders_active(): + layer.status.active("ready") + + @when("lcm-k8s.configured") +@when("leadership.is_leader") def set_lcm_active(): layer.status.active("ready") @@ -130,8 +146,8 @@ def make_pod_spec(ro_host, ro_port, kafka_host, kafka_port, mongo_uri): "mongo_uri": mongo_uri, } data.update(cfg) - - spec = yaml.safe_dump(pod_spec_template % data) + logs = pod_spec_template % data + spec = yaml.safe_load(pod_spec_template % data) if "vca_apiproxy" in cfg and cfg["vca_apiproxy"] != "": spec["containers"][0]["config"]["OSMLCM_VCA_APIPROXY"] = cfg["vca_apiproxy"] - return spec \ No newline at end of file + return spec diff --git a/installers/charm/lint.sh b/installers/charm/lint.sh index 1a4fa803..3c42dd1b 100755 --- a/installers/charm/lint.sh +++ b/installers/charm/lint.sh @@ -1,3 +1,4 @@ +#!/bin/bash # Copyright 2020 Canonical Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,8 +12,9 @@ # 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. -#!/bin/bash + set -eux + function lint() { cd $1 tox -e lint @@ -25,3 +27,6 @@ lint 'nbi-k8s' lint 'pol-k8s' lint 'ro-k8s' lint 'ui-k8s' +lint 'keystone' +lint 'ng-ui' +lint 'pla' \ No newline at end of file diff --git a/installers/charm/mon-k8s/reactive/mon_k8s.py b/installers/charm/mon-k8s/reactive/mon_k8s.py index 9eae0b19..79780e03 100644 --- a/installers/charm/mon-k8s/reactive/mon_k8s.py +++ b/installers/charm/mon-k8s/reactive/mon_k8s.py @@ -33,18 +33,21 @@ def restart(): @when_not("kafka.ready") @when_not("mon-k8s.configured") +@when("leadership.is_leader") def waiting_for_kafka(): layer.status.waiting("Waiting for kafka to be ready") @when_not("mongo.ready") @when_not("mon-k8s.configured") +@when("leadership.is_leader") def waiting_for_mongo(): layer.status.waiting("Waiting for mongo to be ready") @when_not("endpoint.prometheus.available") @when_not("mon-k8s.configured") +@when("leadership.is_leader") def waiting_for_prometheus(): layer.status.waiting("Waiting for prometheus to be ready") @@ -81,6 +84,12 @@ def configure(): layer.status.blocked("k8s spec failed to deploy: {}".format(e)) +@when("kafka.ready", "mongo.ready", "endpoint.prometheus.available") +@when_not("leadership.is_leader") +def non_leaders_active(): + layer.status.active("ready") + + @when("mon-k8s.configured") def set_mon_active(): layer.status.active("ready") diff --git a/installers/charm/nbi-k8s/reactive/nbi.py b/installers/charm/nbi-k8s/reactive/nbi.py index edcdd4cc..855d8006 100644 --- a/installers/charm/nbi-k8s/reactive/nbi.py +++ b/installers/charm/nbi-k8s/reactive/nbi.py @@ -46,23 +46,38 @@ def clear_keystone_ready(): @when_not("kafka.ready") @when_not("nbi-k8s.configured") +@when("leadership.is_leader") def waiting_for_kafka(): layer.status.waiting("Waiting for kafka to be ready") @when_not("mongo.ready") @when_not("nbi-k8s.configured") +@when("leadership.is_leader") def waiting_for_mongo(): layer.status.waiting("Waiting for mongo to be ready") @when_not("endpoint.prometheus.available") @when_not("nbi-k8s.configured") +@when("leadership.is_leader") def waiting_for_prometheus(): layer.status.waiting("Waiting for prometheus to be ready") @when_not("keystone.ready") +@when("leadership.is_leader") +@when_not("nbi-k8s.configured") +def waiting_for_keystone(): + auth_backend = config().get("auth-backend") + if auth_backend == "keystone": + layer.status.waiting("Waiting for Keystone to be ready") + else: + set_flag("keystone.ready") + + +@when_not("keystone.ready") +@when("leadership.is_leader") @when_not("nbi-k8s.configured") def waiting_for_keystone(): auth_backend = config().get("auth-backend") @@ -162,6 +177,12 @@ def configure(): log("Error: {}".format(traceback.format_exc())) +@when("kafka.ready", "mongo.ready", "endpoint.prometheus.available") +@when_not("leadership.is_leader") +def non_leaders_active(): + layer.status.active("ready") + + @when("nbi-k8s.configured") def set_nbi_active(): layer.status.active("ready") diff --git a/installers/charm/ng-ui/.gitignore b/installers/charm/ng-ui/.gitignore new file mode 100644 index 00000000..dfaa805f --- /dev/null +++ b/installers/charm/ng-ui/.gitignore @@ -0,0 +1,16 @@ +# Copyright 2020 Canonical Ltd. +# +# 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. +.vscode +build +ng-ui.charm \ No newline at end of file diff --git a/installers/charm/ng-ui/config.yaml b/installers/charm/ng-ui/config.yaml index 3d538fef..a80a280e 100644 --- a/installers/charm/ng-ui/config.yaml +++ b/installers/charm/ng-ui/config.yaml @@ -19,7 +19,7 @@ options: image: description: Docker image name type: string - default: opensourcemano/ng-ui:8.0.0rc1 + default: opensourcemano/ng-ui:8 port: description: Port number type: int diff --git a/installers/charm/ng-ui/requirements.txt b/installers/charm/ng-ui/requirements.txt new file mode 100644 index 00000000..10ecdcd5 --- /dev/null +++ b/installers/charm/ng-ui/requirements.txt @@ -0,0 +1,14 @@ +# Copyright 2020 Canonical Ltd. +# +# 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. +ops diff --git a/installers/charm/ng-ui/src/charm.py b/installers/charm/ng-ui/src/charm.py index ce48927a..d9ad8f2a 100755 --- a/installers/charm/ng-ui/src/charm.py +++ b/installers/charm/ng-ui/src/charm.py @@ -13,11 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -import sys -import logging import base64 - -sys.path.append("lib") +from glob import glob +import logging +from pathlib import Path +from string import Template +import sys from ops.charm import CharmBase from ops.framework import StoredState, Object @@ -30,9 +31,9 @@ from ops.model import ( WaitingStatus, ) -from glob import glob -from pathlib import Path -from string import Template + +sys.path.append("lib") + logger = logging.getLogger(__name__) @@ -157,7 +158,9 @@ class NGUICharm(CharmBase): }, } ) + logger.debug(files) + spec = { "version": 2, "containers": [ @@ -188,11 +191,12 @@ class NGUICharm(CharmBase): self.on_start(event) def on_nbi_relation_changed(self, event): - unit = self.model.unit - if not unit.is_leader(): - return - self.state.nbi_host = event.relation.data[event.unit].get("host") - self.state.nbi_port = event.relation.data[event.unit].get("port") + nbi_host = event.relation.data[event.unit].get("host") + nbi_port = event.relation.data[event.unit].get("port") + if nbi_host and self.state.nbi_host != nbi_host: + self.state.nbi_host = nbi_host + if nbi_port and self.state.nbi_port != nbi_port: + self.state.nbi_port = nbi_port self._apply_spec() diff --git a/installers/charm/ng-ui/tox.ini b/installers/charm/ng-ui/tox.ini index aafa3010..1c22bd55 100644 --- a/installers/charm/ng-ui/tox.ini +++ b/installers/charm/ng-ui/tox.ini @@ -20,10 +20,20 @@ setenv = VIRTUAL_ENV={envdir} PYTHONHASHSEED=0 whitelist_externals = juju passenv = HOME TERM CS_API_* OS_* AMULET_* -deps = -r{toxinidir}/test-requirements.txt install_command = pip install {opts} {packages} +[testenv:build] +basepython = python3 +passenv=HTTP_PROXY HTTPS_PROXY NO_PROXY +whitelist_externals = charmcraft + rm + unzip +commands = + rm -rf release + charmcraft build + unzip ng-ui.charm -d release + [testenv:black] basepython = python3 deps = diff --git a/installers/charm/pla/.gitignore b/installers/charm/pla/.gitignore new file mode 100644 index 00000000..db6d41ae --- /dev/null +++ b/installers/charm/pla/.gitignore @@ -0,0 +1,16 @@ +# Copyright 2020 Canonical Ltd. +# +# 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. +.vscode +build +pla.charm \ No newline at end of file diff --git a/installers/charm/pla/config.yaml b/installers/charm/pla/config.yaml index 3f092c5d..e0aeca41 100644 --- a/installers/charm/pla/config.yaml +++ b/installers/charm/pla/config.yaml @@ -19,7 +19,7 @@ options: image: description: Docker image name type: string - default: opensourcemano/pla:8.0.0rc1 + default: opensourcemano/pla:8 port: description: Port number type: int diff --git a/installers/charm/pla/requirements.txt b/installers/charm/pla/requirements.txt new file mode 100644 index 00000000..10ecdcd5 --- /dev/null +++ b/installers/charm/pla/requirements.txt @@ -0,0 +1,14 @@ +# Copyright 2020 Canonical Ltd. +# +# 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. +ops diff --git a/installers/charm/pla/src/charm.py b/installers/charm/pla/src/charm.py index 1fc6386f..785766de 100755 --- a/installers/charm/pla/src/charm.py +++ b/installers/charm/pla/src/charm.py @@ -13,10 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -import sys +from glob import glob import logging - -sys.path.append("lib") +from pathlib import Path +from string import Template +import sys from ops.charm import CharmBase from ops.framework import StoredState, Object @@ -27,9 +28,9 @@ from ops.model import ( WaitingStatus, ) -from glob import glob -from pathlib import Path -from string import Template + +sys.path.append("lib") + logger = logging.getLogger(__name__) @@ -123,23 +124,23 @@ class PLACharm(CharmBase): """Upgrade the charm.""" unit = self.model.unit unit.status = MaintenanceStatus("Upgrading charm") - self.on_start(event) + self._apply_spec() def on_kafka_relation_changed(self, event): - unit = self.model.unit - if not unit.is_leader(): - return - self.state.kafka_host = event.relation.data[event.unit].get("host") - self.state.kafka_port = event.relation.data[event.unit].get("port") + kafka_host = event.relation.data[event.unit].get("host") + kafka_port = event.relation.data[event.unit].get("port") + if kafka_host and self.state.kafka_host != kafka_host: + self.state.kafka_host = kafka_host + if kafka_port and self.state.kafka_port != kafka_port: + self.state.kafka_port = kafka_port self._apply_spec() def on_mongo_relation_changed(self, event): - unit = self.model.unit - if not unit.is_leader(): - return - self.state.mongodb_uri = event.relation.data[event.unit].get( + mongodb_uri = event.relation.data[event.unit].get( "connection_string" ) + if mongodb_uri and self.state.mongodb_uri != mongodb_uri: + self.state.mongodb_uri = mongodb_uri self._apply_spec() diff --git a/installers/charm/pla/tox.ini b/installers/charm/pla/tox.ini index d2a8c531..678a5ec5 100644 --- a/installers/charm/pla/tox.ini +++ b/installers/charm/pla/tox.ini @@ -21,10 +21,21 @@ setenv = VIRTUAL_ENV={envdir} PYTHONHASHSEED=0 whitelist_externals = juju passenv = HOME TERM CS_API_* OS_* AMULET_* -deps = -r{toxinidir}/test-requirements.txt install_command = pip install {opts} {packages} + +[testenv:build] +basepython = python3 +passenv=HTTP_PROXY HTTPS_PROXY NO_PROXY +whitelist_externals = charmcraft + rm + unzip +commands = + rm -rf release + charmcraft build + unzip pla.charm -d release + [testenv:black] basepython = python3 deps = diff --git a/installers/charm/pol-k8s/reactive/pol_k8s.py b/installers/charm/pol-k8s/reactive/pol_k8s.py index c31a3231..5629b4ba 100644 --- a/installers/charm/pol-k8s/reactive/pol_k8s.py +++ b/installers/charm/pol-k8s/reactive/pol_k8s.py @@ -32,12 +32,14 @@ def restart(): @when_not("kafka.ready") +@when("leadership.is_leader") @when_not("pol-k8s.configured") def waiting_for_kafka(): layer.status.waiting("Waiting for kafka to be ready") @when_not("mongo.ready") +@when("leadership.is_leader") @when_not("pol-k8s.configured") def waiting_for_mongo(): layer.status.waiting("Waiting for mongo to be ready") @@ -69,6 +71,12 @@ def configure(): layer.status.blocked("k8s spec failed to deploy: {}".format(e)) +@when("kafka.ready", "mongo.ready") +@when_not("leadership.is_leader") +def non_leaders_active(): + layer.status.active("ready") + + @when("pol-k8s.configured") def set_pol_active(): layer.status.active("ready") diff --git a/installers/charm/ro-k8s/reactive/ro.py b/installers/charm/ro-k8s/reactive/ro.py index afd7f459..8ad6f98c 100644 --- a/installers/charm/ro-k8s/reactive/ro.py +++ b/installers/charm/ro-k8s/reactive/ro.py @@ -34,6 +34,7 @@ def restart(): @when_not("mysql.available") @when_not("ro-k8s.configured") +@when("leadership.is_leader") def waiting_for_mysql(): layer.status.waiting("Waiting for mysql to be ready") @@ -46,22 +47,29 @@ def configure(): try: mysql = endpoint_from_flag("mysql.available") - spec = make_pod_spec( - mysql.host(), - mysql.port(), - mysql.user(), - mysql.password(), - mysql.root_password(), - ) - - log("set pod spec:\n{}".format(spec)) - pod_spec_set(spec) - layer.status.active("creating container") - set_flag("ro-k8s.configured") + if mysql.host() is not None: + spec = make_pod_spec( + mysql.host(), + mysql.port(), + mysql.user(), + mysql.password(), + mysql.root_password(), + ) + + log("set pod spec:\n{}".format(spec)) + pod_spec_set(spec) + layer.status.active("creating container") + set_flag("ro-k8s.configured") except Exception as e: layer.status.blocked("k8s spec failed to deploy: {}".format(e)) +@when("mysql.available") +@when_not("leadership.is_leader") +def non_leaders_active(): + layer.status.active("ready") + + @when("ro-k8s.configured") def set_ro_active(): layer.status.active("ready") diff --git a/installers/charm/ui-k8s/reactive/ui.py b/installers/charm/ui-k8s/reactive/ui.py index 46e57094..5ca81433 100644 --- a/installers/charm/ui-k8s/reactive/ui.py +++ b/installers/charm/ui-k8s/reactive/ui.py @@ -38,12 +38,14 @@ def restart(): @when_not("mysql.available") @when_not("ui-k8s.configured") +@when("leadership.is_leader") def waiting_for_mysql(): layer.status.waiting("Waiting for mysql to be available") @when_not("nbi.ready") @when_not("ui-k8s.configured") +@when("leadership.is_leader") def waiting_for_nbi(): layer.status.waiting("Waiting for nbi to be available") @@ -74,6 +76,12 @@ def configure(): layer.status.blocked("k8s spec failed to deploy: {}".format(e)) +@when("mysql.available", "nbi.ready") +@when_not("leadership.is_leader") +def non_leaders_active(): + layer.status.active("ready") + + @when("ui-k8s.configured") def set_ui_active(): layer.status.active("ready") diff --git a/installers/charmed_install.sh b/installers/charmed_install.sh index 9fda5166..f0f729e6 100755 --- a/installers/charmed_install.sh +++ b/installers/charmed_install.sh @@ -27,7 +27,7 @@ function check_arguments(){ --lxd) LXD_CLOUD="$2" ;; --lxd-cred) LXD_CREDENTIALS="$2" ;; --microstack) MICROSTACK=y ;; - --ha) BUNDLE="cs:osm-ha-39" ;; + --ha) BUNDLE="cs:osm-ha" ;; --tag) TAG="$2" ;; esac shift @@ -131,7 +131,6 @@ EOF # Install LXD snap sudo apt-get remove --purge -y liblxc1 lxc-common lxcfs lxd lxd-client sudo snap install lxd - sudo apt-get install zfsutils-linux -y # Configure LXD sudo usermod -a -G lxd `whoami` cat /usr/share/osm-devops/installers/lxd-preseed.conf | sed 's/^config: {}/config:\n core.https_address: '$LXDENDPOINT':8443/' | sg lxd -c "lxd init --preseed" @@ -209,7 +208,7 @@ function deploy_charmed_osm(){ if [ -v BUNDLE ]; then juju deploy $BUNDLE --overlay ~/.osm/vca-overlay.yaml $images_overlay else - juju deploy cs:osm-49 --overlay ~/.osm/vca-overlay.yaml $images_overlay + juju deploy cs:osm --overlay ~/.osm/vca-overlay.yaml $images_overlay fi echo "Waiting for deployment to finish..." @@ -353,6 +352,9 @@ applications: ng-ui: options: image: opensourcemano/ng-ui:$TAG + keystone: + options: + image: opensourcemano/keystone:$TAG EOF mv /tmp/images-overlay.yaml $IMAGES_OVERLAY_FILE diff --git a/installers/full_install_osm.sh b/installers/full_install_osm.sh index 2c0aa5c6..39d2850f 100755 --- a/installers/full_install_osm.sh +++ b/installers/full_install_osm.sh @@ -183,6 +183,10 @@ function remove_helm() { fi } +function remove_crontab_job() { + crontab -l | grep -v '${OSM_DEVOPS}/installers/update-juju-lxc-images' | crontab - +} + #Uninstall osmclient function uninstall_osmclient() { sudo apt-get remove --purge -y python-osmclient @@ -239,6 +243,7 @@ EONG $WORKDIR_SUDO rm -rf $OSM_DOCKER_WORK_DIR [ -z "$CONTROLLER_NAME" ] && sg lxd -c "juju destroy-controller --destroy-all-models --yes $OSM_STACK_NAME" fi + remove_crontab_job [ -z "$INSTALL_NOHOSTCLIENT" ] && uninstall_osmclient echo "Some docker images will be kept in case they are used by other docker stacks" echo "To remove them, just run 'docker image prune' in a terminal" @@ -270,6 +275,11 @@ function FATAL(){ exit 1 } +function update_juju_images(){ + crontab -l | grep update-juju-lxc-images || (crontab -l 2>/dev/null; echo "0 4 * * 6 $USER ${OSM_DEVOPS}/installers/update-juju-lxc-images --xenial --bionic") | crontab - + ${OSM_DEVOPS}/installers/update-juju-lxc-images --xenial --bionic +} + function install_lxd() { # Apply sysctl production values for optimal performance sudo cp ${OSM_DEVOPS}/installers/60-lxd-production.conf /etc/sysctl.d/60-lxd-production.conf @@ -408,6 +418,7 @@ function install_juju() { echo "Installing juju" sudo snap install juju --classic --channel=2.8/stable [[ ":$PATH": != *":/snap/bin:"* ]] && PATH="/snap/bin:${PATH}" + update_juju_images echo "Finished installation of juju" return 0 } @@ -1601,6 +1612,7 @@ while getopts ":b:r:c:n:k:u:R:D:o:O:m:N:H:S:s:w:t:U:P:A:l:L:K:-: hy" o; do [ "${OPTARG}" == "lxd" ] && continue [ "${OPTARG}" == "lxd-cred" ] && continue [ "${OPTARG}" == "microstack" ] && continue + [ "${OPTARG}" == "vca" ] && continue [ "${OPTARG}" == "ha" ] && continue [ "${OPTARG}" == "tag" ] && continue [ "${OPTARG}" == "pla" ] && INSTALL_PLA="y" && continue diff --git a/installers/osm_health.sh b/installers/osm_health.sh index 0f7922a3..e7c8065e 100755 --- a/installers/osm_health.sh +++ b/installers/osm_health.sh @@ -54,7 +54,7 @@ while [ $time -le "$WAIT_TIME" ]; do exit 0 fi else - if [ "$(docker ps | grep " ${STACK_NAME}_" | grep -i healthy | wc -l)" -ge "$NUM_SERVICES_WITH_HEALTH" ]; then + if [ "$(sg docker -c "docker ps" | grep " ${STACK_NAME}_" | grep -i healthy | wc -l)" -ge "$NUM_SERVICES_WITH_HEALTH" ]; then # all dockers are healthy now. # final sleep is needed until more health checks are added to validate system is ready to handle requests sleep $WAIT_FINAL @@ -79,12 +79,12 @@ if [ -n "$KUBERNETES" ]; then done else echo "Not all Docker services are healthy" - docker ps | grep " ${STACK_NAME}_" + sg docker -c "docker ps" | grep " ${STACK_NAME}_" for S_WITH_HEALTH in $SERVICES_WITH_HEALTH ; do - docker ps | grep " ${STACK_NAME}_" | grep -i healthy | grep -q "_${S_WITH_HEALTH}." && continue + sg docker -c "docker ps" | grep " ${STACK_NAME}_" | grep -i healthy | grep -q "_${S_WITH_HEALTH}." && continue echo echo BEGIN LOGS of container ${S_WITH_HEALTH} not healthy - docker service logs ${STACK_NAME}_${S_WITH_HEALTH} 2>&1 | tail -n 100 + sg docker -c "docker service logs ${STACK_NAME}_${S_WITH_HEALTH} 2>&1" | tail -n 100 echo END LOGS of container ${S_WITH_HEALTH} not healthy echo done diff --git a/installers/update-juju-lxc-images b/installers/update-juju-lxc-images index 88be1271..18f85c98 100755 --- a/installers/update-juju-lxc-images +++ b/installers/update-juju-lxc-images @@ -98,6 +98,7 @@ function cache() { alias=juju/$series/amd64 lxc delete $container -f || true + lxc image copy ubuntu:$series local: --alias clean-$series lxc launch ubuntu:$series $container sleep 15 # wait for network @@ -121,6 +122,7 @@ function cache() { lxc stop $container lxc image delete $alias || true + lxc image delete clean-$series || true lxc publish $container --alias $alias description="$series juju dev image ($(date +%Y%m%d))" lxc delete $container -f || true diff --git a/jenkins/ci-pipelines/ci_stage_2.groovy b/jenkins/ci-pipelines/ci_stage_2.groovy index 4d23cf17..049763c6 100644 --- a/jenkins/ci-pipelines/ci_stage_2.groovy +++ b/jenkins/ci-pipelines/ci_stage_2.groovy @@ -19,7 +19,7 @@ def project_checkout(url_prefix,project,refspec,revision) { // checkout the project // this is done automaticaly by the multibranch pipeline plugin // git url: "${url_prefix}/${project}" - + sh "git fetch --tags" sh "git fetch origin ${refspec}" if (GERRIT_PATCHSET_REVISION.size() > 0 ) { @@ -42,7 +42,7 @@ def ci_pipeline(mdg,url_prefix,project,branch,refspec,revision,do_stage_3,artifa stage('License Scan') { if (!JOB_NAME.contains('merge')) { sh "devops/tools/license_scan.sh" - } + } else { println("skip the scan for merge") } @@ -79,6 +79,30 @@ def ci_pipeline(mdg,url_prefix,project,branch,refspec,revision,do_stage_3,artifa } } + if (fileExists('snap/snapcraft.yaml')) { + stage('Snap build') { + sh "sudo rm -rf ${WORKSPACE}/stage/ ${WORKSPACE}/parts/ ${WORKSPACE}/prime/ ${WORKSPACE}/*.snap" + sh "docker run -v ${WORKSPACE}:/build --env BRANCH=${BRANCH_NAME} -w /build snapcore/snapcraft:stable /bin/bash -c 'apt update && snapcraft'" + sh "sudo mv ${WORKSPACE}/${mdg}_*.snap ${WORKSPACE}/${mdg}.snap" + sh "sudo rm -rf ${WORKSPACE}/stage/ ${WORKSPACE}/parts/ ${WORKSPACE}/prime/" + + REV="" + if ( !JOB_NAME.contains('merge') ) { + REV="/"+"${GERRIT_REFSPEC}".replaceAll('/','-') + } + channel="latest" + if (BRANCH_NAME.startsWith("v")) { + channel=BRANCH_NAME.substring(1) + } else if (BRANCH_NAME!="master") { + REV="/"+BRANCH_NAME+REV.replaceAll('/','-') + } + + sh "sudo docker run -v ~/.snapcraft:/snapcraft -v ${WORKSPACE}:/build " + + "-w /build snapcore/snapcraft:stable /bin/bash -c " + + "\"snapcraft login --with /snapcraft/config ; snapcraft push --release=${channel}/edge${REV} ${mdg}.snap\"" + } + } + if ( do_stage_3 ) { stage('Build System') { diff --git a/jenkins/ci-pipelines/ci_stage_3.groovy b/jenkins/ci-pipelines/ci_stage_3.groovy index 8906ffce..d87ad95b 100644 --- a/jenkins/ci-pipelines/ci_stage_3.groovy +++ b/jenkins/ci-pipelines/ci_stage_3.groovy @@ -102,8 +102,9 @@ def run_robot_systest(stackName,tagName,testName,envfile=null,kubeconfig=null,cl } def archive_logs(stackName) { - sh "docker service ls |grep \"${stackName}\"| awk '{print \$2}'| xargs -iy docker service logs y --timestamps > containers_logs.txt 2>&1" - archiveArtifacts artifacts: 'containers_logs.txt' + sh "docker service ls |grep \"${stackName}\"| awk '{print \$2}' | xargs -iy docker ps -af name=y --format \"{{.ID}} {{.Names}}\" --no-trunc | awk '{ print \"sudo cp /var/lib/docker/containers/\"\$1\"/\"\$1\"-json.log \"\$2\".log\"}' | xargs -iy bash -c y" + sh "sudo chown jenkins: osm*.log" + archiveArtifacts artifacts: '*.log' } node("${params.NODE}") { @@ -270,14 +271,14 @@ node("${params.NODE}") { { repo_base_url = "-u ${params.REPOSITORY_BASE}" } - if ( params.DO_STAGE_4 ) { - try { + if ( params.DO_STAGE_4 ) { + try { sh "docker stack list |grep \"${container_name_prefix}\"| awk '{ print \$1 }'| xargs docker stack rm" - } - catch (caughtError) { - println("Caught error: docker stack rm failed!") - } - } + } + catch (caughtError) { + println("Caught error: docker stack rm failed!") + } + } sh """ export PATH=$PATH:/snap/bin installers/full_install_osm.sh -y -s ${container_name} --test --nolxd --nodocker --nojuju --nohostports --nohostclient \ @@ -305,9 +306,9 @@ node("${params.NODE}") { if ( ! currentBuild.result.equals('UNSTABLE') ) { stage_archive = keep_artifacts } else { - error = new Exception("Smoke test failed") - currentBuild.result = 'FAILURE' - } + error = new Exception("Smoke test failed") + currentBuild.result = 'FAILURE' + } } } @@ -326,10 +327,10 @@ node("${params.NODE}") { stage_archive = keep_artifacts } else { println ("Systest test failed, throwing error") - error = new Exception("Systest test failed") - currentBuild.result = 'FAILURE' - throw error - } + error = new Exception("Systest test failed") + currentBuild.result = 'FAILURE' + throw error + } } } @@ -347,6 +348,41 @@ node("${params.NODE}") { stage("Docker Push") { sh "make -C docker push INPUT_TAG=${container_name} TAG=${params.DOCKER_TAG}" } + + stage("Snap promotion") { + def snaps = ["osmclient"] + for (snap in snaps) { + channel="" + if (BRANCH_NAME.startsWith("v")) { + channel=BRANCH_NAME.substring(1)+"/" + } else if (BRANCH_NAME!="master") { + channel+="/"+BRANCH_NAME.replaceAll('/','-') + } + track=channel+"edge\\*" + edge_rev=sh(returnStdout: true, + script: "sudo docker run -v ~/.snapcraft:/snapcraft -v ${WORKSPACE}:/build " + + "-w /build snapcore/snapcraft:stable /bin/bash -c " + + "\"snapcraft login --with /snapcraft/config &>/dev/null && " + + "snapcraft revisions $snap\" | " + + "grep \" $track\" | tail -1 | awk '{print \$1}'").trim() + track=channel+"beta\\*" + beta_rev=sh(returnStdout: true, + script: "sudo docker run -v ~/.snapcraft:/snapcraft -v ${WORKSPACE}:/build " + + "-w /build snapcore/snapcraft:stable /bin/bash -c " + + "\"snapcraft login --with /snapcraft/config &>/dev/null && " + + "snapcraft revisions $snap\" | " + + "grep \" $track\" | tail -1 | awk '{print \$1}'").trim() + + if ( edge_rev != beta_rev ) { + print "Promoting $edge_rev to beta in place of $beta_rev" + beta_track=channel+"beta" + sh("sudo docker run -v ~/.snapcraft:/snapcraft -v ${WORKSPACE}:/build " + + "-w /build snapcore/snapcraft:stable /bin/bash -c " + + "\"snapcraft login --with /snapcraft/config &>/dev/null && " + + "snapcraft release $snap $edge_rev $beta_track\"") + } + } + } } } } diff --git a/robot-systest/deprecated/README_Robot_Test.md b/robot-systest/deprecated/README_Robot_Test.md deleted file mode 100644 index 083e1dd2..00000000 --- a/robot-systest/deprecated/README_Robot_Test.md +++ /dev/null @@ -1,86 +0,0 @@ - - - -# Step to run robot framework test standalone linux environment - -All installation commands run using root user(`sudo su`) -## Step 1: Install python packages -Install below python packages using pip ->pip install python-magic pyangbind haikunator requests pyvcloud progressbar pathlib robotframework robotframework-seleniumlibrary robotframework-requests robotframework-jsonlibrary - -## Step 2: Install linux packages -Install below linux packages ->curl http://osm-download.etsi.org/repository/osm/debian/ReleaseSIX/OSM%20ETSI%20Release%20Key.gpg | apt-key add - - ->add-apt-repository -y "deb http://osm-download.etsi.org/repository/osm/debian/ReleaseSIX stable devops osmclient IM" && apt update - ->curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - - ->echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list - -> apt-get install -y python-osmclient python-osm-im google-chrome-stable chromium-chromedriver - ->./git-repo/devops/tools/OVF_converter/install.sh - -## Step 3: checkout robot seed code -Checkout devops from gerrit -> git clone "https://osm.etsi.org/gerrit/osm/devops" - -If robot seed code not merged to to master, pull it -> git pull "https://osm.etsi.org/gerrit/osm/devops" refs/changes/52/7852/4 - -## Step 4: Set environmet -for build test need to create env-file and provide below details and for Standalone testing export them -``` -export OSM_HOSTNAME= -``` - -OpenStack Details -``` -export OS_AUTH_URL= -export OS_PASSWORD= -export OS_PROJECT_NAME= -export OS_VIM_CONFIG= -``` - -VCD Details -``` -export VCD_AUTH_URL= -export VCD_USERNAME= -export VCD_PASSWORD= -export VCD_TENANT_NAME= -export VCD_ORGANIZATION= -export VCD_VIM_CONFIG= -``` - -Note:- Optional -``` -export NS_CONFIG= -e.g. export NS_CONFIG="'{vld: [ {name: mgmtnet, vim-network-name: mgmt}]}'" -``` - -## Step 5: Run Test -There are two ways to run the test-case: -* use `devops/robot-systest/run_test.sh` file and provide test-name(vim/smoke/sanity/comprehensive). - > ./devops/robot-systest/run_test.sh -t smoke - -* use `robot` command - > robot -d path/to/report/dir -i test-tag-to-be-included -e test-tag-to-be-excluded path/to/testsuiet - - > robot -d devops/robot-systest/reports -i comprehensive devops/robot-systest/testsuite \ No newline at end of file diff --git a/robot-systest/deprecated/lib/api/common.robot b/robot-systest/deprecated/lib/api/common.robot deleted file mode 100644 index 4724016e..00000000 --- a/robot-systest/deprecated/lib/api/common.robot +++ /dev/null @@ -1,64 +0,0 @@ -# -*- coding: utf-8 -*- - -## -# Copyright 2019 Tech Mahindra Limited -# -# 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. Feature 7829: Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com -## - - -*** Variables *** -${token}= ${EMPTY} -${HOST}= ${EMPTY} - - -*** Keywords *** -Get Auth Token - [Tags] auth_token - - ${nbi_host}= Get Environment Variable OSM_HOSTNAME - ${passed}= Run Keyword And Return Status Should Contain ${nbi_host} : - Run Keyword If ${passed} Set Dockerized Host ${nbi_host} - ... ELSE Set Standalone Host ${nbi_host} - - Create Session osmhit ${HOST} verify=${FALSE} debug=1 headers=${HEADERS} - - Log Many ${auth_token_uri} @{data} ${data} - - ${resp}= Post Request osmhit ${auth_token_uri} data=${data} - log ${resp} - - Pass Execution If ${resp.status_code} in ${success_status_code_list} Get Auth Token completed - - ${content}= To Json ${resp.content} - ${t}= Get From Dictionary ${content} _id - - Set Suite Variable ${token} ${t} - - -Set Dockerized Host - [Arguments] ${env_host} - - Set Suite Variable ${HOST} https://${env_host} - - -Set Standalone Host - [Arguments] ${env_host} - - Set Suite Variable ${HOST} https://${env_host}:9999 diff --git a/robot-systest/deprecated/lib/api/vim_lib.robot b/robot-systest/deprecated/lib/api/vim_lib.robot deleted file mode 100644 index a52354fc..00000000 --- a/robot-systest/deprecated/lib/api/vim_lib.robot +++ /dev/null @@ -1,60 +0,0 @@ -# -*- coding: utf-8 -*- - -## -# Copyright 2019 Tech Mahindra Limited -# -# 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. Feature 7829: Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 06-sep-2019 -## - - -*** Keywords *** -Create Vim - [Arguments] ${vim_name} ${account_type} ${auth_url} ${user} ${password} ${tenant} ${description} - - &{request_data}= Create Dictionary vim_user=${user} vim_password=${password} vim_url=${auth_url} vim_tenant_name=${tenant} vim_type=${account_type} description=${description} name=${vim_name} - - &{headers}= Create Dictionary Authorization=Bearer ${token} Content-Type=application/json Accept=application/json - - Create Session osmvim ${HOST} verify=${FALSE} headers=${headers} - - LOG ${request_data} - ${res}= Post Request osmvim ${create_vim_uri} data=${request_data} - log ${res.content} - Pass Execution If ${res.status_code} in ${success_status_code_list} Create Vim Request completed - Get Vim ID ${res.content} - - -Delete Vim - [Arguments] ${vim_id} - - ${uri} = Catenate SEPARATOR=/ ${create_vim_uri} ${vim_id} - ${resp}= Delete Request osmvim ${uri} - - log ${resp.content} - Pass Execution If ${resp.status_code} in ${success_status_code_list} Delete Vim Request completed - - -Get Vim ID - [Arguments] ${res} - -# log to console ${res} - ${content}= To Json ${res} - ${id}= Get From Dictionary ${content} id - Set Suite Variable ${vim_id} ${id} - log Vim Id is ${vim_id} diff --git a/robot-systest/deprecated/lib/cli/network_slicing_lib.robot b/robot-systest/deprecated/lib/cli/network_slicing_lib.robot deleted file mode 100644 index 9a3ff370..00000000 --- a/robot-systest/deprecated/lib/cli/network_slicing_lib.robot +++ /dev/null @@ -1,118 +0,0 @@ -# -*- coding: utf-8 -*- - -## -# Copyright 2019 Tech Mahindra Limited -# -# 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 : 08-nov-2019 -## - -*** Variables *** -${success_return_code} 0 -${delete_max_wait_time} 1min -${delete_pol_time} 15sec -${ns_launch_max_wait_time} 5min -${ns_launch_pol_time} 30sec - - -*** Keywords *** -Create NST - [Documentation] Create nst at osm - [Arguments] ${nst_pkg} - - ${rc} ${stdout}= Run and Return RC and Output osm nst-create ${nst_pkg} - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - [Return] ${stdout} - - -Delete NST - [Documentation] delete nst at osm - [Arguments] ${nst} - - ${rc} ${stdout}= Run and Return RC and Output osm nst-delete ${nst} - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - [Return] ${stdout} - - -Launch Network Slice Instance - [Arguments] ${vim_name} ${nst_name} ${ns_config}='' - - ${nsi_name}= GENERATE NAME - Run Keyword If ${ns_config}!='' Create Network Slice With Config ${nsi_name} ${nst_name} ${vim_name} ${ns_config} - ... ELSE Create Network Slice Without Config ${nsi_name} ${nst_name} ${vim_name} - - WAIT UNTIL KEYWORD SUCCEEDS ${ns_launch_max_wait_time} ${ns_launch_pol_time} Check For Network Slice Instance To Configured ${nsi_name} - Check For Network Slice Instance For Failure ${nsi_name} - - -Create Network Slice With Config - [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} - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - Append To List ${nsi_list} ${nsi_name} - - -Create Network Slice Without Config - [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} - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - Append To List ${nsi_list} ${nsi_name} - - -Check For Network Slice Instance For Failure - [Arguments] ${nsi_name} - - ${rc} ${stdout}= Run and Return RC and Output osm nsi-list --filter name="${nsi_name}" - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - Should Not Contain ${stdout} failed - - -Check For Network Slice Instance To Configured - [Arguments] ${nsi_name} - - ${rc} ${stdout}= Run and Return RC and Output osm nsi-list --filter name="${nsi_name}" - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - Should Contain Any ${stdout} configured failed - - -Delete Network Slice Instance - [Documentation] Delete ns - [Arguments] ${nsi} - - ${rc} ${stdout}= Run and Return RC and Output osm nsi-delete ${nsi} - 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} - - -Check For NSI Instance To Be Delete - [Arguments] ${nsi} - - ${rc} ${stdout}= Run and Return RC and Output osm nsi-list - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - Should Not Contain ${stdout} ${nsi} diff --git a/robot-systest/deprecated/lib/cli/ns_lib.robot b/robot-systest/deprecated/lib/cli/ns_lib.robot deleted file mode 100644 index e0eb0c2b..00000000 --- a/robot-systest/deprecated/lib/cli/ns_lib.robot +++ /dev/null @@ -1,193 +0,0 @@ -# -*- coding: utf-8 -*- - -## -# Copyright 2019 Tech Mahindra Limited -# -# 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. Feature 7829: Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 06-aug-2019 : Improvement to the code, robot framework initial seed code. -## - - -*** Variables *** -${success_return_code} 0 -${ns_launch_max_wait_time} 5min -${ns_launch_pol_time} 30sec -${ns_delete_max_wait_time} 1min -${ns_delete_pol_time} 15sec -${nsconfig} - -*** Keywords *** -Get NS List - [Documentation] Get ns instance list - - ${rc} ${stdout}= Run and Return RC and Output osm ns-list - log ${stdout} - 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 - - Run Keyword If ${ns_config}=='' Get NS Config - ... ELSE Set NS Config ${ns_config} - Log To Console \n${nsconfig} - Should Not Be Empty ${nsd_ids} There are no NS descriptors to launch the NS - :FOR ${nsd} IN @{nsd_ids} - \ ${ns_name}= GENERATE NAME - \ Append To List ${ns_ids} ${ns_name} - \ Create Network Service ${nsd} ${vim_name} ${ns_name} ${nsconfig} - - -Set NS Config - [Arguments] ${ns_config} - [Documentation] Set NS Configuration variable - - ${nsconfig}= Get Variable Value ${ns_config} '' - Set Test Variable ${nsconfig} - - -Get NS Config - [Documentation] Get NS Configuration from Environment Variable - - ${nsconfig}= Get Environment Variable NS_CONFIG '' - Set Test Variable ${nsconfig} - - -Create Network Service - [Documentation] Create ns at osm - [Arguments] ${nsd} ${vim_name} ${ns_name} ${ns_config} - - Run Keyword If ${ns_config}!='' Create Network Service With Config ${nsd} ${vim_name} ${ns_name} ${ns_config} - ... ELSE Create Network Service Without Config ${nsd} ${vim_name} ${ns_name} - - WAIT UNTIL KEYWORD SUCCEEDS ${ns_launch_max_wait_time} ${ns_launch_pol_time} Check For NS Instance To Configured ${ns_name} - Check For NS Instance For Failure ${ns_name} - - -Create Network Service Without Config - [Documentation] Create ns at osm - [Arguments] ${nsd} ${vim_name} ${ns_name} - - ${rc} ${stdout}= Run and Return RC and Output osm ns-create --ns_name ${ns_name} --nsd_name ${nsd} --vim_account ${vim_name} - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - - -Create Network Service With Config - [Documentation] Create ns at osm - [Arguments] ${nsd} ${vim_name} ${ns_name} ${ns_config} - - ${rc} ${stdout}= Run and Return RC and Output osm ns-create --ns_name ${ns_name} --nsd_name ${nsd} --vim_account ${vim_name} --config ${ns_config} - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - - -Delete NS - [Documentation] Delete ns - [Arguments] ${ns} - - ${rc} ${stdout}= Run and Return RC and Output osm ns-delete ${ns} - 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} - - -Check For NS Instance To Configured - [Arguments] ${ns_name} - - ${rc} ${stdout}= Run and Return RC and Output osm ns-list --filter name="${ns_name}" - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - Should Contain Any ${stdout} READY BROKEN - - -Check For NS Instance For Failure - [Arguments] ${ns_name} - - ${rc} ${stdout}= Run and Return RC and Output osm ns-list --filter name="${ns_name}" - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - Should Not Contain ${stdout} BROKEN - - -Check For NS Instance To Be Delete - [Arguments] ${ns} - - ${rc} ${stdout}= Run and Return RC and Output osm ns-list - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - Should Not Contain ${stdout} ${ns} - - -Force Delete NS - [Documentation] Forcely Delete ns - [Arguments] ${ns} - - ${rc} ${stdout}= Run and Return RC and Output osm ns-delete ${ns} - 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/deprecated/lib/cli/nsd_lib.robot b/robot-systest/deprecated/lib/cli/nsd_lib.robot deleted file mode 100644 index da27b4fe..00000000 --- a/robot-systest/deprecated/lib/cli/nsd_lib.robot +++ /dev/null @@ -1,85 +0,0 @@ -# -*- coding: utf-8 -*- - -## -# Copyright 2019 Tech Mahindra Limited -# -# 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. Feature 7829: Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 06-sep-2019 -## - -*** Variables *** -${success_return_code} 0 -${delete_max_wait_time} 1min -${delete_pol_time} 15sec - - -*** Keywords *** -Get NSDs List - [Documentation] Get nsds list - - ${rc} ${stdout}= Run and Return RC and Output osm nsd-list - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - - -Create NSD - [Documentation] Create nsd at osm - [Arguments] ${nsd_pkg} - - ${rc} ${stdout}= Run and Return RC and Output osm nsd-create ${nsd_pkg} - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - [Return] ${stdout} - - -Delete NSD - [Documentation] Delete nsd - [Arguments] ${nsd_id} - - # For timebeing exception thrown by nsd-delete api was ignor because nsd was deleted successfully. The cause of exception is need to debug further - ${rc} ${stdout}= Run Keyword And Continue On Failure Run and Return RC and Output osm nsd-delete ${nsd_id} - log ${stdout} -# Should Be Equal As Integers ${rc} ${success_return_code} - WAIT UNTIL KEYWORD SUCCEEDS ${delete_max_wait_time} ${delete_pol_time} Check For NSD ${nsd_id} - - -Check For NSD - [Arguments] ${nsd_id} - - ${rc} ${stdout}= Run and Return RC and Output osm nsd-list - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - Should Not Contain ${stdout} ${nsd_id} - - -Force Delete NSD - [Documentation] Forcely Delete nsd - [Arguments] ${nsd_id} - - ${rc} ${stdout}= Run and Return RC and Output osm nsd-delete ${nsd_id} - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - - -Build NS Descriptor - [Documentation] Build NS Descriptor from the descriptor-packages - [Arguments] ${nsd path} - - ${rc} ${stdout}= Run and Return RC and Output make -C '${CURDIR}${/}../../..${nsd path}' - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} diff --git a/robot-systest/deprecated/lib/cli/osm_package_tools_lib.robot b/robot-systest/deprecated/lib/cli/osm_package_tools_lib.robot deleted file mode 100644 index c8a864c4..00000000 --- a/robot-systest/deprecated/lib/cli/osm_package_tools_lib.robot +++ /dev/null @@ -1,88 +0,0 @@ -# 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/deprecated/lib/cli/osm_platform_resiliancy_recovery_lib.robot b/robot-systest/deprecated/lib/cli/osm_platform_resiliancy_recovery_lib.robot deleted file mode 100644 index fb867683..00000000 --- a/robot-systest/deprecated/lib/cli/osm_platform_resiliancy_recovery_lib.robot +++ /dev/null @@ -1,55 +0,0 @@ -# -*- coding: utf-8 -*- - -## -# Copyright 2019 Tech Mahindra Limited -# -# 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 : 08-nov-2019 -## - - -*** Variables *** -${success_return_code} 0 -${er_replicas} 0/1 - - -*** Keywords *** -Check If OSM Working - - ${rc} ${stdout}= Run and Return RC and Output osm vnfpkg-list - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - ${rc} ${stdout}= Run and Return RC and Output osm vim-list - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - - -Check All Service Are Running - - ${rc} ${stdout}= Run and Return RC and Output docker service ls - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - Should Not Contain ${stdout} ${er_replicas} - - -Kill Docker Container - [Arguments] ${name} - - ${rc} ${stdout}= Run and Return RC and Output docker rm -f \$(docker ps |grep -i ${name}|awk '{print $1}') - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} \ No newline at end of file diff --git a/robot-systest/deprecated/lib/cli/rbac_lib.robot b/robot-systest/deprecated/lib/cli/rbac_lib.robot deleted file mode 100644 index bbf717a2..00000000 --- a/robot-systest/deprecated/lib/cli/rbac_lib.robot +++ /dev/null @@ -1,245 +0,0 @@ -## -# Copyright 2019 Tech Mahindra Limited -# -# 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 : 21-nov-2019 -## - -*** Keywords *** -Configure NBI For RBAC - ${rc} ${stdout}= Run and Return RC and Output docker service update osm_nbi --force --env-add OSMNBI_AUTHENTICATION_BACKEND=keystone --env-add OSMNBI_AUTHENTICATION_AUTH_URL=keystone --env-add OSMNBI_AUTHENTICATION_AUTH_PORT=5000 --env-add OSMNBI_AUTHENTICATION_USER_DOMAIN_NAME=default --env-add OSMNBI_AUTHENTICATION_PROJECT_DOMAIN_NAME=default --env-add OSMNBI_AUTHENTICATION_SERVICE_USERNAME=nbi --env-add OSMNBI_AUTHENTICATION_SERVICE_PROJECT=service - Should Be Equal As Integers ${rc} ${success_return_code} - Sleep 30s Wait for NBI service to be update - - -Create User - [Arguments] ${user} ${password} - - ${rc} ${stdout}= Run and Return RC and Output osm user-create ${user} --password ${password} - Should Be Equal As Integers ${rc} ${success_return_code} - log ${stdout} - [Return] ${stdout} - - -List User - ${rc} ${stdout}= Run and Return RC and Output osm user-list - Should Be Equal As Integers ${rc} ${success_return_code} - log ${stdout} - [Return] ${stdout} - - -List User And Check For The Created User - [Arguments] ${user} - ${user list}= List User - Should Contain ${user list} ${user} - - -Get User Info By Name - [Arguments] ${user_name} - ${rc} ${stdout}= Run and Return RC and Output osm user-show ${user_name} - Should Be Equal As Integers ${rc} ${success_return_code} - log ${stdout} - - -Get User Info By ID - [Arguments] ${user_id} - ${rc} ${stdout}= Run and Return RC and Output osm user-show ${user_id} - Should Be Equal As Integers ${rc} ${success_return_code} - log ${stdout} - - -Update User - [Arguments] ${user} ${field} ${value} - ${rc} ${stdout}= Run and Return RC and Output osm user-update ${field} ${value} ${user} - Should Be Equal As Integers ${rc} ${success_return_code} - log ${stdout} - - -Update User And Verify Info - [Arguments] ${user} @{args} - FOR ${arg} IN @{args} - ${fields}= Get Dictionary Items ${arg} - Update User ${user} ${fields[0]} ${fields[1]} - END - ${rc} ${stdout}= Run and Return RC and Output osm user-show ${user} - Should Be Equal As Integers ${rc} ${success_return_code} - log ${stdout} - - -Login With User And Perform Operation - [Arguments] ${user} ${password} ${project} - ${rc} ${stdout}= Run and Return RC and Output export OSM_USER=${user} - Should Be Equal As Integers ${rc} ${success_return_code} - ${rc} ${stdout}= Run and Return RC and Output export OSM_PROJECT=${project} - Should Be Equal As Integers ${rc} ${success_return_code} - ${rc} ${stdout}= Run and Return RC and Output export OSM_PASSWORD=${password} - Should Be Equal As Integers ${rc} ${success_return_code} - ${rc} ${stdout}= Run and Return RC and Output osm ns-list - Should Be Equal As Integers ${rc} ${success_return_code} - log ${stdout} - Logout and Login With Admin - - -Logout and Login With Admin - ${rc} ${stdout}= Run and Return RC and Output export OSM_USER=admin - Should Be Equal As Integers ${rc} ${success_return_code} - ${rc} ${stdout}= Run and Return RC and Output export OSM_PASSWORD=admin - Should Be Equal As Integers ${rc} ${success_return_code} - ${rc} ${stdout}= Run and Return RC and Output osm ns-list - Should Be Equal As Integers ${rc} ${success_return_code} - - -Delete User - [Arguments] ${user} - ${rc} ${stdout}= Run and Return RC and Output osm user-delete ${user} - Should Be Equal As Integers ${rc} ${success_return_code} - - -Delete User And Check - [Arguments] ${user} - Delete User ${user} - ${rc} ${stdout}= Run and Return RC and Output osm user-list - Should Be Equal As Integers ${rc} ${success_return_code} - Should Not Contain ${stdout} ${user} - - -Create Project - [Arguments] ${project} - ${rc} ${stdout}= Run and Return RC and Output osm project-create ${project} - Should Be Equal As Integers ${rc} ${success_return_code} - log ${stdout} - [Return] ${stdout} - - -List Project - ${rc} ${stdout}= Run and Return RC and Output osm project-list - Should Be Equal As Integers ${rc} ${success_return_code} - log ${stdout} - [Return] ${stdout} - - -List Project And Verify - [Arguments] ${project} - ${project list}= List Project - Should Contain ${project list} ${project} - - -Get Project Info By Name - [Arguments] ${project_name} - ${rc} ${stdout}= Run and Return RC and Output osm project-show ${project_name} - Should Be Equal As Integers ${rc} ${success_return_code} - log ${stdout} - [Return] ${stdout} - - -Get Project Info By ID - [Arguments] ${project_id} - ${rc} ${stdout}= Run and Return RC and Output osm project-show ${project_id} - Should Be Equal As Integers ${rc} ${success_return_code} - log ${stdout} - [Return] ${stdout} - - -Update Project - [Arguments] ${project} ${feild} ${value} - ${rc} ${stdout}= Run and Return RC and Output osm project-update ${feild} ${value} ${project} - Should Be Equal As Integers ${rc} ${success_return_code} - log ${stdout} - - -Update Project Name And Verify - [Arguments] ${old_name} ${new_name} - Update Project ${old_name} --name ${new_name} - List Project And Verify ${new_name} - - -Delete Project - [Arguments] ${project} - ${rc} ${stdout}= Run and Return RC and Output osm project-delete ${project} - Should Be Equal As Integers ${rc} ${success_return_code} - - -Delete Project And Verify - [Arguments] ${project} - Delete Project ${project} - ${project_list}= List Project - Should Not Contain ${project_list} ${project} - - -Create Role - [Arguments] ${role} - ${rc} ${stdout}= Run and Return RC and Output osm role-create ${role} - Should Be Equal As Integers ${rc} ${success_return_code} - log ${stdout} - [Return] ${stdout} - - -List Roles - ${rc} ${stdout}= Run and Return RC and Output osm role-list - Should Be Equal As Integers ${rc} ${success_return_code} - log ${stdout} - [Return] ${stdout} - - -List Roles And Verify - [Arguments] ${role} - ${role_list}= List Roles - Should Contain ${role_list} ${role} - - -Get Role Info By Name - [Arguments] ${role} - ${rc} ${stdout}= Run and Return RC and Output osm role-show ${role} - Should Be Equal As Integers ${rc} ${success_return_code} - log ${stdout} - [Return] ${stdout} - - -Get Role Info By ID - [Arguments] ${role_id} - ${rc} ${stdout}= Run and Return RC and Output osm role-show ${role_id} - Should Be Equal As Integers ${rc} ${success_return_code} - log ${stdout} - [Return] ${stdout} - - -Update Role - [Arguments] ${role} ${feild} ${value} - ${rc} ${stdout}= Run and Return RC and Output osm role-update ${feild} ${value} ${role} - Should Be Equal As Integers ${rc} ${success_return_code} - log ${stdout} - - -Add Role And Verify - [Arguments] ${role} ${role_to_add} - Update Role ${role} --add ${role_to_add} - ${role_info}= Get Role Info By Name ${role} -# Should Contain ${role_info} ${role_to_add} - - -Delete Role - [Arguments] ${role} - ${rc} ${stdout}= Run and Return RC and Output osm role-delete ${role} - Should Be Equal As Integers ${rc} ${success_return_code} - - -Delete Role And Verify - [Arguments] ${role} - Delete Role ${role} - ${role_list}= List Roles - Should Not Contain ${role_list} ${role} diff --git a/robot-systest/deprecated/lib/cli/sdnc_account_lib.robot b/robot-systest/deprecated/lib/cli/sdnc_account_lib.robot deleted file mode 100644 index 71680b89..00000000 --- a/robot-systest/deprecated/lib/cli/sdnc_account_lib.robot +++ /dev/null @@ -1,65 +0,0 @@ -# -*- coding: utf-8 -*- - -## -# Copyright 2019 Tech Mahindra Limited -# -# 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. -## - - -*** Variables *** -${success_return_code} 0 -${name} "OpenSite" -${user} "admin" -${password} "admin" -${ip} "1.1.1.1" -${type} "onos" -${port} "5858" -${dpid} "a7:2f:aa:be:C3:c1:fe:C9" - - -*** Keywords *** -Create SDNC Account - [Documentation] create new sdnc account - - ${rc} ${stdout}= Run and Return RC and Output osm sdnc-create --name ${name} --type ${type} --ip_address ${ip} --user ${user} --password ${password} --port ${port} --switch_dpid ${dpid} - log ${rc} - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - - -Get SDNC List - [Documentation] Get a sdnc account list - - ${rc} ${stdout}= Run and Return RC and Output osm sdnc-list - log ${stdout} - - -Show SDNC Account - [Documentation] Get sdnc account details - - ${rc} ${stdout}= Run and Return RC and Output osm sdnc-show ${name} - log ${rc} - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - - -Delete SDNC Account - [Documentation] Get sdnc account details - - ${rc} ${stdout}= Run and Return RC and Output osm sdnc-delete ${name} - log ${rc} - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} \ No newline at end of file diff --git a/robot-systest/deprecated/lib/cli/vim_account_lib.robot b/robot-systest/deprecated/lib/cli/vim_account_lib.robot deleted file mode 100644 index c3c8242f..00000000 --- a/robot-systest/deprecated/lib/cli/vim_account_lib.robot +++ /dev/null @@ -1,136 +0,0 @@ -# -*- coding: utf-8 -*- - -## -# Copyright 2019 Tech Mahindra Limited -# -# 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. Feature 7829: Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 06-sep-2019 -## - -*** Settings *** -Library OperatingSystem -Library String -Library Collections -Library ../custom_lib.py - - -*** Variables *** -${success_return_code} 0 -${user} "robottest" -${password} "fred" -${authurl} "https://127.0.0.1/" -${type} "openstack" -${desc} "a test vim" -${tenant} "robottest2" - - -*** Keywords *** -Create Vim Account - [Documentation] Create a new vim account - - ${vim-name}= Generate Random String 8 [NUMBERS] - ${vim-name}= Catenate SEPARATOR= vim_ ${vim-name} - set global variable ${vim-name} - - ${rc} ${stdout}= Run and Return RC and Output osm vim-create --name ${vim-name} --user ${user} --password ${password} --auth_url ${authurl} --tenant ${tenant} --account_type ${type} --description ${desc} - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - - -Get Vim List - [Documentation] Get a vim account list - - ${rc} ${stdout}= Run and Return RC and Output osm vim-list - log ${stdout} - Log To Console ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - - -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} - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - - -VIM Setup To Launch Network Services - [Documentation] Setup a VIM to launch network services - - set global variable @{vim} - ${vmware_url}= Get Environment Variable VCD_AUTH_URL ${EMPTY} - ${openstack_url}= Get Environment Variable OS_AUTH_URL ${EMPTY} - ${vmware_vim}= Run Keyword And Return If '${vmware_url}'!='${EMPTY}' Setup Vmware Vim ${vmware_url} 'vmware' 'pytest system test' - ${openstack_vim}= Run Keyword And Return If '${openstack_url}'!='${EMPTY}' Setup Openstack Vim ${openstack_url} 'openstack' 'pytest system test' - Should Not Be Empty ${vim} VIM details not provided - Log Many @{vim} - - -Setup Openstack Vim - [Documentation] Openstack Vim Account Setup - [Tags] vim-setup - [Arguments] ${authurl} ${type} ${desc} - - ${user}= Get Environment Variable OS_USERNAME '' - ${password}= Get Environment Variable OS_PASSWORD '' - ${tenant}= Get Environment Variable OS_PROJECT_NAME '' - ${vim-config}= Get Environment Variable OS_VIM_CONFIG '' - ${vim_name}= GENERATE NAME - - ${rc} ${stdout}= Run and Return RC and Output osm vim-create --name ${vim_name} --user ${user} --password ${password} --auth_url ${authurl} --tenant ${tenant} --account_type ${type} --description ${desc} --config ${vim-config} - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - Sleep 30s Wait for to get vim ready - ${rc} ${vim_detail}= Run and Return RC and Output osm vim-show ${vim_name} - Should Contain ${vim_detail} "operationalState": "ENABLED" msg=Openstack vim is not available values=False - Append To List ${vim} ${stdout} - - [Return] ${stdout} - - -Setup Vmware Vim - [Documentation] Vmware Vim Account Setup - [Tags] vim-setup - [Arguments] ${authurl} ${type} ${desc} - - ${user}= Get Environment Variable VCD_USERNAME '' - ${password}= Get Environment Variable VCD_PASSWORD '' - ${tenant}= Get Environment Variable VCD_TENANT_NAME '' - ${vcd-org}= Get Environment Variable VCD_ORGANIZATION '' - ${vim-config}= Get Environment Variable VCD_VIM_CONFIG '' - ${vim_name}= GENERATE NAME - - ${rc} ${stdout}= Run and Return RC and Output osm vim-create --name ${vim_name} --user ${user} --password ${password} --auth_url ${authurl} --tenant ${tenant} --account_type ${type} --description ${desc} --config ${vim-config} - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - Sleep 30s Wait for to get vim ready - ${rc} ${vim_detail}= Run and Return RC and Output osm vim-show ${vim_name} - Should Contain ${vim_detail} "operationalState": "ENABLED" msg=VMWare VCD vim is not available values=False - Append To List ${vim} ${stdout} - - [Return] ${stdout} - - -Force Delete Vim Account - [Documentation] delete vim account details - [Arguments] ${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} diff --git a/robot-systest/deprecated/lib/cli/vnfd_lib.robot b/robot-systest/deprecated/lib/cli/vnfd_lib.robot deleted file mode 100644 index 1b99f438..00000000 --- a/robot-systest/deprecated/lib/cli/vnfd_lib.robot +++ /dev/null @@ -1,85 +0,0 @@ -# -*- coding: utf-8 -*- - -## -# Copyright 2019 Tech Mahindra Limited -# -# 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. Feature 7829: Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 06-sep-2019 -## - -*** Variables *** -${success_return_code} 0 -${delete_max_wait_time} 1min -${delete_pol_time} 15sec - - -*** Keywords *** -Get VNFDs List - [Documentation] Get vnfds list - - ${rc} ${stdout}= Run and Return RC and Output osm vnfd-list - log ${stdout} - log ${rc} - Should Be Equal As Integers ${rc} ${success_return_code} - - -Create VNFD - [Documentation] Create vnfd at osm - [Arguments] ${vnfd_pkg} - - ${rc} ${stdout}= Run and Return RC and Output osm vnfd-create ${vnfd_pkg} - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - [Return] ${stdout} - - -Delete VNFD - [Documentation] Delete vnfd - [Arguments] ${vnfd_id} - - ${rc} ${stdout}= Run and Return RC and Output osm vnfd-delete ${vnfd_id} - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - WAIT UNTIL KEYWORD SUCCEEDS ${delete_max_wait_time} ${delete_pol_time} Check For VNFD ${vnfd_id} - - -Check For VNFD - [Arguments] ${vnfd_id} - - ${rc} ${stdout}= Run and Return RC and Output osm vnfd-list - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - Should Not Contain ${stdout} ${vnfd_id} - - -Force Delete VNFD - [Documentation] Forcely Delete vnfd - [Arguments] ${vnfd_id} - - ${rc} ${stdout}= Run and Return RC and Output osm vnfd-delete ${vnfd_id} - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - - -Build VNF Descriptor - [Documentation] Build VNF Descriptor from the descriptor-packages - [Arguments] ${vnfd path} - - ${rc} ${stdout}= Run and Return RC and Output make -C '${CURDIR}${/}../../..${vnfd path}' - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} diff --git a/robot-systest/deprecated/lib/client_lib/client_lib.py b/robot-systest/deprecated/lib/client_lib/client_lib.py deleted file mode 100644 index c9390ae9..00000000 --- a/robot-systest/deprecated/lib/client_lib/client_lib.py +++ /dev/null @@ -1,69 +0,0 @@ -## -# Copyright 2019 Tech Mahindra Limited -# -# 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. -## - - -from osmclient import client -from robot.api import logger -import json - - -class ClientLib: - def __init__(self, host="127.0.0.1", user=None, password=None, project=None): - - kwargs = {} - if user is not None: - kwargs['user'] = user - if password is not None: - kwargs['password'] = password - if project is not None: - kwargs['project'] = project - self.client = client.Client(host=host, sol005=True, **kwargs) - - def get_vim_list(self): - resp = self.client.vim.list() - logger.info('VIM List: {}'.format(resp)) - return json.dumps(resp) - - def create_vim_account(self, name, vim_type, user, password, auth_url, tenant, desc='', config=None): - vim_access = {} - if config is not None: - vim_access['config'] = config - vim_access['vim-type'] = vim_type - vim_access['vim-username'] = user - vim_access['vim-password'] = password - vim_access['vim-url'] = auth_url - vim_access['vim-tenant-name'] = tenant - vim_access['description'] = desc - - resp = self.client.vim.create(name, vim_access) - logger.info('Create VIM Account: {}'.format(resp)) - return json.dumps(resp) - - def delete_vim_account(self, name): - resp = self.client.vim.delete(name) - return json.dumps(resp) - - def get_vnfd_list(self): - resp = self.client.vnfd.list() - logger.info('VNF Descriptor List: {}'.format(resp)) - return json.dumps(resp) - - def get_nsd_list(self): - resp = self.client.nsd.list() - logger.info('NS Descriptor List: {}'.format(resp)) - return json.dumps(resp) diff --git a/robot-systest/deprecated/lib/custom_lib.py b/robot-systest/deprecated/lib/custom_lib.py deleted file mode 100644 index 2a3d23fa..00000000 --- a/robot-systest/deprecated/lib/custom_lib.py +++ /dev/null @@ -1,67 +0,0 @@ -# -*- coding: utf-8 -*- - -## -# Copyright 2019 Tech Mahindra Limited -# -# 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: -# Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com -##̥ - - -import random -from haikunator import Haikunator -import yaml -from os.path import basename -import hashlib - -from robot.api import logger -from robot.api.deco import keyword - - -def generate_name(): - haikunator = Haikunator() - name = haikunator.haikunate(delimiter='_', token_length=2) - return name - - -def get_random_item_from_list(l): - assert isinstance(l, list), "List should be provided" - return random.choice(l) - - -def get_scaled_vnf(nsr): - nsr = yaml.load(nsr) - if 'scaling-group' in nsr['_admin']: - return nsr['_admin']['scaling-group'][0]['nb-scale-op'] - else: - return 0 - - -@keyword('Get File Name From Path') -def get_filename(path): - filename = basename(path) - return filename, filename.split('.')[0] - - -@keyword('Generate MD5') -def generate_md5(fpath): - hash_md5 = hashlib.md5() - with open(fpath, "rb") as f: - for chunk in iter(lambda: f.read(1024), b""): - hash_md5.update(chunk) - return hash_md5.hexdigest() diff --git a/robot-systest/deprecated/lib/gui/login_gui.robot b/robot-systest/deprecated/lib/gui/login_gui.robot deleted file mode 100644 index c125664f..00000000 --- a/robot-systest/deprecated/lib/gui/login_gui.robot +++ /dev/null @@ -1,87 +0,0 @@ -# -*- coding: utf-8 -*- - -## -# Copyright 2019 Tech Mahindra Limited -# -# 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. Feature 7829: Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 06-aug-2019 : Improvement to the code, robot framework initial seed code. -## - - -*** Variables *** -${DESIRED_CAPABILITIES} desired_capabilities -${BROWSER} Chrome -${DELAY} 0 -${VALID USER} admin -${VALID PASSWORD} admin -${LOGIN URL} /auth/ -${WELCOME URL} /projects/ -${NS LIST URL} /packages/ns/list -${VNF LIST URL} /packages/vnf/list - - -*** Keywords *** -Set Server URL - ${env_host}= Get Environment Variable OSM_HOSTNAME - ${passed}= Run Keyword And Return Status Should Contain ${env_host} : - Run Keyword If ${passed} Set Dockerized Host - ... ELSE Set Standalone Host ${env_host} - - -Open Browser To Login Page - ${chrome_options} = Evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys, selenium.webdriver - Call Method ${chrome_options} add_argument headless - Call Method ${chrome_options} add_argument disable-gpu - Call Method ${chrome_options} add_argument no-sandbox - ${options}= Call Method ${chrome_options} to_capabilities - Open Browser ${SERVER}${LOGIN URL} ${BROWSER} desired_capabilities=${options} - Maximize Browser Window - Set Selenium Speed ${DELAY} - Login Page Should Be Open - - -Login Page Should Be Open - Element Text Should Be //*[@id="main_content"]/div/div[2]/p Sign in to start your session - - -Enter Credentials - [Arguments] ${username} ${password} - Input Text name:username ${username} - Input Password name:password ${password} - - -Submit Credentials - Click Button //*[@id="main_content"]/div/div[2]/form/div[3]/div[2]/button - - -Home Page Should Be Open - Location Should Be ${SERVER}${WELCOME URL} -# Element Should Contain id:title_header 6e3a8415-9014-4100-9727-90e0150263be ignore_case=True - Element Attribute Value Should Be //*[@id="main_content"]/div/div[2]/div[1]/div[1]/div/a href ${SERVER}${NS LIST URL} - Element Attribute Value Should Be //*[@id="main_content"]/div/div[2]/div[1]/div[2]/div/a href ${SERVER}${VNF LIST URL} - - -Set Dockerized Host - - Set Suite Variable ${SERVER} http://light-ui - - -Set Standalone Host - [Arguments] ${env_host} - - Set Suite Variable ${SERVER} http://${env_host} diff --git a/robot-systest/deprecated/resource/api/common.robot b/robot-systest/deprecated/resource/api/common.robot deleted file mode 100644 index 9342316a..00000000 --- a/robot-systest/deprecated/resource/api/common.robot +++ /dev/null @@ -1,46 +0,0 @@ -# -*- coding: utf-8 -*- - -## -# Copyright 2019 Tech Mahindra Limited -# -# 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. Feature 7829: Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com -## - - -*** Variables *** -&{HEADERS} Content-Type=application/json Accept=application/json -&{data} username=admin password=admin project-id=admin -@{success_status_code_list} 200 201 202 204 - -${descriptor_content_type_gzip} application/gzip - -${auth_token_uri} /osm/admin/v1/tokens - -${get_all_vnfd_uri} /osm/vnfpkgm/v1/vnf_packages -${create_vnfd_uri} /osm/vnfpkgm/v1/vnf_packages_content -${delete_vnfd_uri} /osm/vnfpkgm/v1/vnf_packages - -${get_all_nsd_uri} /osm/nsd/v1/ns_descriptors -${create_nsd_uri} /osm/nsd/v1/ns_descriptors_content -${delete_nsd_uri} /osm/nsd/v1/ns_descriptors - -${base_ns_uri} /osm/nslcm/v1/ns_instances_content -${create_ns_uri} /osm/nslcm/v1/ns_instances_content - -${create_vim_uri} /osm/admin/v1/vim_accounts diff --git a/robot-systest/deprecated/resource/api/variables.py b/robot-systest/deprecated/resource/api/variables.py deleted file mode 100644 index a97763a4..00000000 --- a/robot-systest/deprecated/resource/api/variables.py +++ /dev/null @@ -1,33 +0,0 @@ -# -*- coding: utf-8 -*- - -## -# Copyright 2019 Tech Mahindra Limited -# -# 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. Feature 7829: Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 06-sep-2019 -## - - -# Create/Delete Vim Account -vim_name = 'API-TEST-VIM' -account_type = 'openstack' -auth_url = 'http://127.0.0.1:5000/v3' -user = 'admin' -password = 'admin' -tenant = 'admin' -description = 'Test OpenStack Vim Account' diff --git a/robot-systest/deprecated/resource/cli/disable_port_security_ns_data.py b/robot-systest/deprecated/resource/cli/disable_port_security_ns_data.py deleted file mode 100644 index e1383bd4..00000000 --- a/robot-systest/deprecated/resource/cli/disable_port_security_ns_data.py +++ /dev/null @@ -1,29 +0,0 @@ -# -*- coding: utf-8 -*- - -## -# Copyright 2020 Tech Mahindra Limited -# -# 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. -# Author: Mrityunjay Yadav < MY00514913@techmahindra.com >, Jayant Madavi -## - - -# VNFD Details -vnfdPckgPath = "/descriptor-packages/vnfd/hackfest_basic_vnf" -vnfdPckg = '/build/hackfest_basic_vnf.tar.gz' - -# NSD Details -nsdPckgPath = "/descriptor-packages/nsd/no_port_security_ns" -nsdPckg = '/build/no_port_security_ns.tar.gz' diff --git a/robot-systest/deprecated/resource/cli/hackfest_basic_ns_data.py b/robot-systest/deprecated/resource/cli/hackfest_basic_ns_data.py deleted file mode 100644 index 8b8054b8..00000000 --- a/robot-systest/deprecated/resource/cli/hackfest_basic_ns_data.py +++ /dev/null @@ -1,32 +0,0 @@ -# -*- coding: utf-8 -*- - -## -# Copyright 2019 Tech Mahindra Limited -# -# 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. Feature 7829: Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 06-aug-2019 : Improvement to the code, robot framework initial seed code. -## - - -# VNFD Details -vnfdPckgPath = "/descriptor-packages/vnfd/hackfest_basic_vnf" -vnfdPckg = '/build/hackfest_basic_vnf.tar.gz' - -# NSD Details -nsdPckgPath = "/descriptor-packages/nsd/hackfest_basic_ns" -nsdPckg = '/build/hackfest_basic_ns.tar.gz' diff --git a/robot-systest/deprecated/resource/cli/hackfest_cloudinit_ns_data.py b/robot-systest/deprecated/resource/cli/hackfest_cloudinit_ns_data.py deleted file mode 100644 index d725a36a..00000000 --- a/robot-systest/deprecated/resource/cli/hackfest_cloudinit_ns_data.py +++ /dev/null @@ -1,32 +0,0 @@ -# -*- coding: utf-8 -*- - -## -# Copyright 2019 Tech Mahindra Limited -# -# 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. Feature 7829: Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 06-aug-2019 : Improvement to the code, robot framework initial seed code. -## - - -# VNFD Details -vnfdPckgPath = "/descriptor-packages/vnfd/hackfest_cloudinit_vnf" -vnfdPckg = '/build/hackfest_cloudinit_vnf.tar.gz' - -# NSD Details -nsdPckgPath = "/descriptor-packages/nsd/hackfest_cloudinit_ns" -nsdPckg = '/build/hackfest_cloudinit_ns.tar.gz' diff --git a/robot-systest/deprecated/resource/cli/hackfest_epa_ns_data.py b/robot-systest/deprecated/resource/cli/hackfest_epa_ns_data.py deleted file mode 100644 index 8975e31f..00000000 --- a/robot-systest/deprecated/resource/cli/hackfest_epa_ns_data.py +++ /dev/null @@ -1,32 +0,0 @@ -# -*- coding: utf-8 -*- - -## -# Copyright 2019 Tech Mahindra Limited -# -# 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. Feature 7829: Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 06-aug-2019 : Improvement to the code, robot framework initial seed code. -## - - -# VNFD Details -vnfdPckgPath = "/descriptor-packages/vnfd/hackfest_epasriov_vnf" -vnfdPckg = '/build/hackfest_epasriov_vnf.tar.gz' - -# NSD Details -nsdPckgPath = "/descriptor-packages/nsd/hackfest_epasriov_ns" -nsdPckg = '/build/hackfest_epasriov_ns.tar.gz' diff --git a/robot-systest/deprecated/resource/cli/hackfest_multivdu_ns_data.py b/robot-systest/deprecated/resource/cli/hackfest_multivdu_ns_data.py deleted file mode 100644 index 5ecb9e84..00000000 --- a/robot-systest/deprecated/resource/cli/hackfest_multivdu_ns_data.py +++ /dev/null @@ -1,32 +0,0 @@ -# -*- coding: utf-8 -*- - -## -# Copyright 2019 Tech Mahindra Limited -# -# 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. Feature 7829: Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 06-aug-2019 : Improvement to the code, robot framework initial seed code. -## - - -# VNFD Details -vnfdPckgPath = "/descriptor-packages/vnfd/hackfest_multivdu_vnf" -vnfdPckg = '/build/hackfest_multivdu_vnf.tar.gz' - -# NSD Details -nsdPckgPath = "/descriptor-packages/nsd/hackfest_multivdu_ns" -nsdPckg = '/build/hackfest_multivdu_ns.tar.gz' diff --git a/robot-systest/deprecated/resource/cli/hackfest_simplecharm_ns_data.py b/robot-systest/deprecated/resource/cli/hackfest_simplecharm_ns_data.py deleted file mode 100644 index 5ffcd35b..00000000 --- a/robot-systest/deprecated/resource/cli/hackfest_simplecharm_ns_data.py +++ /dev/null @@ -1,32 +0,0 @@ -# -*- coding: utf-8 -*- - -## -# Copyright 2019 Tech Mahindra Limited -# -# 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. Feature 7829: Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 06-aug-2019 : Improvement to the code, robot framework initial seed code. -## - - -# VNFD Details -vnfdPckgPath = "/descriptor-packages/vnfd/hackfest_simplecharm_vnf" -vnfdPckg = '/build/hackfest_simplecharm_vnf.tar.gz' - -# NSD Details -nsdPckgPath = "/descriptor-packages/nsd/hackfest_simplecharm_ns" -nsdPckg = '/build/hackfest_simplecharm_ns.tar.gz' diff --git a/robot-systest/deprecated/resource/cli/test_vnf_data.py b/robot-systest/deprecated/resource/cli/test_vnf_data.py deleted file mode 100644 index 02ee065a..00000000 --- a/robot-systest/deprecated/resource/cli/test_vnf_data.py +++ /dev/null @@ -1,32 +0,0 @@ -# -*- coding: utf-8 -*- - -## -# Copyright 2019 Tech Mahindra Limited -# -# 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. Feature 7829: Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com -## - - -# VNFD Details -vnfdPckgPath = "/descriptor-packages/vnfd/cirros_vnf" -vnfdPckg = '/build/cirros_vnf.tar.gz' - -# NSD Details -nsdPckgPath = "/descriptor-packages/nsd/cirros_ns" -nsdPckg = '/build/cirros_ns.tar.gz' diff --git a/robot-systest/deprecated/resource/cli/ubuntu-cloudinit_ns_data.py b/robot-systest/deprecated/resource/cli/ubuntu-cloudinit_ns_data.py deleted file mode 100644 index ce680372..00000000 --- a/robot-systest/deprecated/resource/cli/ubuntu-cloudinit_ns_data.py +++ /dev/null @@ -1,30 +0,0 @@ -# -*- coding: utf-8 -*- - -## -# Copyright 2019 TATA ELXSI -# -# 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. -## - -## -# Author: Ragavi D (ragavi.d@tataelxsi.co.in) - -# VNFD Details -vnfdPckgPath = "/descriptor-packages/vnfd/ubuntu-cloudinit_vnf" -vnfdPckg = '/build/ubuntu-cloudinit_vnf.tar.gz' - -# NSD Details -nsdPckgPath = "/descriptor-packages/nsd/ubuntu-cloudinit_ns" -nsdPckg = '/build/ubuntu-cloudinit_ns.tar.gz' diff --git a/robot-systest/deprecated/run_test.sh b/robot-systest/deprecated/run_test.sh deleted file mode 100644 index 3f86ff9c..00000000 --- a/robot-systest/deprecated/run_test.sh +++ /dev/null @@ -1,109 +0,0 @@ -#!/usr/bin/env bash - -## -# Copyright 2019 Tech Mahindra Limited -# -# 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. Feature 7829: Mrityunjay Yadav, Jayant Madavi : MY00514913@techmahindra.com : 06-Sep-2019 -# Entry script to start the vim, smoke, openstack_stage_4 and comprehensive test using Robot Framework as a Automation Test Framework -## - -BASEDIR=$(dirname "$0") -TOPDIR=$(dirname "$BASEDIR") -DESCRIPTOR_DIR=$TOPDIR/descriptor-packages - - -robot_prerequisite(){ - echo -e "\nInstalling robot requirements" - # installing python packages - pip install haikunator requests robotframework robotframework-seleniumlibrary robotframework-requests robotframework-jsonlibrary -} - -while getopts ":t:-:" o; do - case "${o}" in - t) - TEST=${OPTARG} - ;; - -) - [[ "${OPTARG}" == "do_install" ]] && robot_prerequisite && continue - ;; - \?) - echo -e "Invalid option: '-$OPTARG'\n" >&2 - exit 1 - ;; - esac -done - -if [[ -z $TEST ]]; then - printf "Test not provided. \nRunning default test: smoke\n" - TEST="smoke" -fi - -if [[ "$TEST" == "vim" ]]; then - echo "Robot Framework Vim Test" - robot -d $BASEDIR/reports -i vim $BASEDIR/testsuite/ - exit 0 -elif [[ "$TEST" == "smoke" ]]; then - echo "Robot Framework SMOKE test" - robot --removekeywords tag:vim-setup --removekeywords WUKS -d $BASEDIR/reports -i smoke $BASEDIR/testsuite/ - exit 0 -elif [[ "$TEST" == "sanity" ]]; then - echo "Robot Framework Cirros VNF Test" - mkdir -p $BASEDIR/images/cache - if [[ ! -z $OS_AUTH_URL ]]; then - (openstack image show cirros-0.3.5-x86_64-disk.img) || (wget -r -nc http://download.cirros-cloud.net/0.3.5/cirros-0.3.5-x86_64-disk.img -O $BASEDIR/images/cache/cirros-0.3.5-x86_64-disk.img && make $BASEDIR/images/cache/cirros-0.3.5-x86_64-disk.img && openstack image create --file $BASEDIR/images/cache/cirros-0.3.5-x86_64-disk.img cirros-0.3.5-x86_64-disk.img) - fi - if [[ ! -z $VCD_AUTH_URL ]]; then -# TODO: Check for image over VIM before downloading - if [[ ! -s $BASEDIR/images/cache/cirros-0.3.5-x86_64-disk.img ]]; then - wget -r -nc http://download.cirros-cloud.net/0.3.5/cirros-0.3.5-x86_64-disk.img -O $BASEDIR/images/cache/cirros-0.3.5-x86_64-disk.img - fi - ovf_converter $BASEDIR/images/cache/cirros-0.3.5-x86_64-disk.img -n cirros - python $TOPDIR/tools/vmware_ovf_upload.py $VCD_AUTH_URL $VCD_USERNAME $VCD_PASSWORD $VCD_ORGANIZATION $BASEDIR/images/cache/cirros.ovf - fi - robot --removekeywords tag:vim-setup --removekeywords WUKS -d $BASEDIR/reports -i sanity $BASEDIR/testsuite/ - exit 0 -elif [[ "$TEST" == "comprehensive" ]]; then - echo "Robot Framework Comprehensive Test" - echo "Installing chrome driver and chrome for UI testing" - # installing chrome driver and chrome for UI testing - curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - - echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list - apt-get update && apt-get -y install google-chrome-stable chromium-chromedriver - echo "Checking of image over VIMs" - mkdir -p $BASEDIR/images/cache - if [[ ! -z $OS_AUTH_URL ]]; then - (openstack image show ubuntu1604) || (wget -r -nc https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img -O $BASEDIR/images/cache/xenial-server-cloudimg-amd64-disk1.img && make $BASEDIR/images/cache/xenial-server-cloudimg-amd64-disk1.img && openstack image create --file $BASEDIR/images/cache/xenial-server-cloudimg-amd64-disk1.img ubuntu1604) - (openstack image show hackfest3-mgmt) || (wget -r -nc https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img -O $BASEDIR/images/cache/xenial-server-cloudimg-amd64-disk1.img && make $BASEDIR/images/cache/xenial-server-cloudimg-amd64-disk1.img && openstack image create --file $BASEDIR/images/cache/xenial-server-cloudimg-amd64-disk1.img hackfest3-mgmt) - fi - if [[ ! -z $VCD_AUTH_URL ]]; then -# TODO: Check for image over VIM before downloading - if [[ ! -s $BASEDIR/images/cache/xenial-server-cloudimg-amd64-disk1.img ]]; then - wget -r -nc https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img -O $BASEDIR/images/cache/xenial-server-cloudimg-amd64-disk1.img - fi - ovf_converter $BASEDIR/images/cache/xenial-server-cloudimg-amd64-disk1.img -n ubuntu1604 - python $TOPDIR/tools/vmware_ovf_upload.py $VCD_AUTH_URL $VCD_USERNAME $VCD_PASSWORD $VCD_ORGANIZATION $BASEDIR/images/cache/ubuntu1604.ovf - fi - robot --removekeywords tag:vim-setup --removekeywords WUKS -d $BASEDIR/reports -i comprehensive $BASEDIR/testsuite/ - exit 0 -else - echo "wrong test provided" - exit 1 -fi - -exit 1 diff --git a/robot-systest/deprecated/testsuite/api/TS01__Vim_Account.robot b/robot-systest/deprecated/testsuite/api/TS01__Vim_Account.robot deleted file mode 100644 index be04c3fd..00000000 --- a/robot-systest/deprecated/testsuite/api/TS01__Vim_Account.robot +++ /dev/null @@ -1,54 +0,0 @@ -# -*- coding: utf-8 -*- - -## -# Copyright 2019 Tech Mahindra Limited -# -# 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. Feature 7829: Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 06-aug-2019 : Improvement to the code, robot framework initial seed code. -## - - -*** Settings *** -Documentation Test Suite to create and delete vim account -Library Collections -Library RequestsLibrary -Library OperatingSystem -Resource ../../lib/api/common.robot -Resource ../../lib/api/vim_lib.robot -Resource ../../resource/api/common.robot -Variables ../../resource/api/variables.py - -Suite Setup Get Auth Token -Suite Teardown Delete All Sessions - - -*** Variables *** -${vim_id} ${EMPTY} - - -*** Test Cases *** -Create Vim Account - [Tags] comprehensive api_vim_test - [Template] Create Vim - ${vim name} ${account type} ${auth url} ${user} ${password} ${tenant} ${description} - - -Delete Vim Account - [Tags] comprehensive api_vim_test - [Template] Delete Vim - ${vim_id} diff --git a/robot-systest/deprecated/testsuite/cli/TS008__Test_SDNC.robot b/robot-systest/deprecated/testsuite/cli/TS008__Test_SDNC.robot deleted file mode 100644 index 3b2b21ae..00000000 --- a/robot-systest/deprecated/testsuite/cli/TS008__Test_SDNC.robot +++ /dev/null @@ -1,45 +0,0 @@ -# -*- coding: utf-8 -*- - -## -# Copyright 2019 Tech Mahindra Limited -# -# 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. -## - - -*** Settings *** -Documentation Test suiet to create/delete sdnc account via osmclient -Library OperatingSystem -Library Collections -Resource ../../lib/cli/sdnc_account_lib.robot - - -*** Test Cases *** -Create SDNC Account Test - [Tags] sdnc - - Create SDNC Account - - -Get SDNC Accounts List Test - [Tags] sdnc - - Get SDNC List - - -Delete SDNC Account Test - [Tags] sdnc - - Delete SDNC Account diff --git a/robot-systest/deprecated/testsuite/cli/TS009__Feature_6283_Network_Slicing_Test.robot b/robot-systest/deprecated/testsuite/cli/TS009__Feature_6283_Network_Slicing_Test.robot deleted file mode 100644 index fa8c44a4..00000000 --- a/robot-systest/deprecated/testsuite/cli/TS009__Feature_6283_Network_Slicing_Test.robot +++ /dev/null @@ -1,117 +0,0 @@ -# -*- coding: utf-8 -*- - -## -# Copyright 2019 Tech Mahindra Limited -# -# 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 : 08-nov-2019 : network slicing test library -## - - -*** Settings *** -Documentation Test Suite to create hackfest basic nestwork service -Library OperatingSystem -Library String -Library Collections -Resource ../../lib/cli/vnfd_lib.robot -Resource ../../lib/cli/nsd_lib.robot -Resource ../../lib/cli/vim_account_lib.robot -Resource ../../lib/cli/network_slicing_lib.robot -Library ../../lib/custom_lib.py - -Suite Teardown Run Keyword And Ignore Error Test Cleanup - - -*** Variables *** -${vnfd_id} -@{vnfd_ids} -${nsd_id} -@{nsd_ids} -${nst_id} -@{nsi_list} -${vnfdPckg} slice_hackfest_vnfd.tar.gz -${nsdPckg} slice_hackfest_nsd.tar.gz -${nstPckg} slice_hackfest_nst.yaml -${vnfdftpPath} https://osm-download.etsi.org/ftp/osm-5.0-five/6th-hackfest/packages/slice_hackfest_vnfd.tar.gz -${nsdftpPath} https://osm-download.etsi.org/ftp/osm-5.0-five/6th-hackfest/packages/slice_hackfest_nsd.tar.gz -${nstftpPath} https://osm-download.etsi.org/ftp/osm-5.0-five/6th-hackfest/packages/slice_hackfest_nst.yaml -${nst_config} '{netslice-vld: [{name: mgmtnet, vim-network-name: mgmt}]}' - - -*** Test Cases *** -Create Slice Hackfest VNF Descriptor - [Tags] slice_hackfest comprehensive - [Documentation] Create Slice Hackfest VNF Descriptor Test - - ${rc} ${stdout}= Run and Return RC and Output wget -P '${CURDIR}${/}../../resource/cli/slice/' ${vnfdftpPath} - ${vnfd_id}= Create VNFD '${CURDIR}${/}../../resource/cli/slice${/}${vnfdPckg}' - Append To List ${vnfd_ids} ${vnfd_id} - - -Create Slice Hackfest NS Descriptor - [Tags] slice_hackfest comprehensive - [Documentation] Create Slice Hackfest NS Descriptor Test - - ${rc} ${stdout}= Run and Return RC and Output wget -P '${CURDIR}${/}../../resource/cli/slice/' ${nsdftpPath} - ${nsd_id}= Create NSD '${CURDIR}${/}../../resource/cli/slice${/}${nsdPckg}' - Append To List ${nsd_ids} ${nsd_id} - - -Create Slice Hackfest Network Slice Template - [Tags] slice_hackfest comprehensive - [Documentation] Create Slice Hackfest Network Slice Template Test - -# set suite variable ${nst_id} - ${rc} ${stdout}= Run and Return RC and Output wget -P '${CURDIR}${/}../../resource/cli/slice/' ${nstftpPath} - ${nst_id}= Create NST '${CURDIR}${/}../../resource/cli/slice${/}${nstPckg}' - Set Suite Variable ${nst_id} - - -Instanciate Network Slice - [Tags] slice_hackfest comprehensive - [Documentation] Instantiate Network Slice Test - - :FOR ${vim_name} IN @{vim} - \ Launch Network Slice Instance ${vim_name} ${nst_id} ${nst_config} - - -Terminate Network Slice Instance - [Tags] slice_hackfest comprehensive - [Documentation] Terminate Network Slice Instance Test - - :FOR ${nsi} IN @{nsi_list} - \ Delete Network Slice Instance ${nsi} - - -*** Keywords *** -Test Cleanup - [Documentation] Test Suit Cleanup: delete NST, NSD and VNFD - - Delete NST ${nst_id} - -# :FOR ${nsi} IN @{nsi_list} -# \ Delete Network Slice Instance ${nsi} - - :FOR ${nsd} IN @{nsd_ids} - \ Delete NSD ${nsd} - - :FOR ${vnfd} IN @{vnfd_ids} - \ Delete VNFD ${vnfd} - -# :FOR ${vim_id} IN @{vim} -# \ Delete Vim Account ${vim_id} diff --git a/robot-systest/deprecated/testsuite/cli/TS010__OSM_Platform_Resiliency_and_Recovery_Test.robot b/robot-systest/deprecated/testsuite/cli/TS010__OSM_Platform_Resiliency_and_Recovery_Test.robot deleted file mode 100644 index 2475e740..00000000 --- a/robot-systest/deprecated/testsuite/cli/TS010__OSM_Platform_Resiliency_and_Recovery_Test.robot +++ /dev/null @@ -1,62 +0,0 @@ -# -*- coding: utf-8 -*- - -## -# Copyright 2019 Tech Mahindra Limited -# -# 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 : 08-nov-2019 : network slicing test library -## - - -*** Settings *** -Library OperatingSystem -Library String -Library Collections -Resource ../../lib/cli/osm_platform_resiliancy_recovery_lib.robot -Library ../../lib/custom_lib.py - - -*** Variables *** -${max_wait_time} 5min -${pol_time} 30sec -@{components} osm_keystone.1 osm_lcm.1 osm_light-ui.1 osm_mon.1 osm_mongo.1 osm_nbi.1 osm_pol.1 osm_prometheus.1 osm_ro.1 osm_kafka.1 osm_zookeeper.1 osm_mysql.1 - - -*** Test Cases *** -Feature 1413 - OSM platform resiliency to single component failure - [Tags] platform resiliency - [Documentation] OSM platform resiliency test - - ${name}= Get Random Item From List ${components} - Check If OSM Working - WAIT UNTIL KEYWORD SUCCEEDS 2x 30sec Check All Service Are Running - Kill Docker Container ${name} - WAIT UNTIL KEYWORD SUCCEEDS ${max_wait_time} ${pol_time} Check All Service Are Running - Check If OSM Working - - -Feature 1412 - OSM platform recovery after major failure - [Tags] platform recovery - [Documentation] OSM platform recovery - - Check If OSM Working - WAIT UNTIL KEYWORD SUCCEEDS 2x 30sec Check All Service Are Running - :FOR ${component} IN @{components} - \ Kill Docker Container ${component} - WAIT UNTIL KEYWORD SUCCEEDS ${max_wait_time} ${pol_time} Check All Service Are Running - Check If OSM Working diff --git a/robot-systest/deprecated/testsuite/cli/TS011__Feature_1415_RBAC_For_Platform_Test.robot b/robot-systest/deprecated/testsuite/cli/TS011__Feature_1415_RBAC_For_Platform_Test.robot deleted file mode 100644 index c8e44e15..00000000 --- a/robot-systest/deprecated/testsuite/cli/TS011__Feature_1415_RBAC_For_Platform_Test.robot +++ /dev/null @@ -1,106 +0,0 @@ -## -# Copyright 2019 Tech Mahindra Limited -# -# 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 : 21-nov-2019 -## - -*** Settings *** -Documentation Test RBAC for platform using CRUD operations over users, projects and roles -Library OperatingSystem -Library String -Library Collections -Resource ../../lib/cli/rbac_lib.robot - -#Suite Setup Configure NBI For RBAC -Suite Teardown Run Keyword And Ignore Error Test Cleanup - - -*** Variables *** -${success_return_code} 0 -# Test data for Users Operations test -${user_id} ${EMPTY} -&{update_field1} --set-project=admin,system_admin,project_admin #project,role1,role2... -&{update_field2} --add-project-role=admin,project_user #project,role1,role2... -&{update_field3} --add-project-role=service,account_manager #project,role1,role2... -@{update_user} ${update_field1} ${update_field2} ${update_field3} -# Test data for Project Operations test -${project_id} ${EMPTY} -# Test data for Role Operations test -${role_id} ${EMPTY} -${role_to_add} "vims: true" - - -*** Test Cases *** -Test User Operations - [Documentation] Test RBAC using CRUD operation over users - [Tags] rabc rabc_users comprehensive - - ${user-name}= Generate Random String 8 [NUMBERS] - ${user-name}= Catenate SEPARATOR= user_ ${user-name} - set global variable ${user-name} - ${user-password}= Generate Random String 8 [NUMBERS] - set global variable ${user-password} - ${user_id}= Create User ${user-name} ${user-password} - List User And Check For The Created User ${user-name} - Get User Info By Name ${user-name} - Get User Info By ID ${user_id} - Update User And Verify Info ${user-name} @{update_user} - Login With User And Perform Operation ${user-name} ${user-password} admin - Delete User And Check ${user-name} - - -Test Project Operatios - [Documentation] Test RBAC using CRUD operation over projects - [Tags] rabc rabc_projects comprehensive - - ${project-name}= Generate Random String 8 [NUMBERS] - ${project-name}= Catenate SEPARATOR= project_ ${project-name} - set global variable ${project-name} - ${project_id}= Create Project ${project-name} - List Project And Verify ${project-name} - Get Project Info By Name ${project-name} - Get Project Info By ID ${project_id} - ${new-project-name}= Generate Random String 8 [NUMBERS] - ${new-project-name}= Catenate SEPARATOR= project_ ${new-project-name} - set global variable ${new-project-name} - Update Project Name And Verify ${project-name} ${new-project-name} - Delete Project And Verify ${new-project-name} - - -Test Role Operations - [Documentation] Test RBAC using CRUD operation over roles - [Tags] rabc rabc_roles comprehensive - - ${role-name}= Generate Random String 8 [NUMBERS] - ${role-name}= Catenate SEPARATOR= project_ ${role-name} - set global variable ${role-name} - ${role_id}= Create Role ${role-name} - List Roles And Verify ${role-name} - Get Role Info By Name ${role-name} - Get Role Info By ID ${role_id} - Add Role And Verify ${role-name} ${role_to_add} - Delete Role And Verify ${role-name} - - -*** Keywords *** -Test Cleanup - Delete User ${user-name} - Delete Project ${project-name} - Delete Project ${new-project-name} - Delete Role ${role-name} \ No newline at end of file diff --git a/robot-systest/deprecated/testsuite/cli/TS012__Feature_7181_Allow_Instantiation_Parameters_in_CloudInit.robot b/robot-systest/deprecated/testsuite/cli/TS012__Feature_7181_Allow_Instantiation_Parameters_in_CloudInit.robot deleted file mode 100644 index c5e1c75d..00000000 --- a/robot-systest/deprecated/testsuite/cli/TS012__Feature_7181_Allow_Instantiation_Parameters_in_CloudInit.robot +++ /dev/null @@ -1,87 +0,0 @@ -# -*- coding: utf-8 -*- - -## -# Copyright 2019 TATA ELXSI -# -# 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. -## - -## Author: Ragavi D (ragavi.d@tataelxsi.co.in) - -*** Settings *** -Documentation Test Suite to create hackfest basic nestwork service -Suite Teardown Run Keyword And Ignore Error Test Cleanup -Library OperatingSystem -Library String -Library Collections -Resource ../../lib/cli/vnfd_lib.robot -Resource ../../lib/cli/nsd_lib.robot -Resource ../../lib/cli/ns_lib.robot -Resource ../../lib/cli/vim_account_lib.robot -Library ../../lib/custom_lib.py -Variables ../../resource/cli/ubuntu-cloudinit_ns_data.py - -*** Variables *** -@{vnfd_ids} -${nsd_id} ${EMPTY} -@{nsd_ids} -@{ns_ids} -${ns_config} '{vld: [ {name: mgmtnet, vim-network-name: osm-ext} ], additionalParamsForVnf: [ { member-vnf-index: "1", additionalParams: { password: "PASSWORD" } } ] }' - -*** Test Cases *** -Create Ubuntu CloudInit VNF Descriptor - [Tags] comprehensive ubuntu-cloudinit_ns - Build VNF Descriptor ${vnfdPckgPath} - ${vnfd_id}= Create VNFD '${CURDIR}${/}../../..${vnfdPckgPath}${vnfdPckg}' - Append To List ${vnfd_ids} ${vnfd_id} - -Create Ubuntu CloudInit NS Descriptor - [Tags] comprehensive ubuntu-cloudinit_ns - Build NS Descriptor ${nsdPckgPath} - ${nsd_id}= Create NSD '${CURDIR}${/}../../..${nsdPckgPath}${nsdPckg}' - Append To List ${nsd_ids} ${nsd_id} - -Network Service Instance Test - [Documentation] Launch and terminate network services - [Tags] comprehensive ubuntu-cloudinit_ns - : FOR ${vim_name} IN @{vim} - \ Launch Network Services and Return ${vim_name} ${ns_config} - -Delete NS Instance Test - [Tags] comprehensive ubuntu-cloudinit_ns - : FOR ${ns} IN @{ns_ids} - \ Delete NS ${ns} - -Delete NS Descriptor Test - [Tags] comprehensive ubuntu-cloudinit_ns - : FOR ${nsd} IN @{nsd_ids} - \ Delete NSD ${nsd} - -Delete VNF Descriptor Test - [Tags] comprehensive ubuntu-cloudinit_ns - : FOR ${vnfd_id} IN @{vnfd_ids} - \ Delete VNFD ${vnfd_id} - -*** Keywords *** -Test Cleanup - [Documentation] Test Suit Cleanup: Deliting Descriptor, instance and vim - : FOR ${ns} IN @{ns_ids} - \ Delete NS ${ns} - : FOR ${nsd} IN @{nsd_ids} - \ Delete NSD ${nsd} - : FOR ${vnfd} IN @{vnfd_ids} - \ Delete VNFD ${vnfd} - # :FOR ${vim_id} IN @{vim} - # Delete Vim Account ${vim_id} diff --git a/robot-systest/deprecated/testsuite/cli/TS013__Feature_1415_RBAC_Visibility_Of_Packages_And_Instances.robot b/robot-systest/deprecated/testsuite/cli/TS013__Feature_1415_RBAC_Visibility_Of_Packages_And_Instances.robot deleted file mode 100644 index 43029516..00000000 --- a/robot-systest/deprecated/testsuite/cli/TS013__Feature_1415_RBAC_Visibility_Of_Packages_And_Instances.robot +++ /dev/null @@ -1,144 +0,0 @@ -## -# Copyright 2019 Tech Mahindra Limited -# -# 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 -## - -*** Settings *** -Documentation Test RBAC for platform - Visibility of packages and instances test -Library OperatingSystem -Library String -Library Collections -Resource ../../lib/cli/rbac_lib.robot -Resource ../../lib/cli/vnfd_lib.robot -Resource ../../lib/cli/nsd_lib.robot -Resource ../../lib/cli/ns_lib.robot -Resource ../../lib/cli/vim_account_lib.robot -Library ../../lib/custom_lib.py - -Suite Setup Prerequisite For Test -Suite Teardown Run Keyword And Ignore Error Test Cleanup - - -*** Variables *** -${success_return_code} 0 - -@{vim} -@{vnfd_ids} -${nsd_id} -@{nsd_ids} -@{ns_ids} -${vnfdPckg} hackfest_basic_vnf.tar.gz -${nsdPckg} hackfest_basic_ns.tar.gz -${vnfdftpPath} https://osm-download.etsi.org/ftp/osm-5.0-five/6th-hackfest/packages/hackfest_basic_vnf.tar.gz -${nsdftpPath} https://osm-download.etsi.org/ftp/osm-5.0-five/6th-hackfest/packages/hackfest_basic_ns.tar.gz - -# Test data for Users Operations test -${user_id} ${EMPTY} - -# Test data for Project Operations test -${project_id} ${EMPTY} - - -*** Test Cases *** -Create VIM Account For New User - [Documentation] Test to create VIM account for newly created user - [Tags] rabc rabc_vim comprehensive nbi - - Wait Until Keyword Succeeds 2x 30sec VIM Setup To Launch Network Services - - -Create VNF Descriptor For New User - [Documentation] Test to create vnfd for new user - [Tags] rabc rabc_vnfd comprehensive nbi - - ${rc} ${stdout}= Run and Return RC and Output wget -P '${CURDIR}${/}../../resource/cli/rbac/' ${vnfdftpPath} - ${vnfd_id}= Create VNFD '${CURDIR}${/}../../resource/cli/rbac${/}${vnfdPckg}' - Append To List ${vnfd_ids} ${vnfd_id} - - -Create NS Descriptor For New User - [Documentation] Test to create nsd for new user - [Tags] rabc rabc_nsd comprehensive nbi - - ${rc} ${stdout}= Run and Return RC and Output wget -P '${CURDIR}${/}../../resource/cli/rbac/' ${nsdftpPath} - ${nsd_id}= Create VNFD '${CURDIR}${/}../../resource/cli/rbac${/}${nsdPckg}' - Append To List ${nsd_ids} ${nsd_id} - - -Instanciate Network Service For New User - [Documentation] Launch network services for new user - [Tags] rabc rabc_ns comprehensive nbi - - :FOR ${vim_name} IN @{vim} - \ Launch Network Services and Return ${vim_name} - - -Delete NS Instance Test - [Tags] rabc rabc_ns comprehensive nbi - - :FOR ${ns} IN @{ns_ids} - \ Delete NS ${ns} - - -Delete NS Descriptor Test - [Tags] rabc rabc_nsd comprehensive nbi - - :FOR ${nsd} IN @{nsd_ids} - \ Delete NSD ${nsd} - - -Delete VNF Descriptor Test - [Tags] rabc rabc_vnfd comprehensive nbi - - :FOR ${vnfd_id} IN @{vnfd_ids} - \ Delete VNFD ${vnfd_id} - - -*** Keywords *** -Prerequisite For Test - ${user-name}= Generate Random String 8 [NUMBERS] - ${user-name}= Catenate SEPARATOR= user_ ${user-name} - set global variable ${user-name} - ${user-password}= Generate Random String 8 [NUMBERS] - set global variable ${user-password} - ${user_id}= Create User ${user-name} ${user-password} - - ${project-name}= Generate Random String 8 [NUMBERS] - ${project-name}= Catenate SEPARATOR= project_ ${project-name} - set global variable ${project-name} - ${project_id}= Create Project ${project-name} - - &{update_field1}= Create Dictionary --add-project-role=admin,project_user - &{update_field2}= Create Dictionary --add-project-role=${project-name},account_manager - @{update_user}= Create List ${update_field1} ${update_field2} - Update User And Verify Info ${user-name} @{update_user} - Login With User And Perform Operation ${user-name} ${user-password} ${project-name} - - -Test Cleanup - [Documentation] Test Suit Cleanup: Deliting Descriptor, instance and vim - -# :FOR ${vim_id} IN @{vim} -# \ Delete Vim Account ${vim_id} - - Logout and Login With Admin - - Delete User ${user-name} - Delete Project ${project-name} diff --git a/robot-systest/deprecated/testsuite/cli/TS014__Feature_7921_MongoDB_Filesystem_Test.robot b/robot-systest/deprecated/testsuite/cli/TS014__Feature_7921_MongoDB_Filesystem_Test.robot deleted file mode 100644 index 3070d419..00000000 --- a/robot-systest/deprecated/testsuite/cli/TS014__Feature_7921_MongoDB_Filesystem_Test.robot +++ /dev/null @@ -1,124 +0,0 @@ -## -# Copyright 2019 Tech Mahindra Limited -# -# 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 -## - -*** Settings *** -Library OperatingSystem -Library String -Library Collections -Resource ../../lib/cli/vnfd_lib.robot -Resource ../../lib/cli/nsd_lib.robot -Resource ../../lib/cli/ns_lib.robot -Resource ../../lib/cli/vim_account_lib.robot -Library ../../lib/custom_lib.py - -Suite Setup Prerequisite For Test -Suite Teardown Run Keyword And Ignore Error Test Cleanup - - -*** Variables *** -${success_return_code} 0 - -@{vim} -@{vnfd_ids} -${nsd_id} -@{nsd_ids} -@{ns_ids} -${vnfdPckg} hackfest_basic_vnf.tar.gz -${nsdPckg} hackfest_basic_ns.tar.gz -${vnfdftpPath} https://osm-download.etsi.org/ftp/osm-5.0-five/6th-hackfest/packages/hackfest_basic_vnf.tar.gz -${nsdftpPath} https://osm-download.etsi.org/ftp/osm-5.0-five/6th-hackfest/packages/hackfest_basic_ns.tar.gz - - -*** Test Cases *** -Create VNF Descriptor Test - [Tags] comprehensive feature7921 - - ${rc} ${stdout}= Run and Return RC and Output wget -P '${CURDIR}${/}../../resource/' ${vnfdftpPath} - ${vnfd_id}= Create VNFD '${CURDIR}${/}../../resource${/}${vnfdPckg}' - Append To List ${vnfd_ids} ${vnfd_id} - - -Create NS Descriptor Test - [Tags] comprehensive feature7921 - - ${rc} ${stdout}= Run and Return RC and Output wget -P '${CURDIR}${/}../../resource/' ${nsdftpPath} - ${nsd_id}= Create VNFD '${CURDIR}${/}../../resource${/}${nsdPckg}' - Append To List ${nsd_ids} ${nsd_id} - - -Instanciate Network Service Test - [Tags] comprehensive feature7921 - [Setup] Wait Until Keyword Succeeds 2x 30sec VIM Setup To Launch Network Services - - :FOR ${vim_name} IN @{vim} - \ Launch Network Services and Return ${vim_name} - - -Delete NS Instance Test - [Tags] comprehensive feature7921 - - :FOR ${ns} IN @{ns_ids} - \ Delete NS ${ns} - - -Delete NS Descriptor Test - [Tags] comprehensive feature7921 - - :FOR ${nsd} IN @{nsd_ids} - \ Delete NSD ${nsd} - - -Delete VNF Descriptor Test - [Tags] comprehensive feature7921 - - :FOR ${vnfd_id} IN @{vnfd_ids} - \ Delete VNFD ${vnfd_id} - - -*** Keywords *** -Prerequisite For Test - [Documentation] Update docker service to use mongodb as file system - - Update NBI Service - Update LCM Service - - -Update NBI Service - ${rc} ${stdout}= Run and Return RC and Output docker service update osm_nbi --force --env-add OSMNBI_STORAGE_DRIVER=mongo --env-add OSMNBI_STORAGE_PATH=/app/storage --env-add OSMNBI_STORAGE_COLLECTION=files --env-add OSMNBI_STORAGE_URI=mongodb://mongo:27017 - Should Be Equal As Integers ${rc} ${success_return_code} - Sleep 30s Wait for NBI service to be update - - -Update LCM Service - ${rc} ${stdout}= Run and Return RC and Output docker service update osm_lcm --force --env-add OSMLCM_STORAGE_DRIVER=mongo --env-add OSMLCM_STORAGE_PATH=/app/storage --env-add OSMLCM_STORAGE_COLLECTION=files --env-add OSMLCM_STORAGE_URI=mongodb://mongo:27017 - Should Be Equal As Integers ${rc} ${success_return_code} - Sleep 30s Wait for LCM service to be update - - -Test Cleanup -# :FOR ${vim_id} IN @{vim} -# \ Delete Vim Account ${vim_id} - - ${rc} ${stdout}= Run and Return RC and Output docker service rollback osm_nbi - Should Be Equal As Integers ${rc} ${success_return_code} - ${rc} ${stdout}= Run and Return RC and Output docker service rollback osm_lcm - Should Be Equal As Integers ${rc} ${success_return_code} diff --git a/robot-systest/deprecated/testsuite/cli/TS015__Feature_8047_OSMClient_Package_Creation_And_Validation.robot b/robot-systest/deprecated/testsuite/cli/TS015__Feature_8047_OSMClient_Package_Creation_And_Validation.robot deleted file mode 100644 index e717c105..00000000 --- a/robot-systest/deprecated/testsuite/cli/TS015__Feature_8047_OSMClient_Package_Creation_And_Validation.robot +++ /dev/null @@ -1,84 +0,0 @@ -## -# Copyright 2019 Tech Mahindra Limited -# -# 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 -## - -*** Settings *** -Documentation Test Suite to test OSMClient Package Createtion and Validation Tool -Library OperatingSystem -Library String -Library Collections -Resource ../../lib/cli/osm_package_tools_lib.robot - -Suite Setup Prerequisite For Test -Suite Teardown Test Cleanup - - -*** Variables *** -${success_return_code} 0 -${base_dir} ${EXECDIR} -${pkg_dir} ${CURDIR}${/}../../resource/cli/packages -${ns_pkg} vEPC -${vnf_pkg} vEPC - - -*** Test Cases *** -Test OSM NS Package Create - [Tags] comprehensive feature8047 - Create OSM NS Package ${ns_pkg} - - -Test OSM VNF Package Create - [Tags] comprehensive feature8047 - Create OSM VNF Package ${vnf_pkg} - - -Test OSM NS Package Validate - [Tags] comprehensive feature8047 - Validate OSM NS Package ${ns_pkg} - - -Test OSM VNF Package Validate - [Tags] comprehensive feature8047 - Validate OSM VNF Package ${vnf_pkg} - - -Test OSM VNF Package Build - [Tags] comprehensive feature8047 - Build OSM VNF Package ${vnf_pkg} - - -Test OSM NS Package Build - [Tags] comprehensive feature8047 - Build OSM NS Package ${ns_pkg} - - -*** Keywords *** -Prerequisite For Test - Create Directory ${pkg_dir} - ${rc} ${stdout}= Run and Return RC and Output cd ${pkg_dir} - Should Be Equal As Integers ${rc} ${success_return_code} - - -Test Cleanup - ${rc} ${stdout}= Run and Return RC and Output cd ${base_dir} - Should Be Equal As Integers ${rc} ${success_return_code} - - Remove Directory ${pkg_dir} recursive=${TRUE} \ No newline at end of file diff --git a/robot-systest/deprecated/testsuite/cli/TS016__Manual_VNF_VDU_Scaling_Test.robot b/robot-systest/deprecated/testsuite/cli/TS016__Manual_VNF_VDU_Scaling_Test.robot deleted file mode 100644 index 3f7bce8d..00000000 --- a/robot-systest/deprecated/testsuite/cli/TS016__Manual_VNF_VDU_Scaling_Test.robot +++ /dev/null @@ -1,129 +0,0 @@ -## -# Copyright 2019 Tech Mahindra Limited -# -# 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. Mrityunjay Yadav, Jayant Madavi : MY00514913@techmahindra.com : 27-Nov-19 -## - -*** Settings *** -Documentation Test Suite to test manual scale-in/out cirros VNF and NS using osm-client -Library OperatingSystem -Library String -Library Collections -Resource ../../lib/cli/vnfd_lib.robot -Resource ../../lib/cli/nsd_lib.robot -Resource ../../lib/cli/ns_lib.robot -Resource ../../lib/cli/vim_account_lib.robot -Library ../../lib/custom_lib.py - -Suite Teardown Run Keyword And Ignore Error Test Cleanup - - -*** Variables *** -# VNFD Details -@{vnfd_ids} -${vnfdPckgPath} /descriptor-packages/vnfd/cirros_vnf -${vnfdPckg} /build/cirros_vnf.tar.gz - -# NSD Details -@{nsd_ids} -${nsdPckgPath} /descriptor-packages/nsd/cirros_ns -${nsdPckg} /build/cirros_ns.tar.gz -${scaling_group} scaling_cirros_vnf -${vnf_member_index} 1 - -@{ns_ids} - - -*** Test Cases *** -Create VNF Descriptor Test - [Documentation] Build and onboard cirros VNF package with scaling parameter - [Tags] comprehensive manual_scaling - - Build VNF Descriptor ${vnfdPckgPath} - ${vnfd_id}= Create VNFD '${CURDIR}${/}../../..${vnfdPckgPath}${vnfdPckg}' - Append To List ${vnfd_ids} ${vnfd_id} - - -Create NS Descriptor Test - [Documentation] Build and onboard cirros NS package with scaling parameter - [Tags] comprehensive manual_scaling - - Build NS Descriptor ${nsdPckgPath} - ${nsd_id}= Create NSD '${CURDIR}${/}../../..${nsdPckgPath}${nsdPckg}' - Append To List ${nsd_ids} ${nsd_id} - - -Network Service Instance Test - [Documentation] Launch cirros ns with scaling parameter - [Tags] comprehensive manual_scaling - - :FOR ${vim_name} IN @{vim} - \ Launch Network Services and Return ${vim_name} - - -Perform VNF/VDU Scaling-out Operation Over Launched NS Test - [Documentation] scale-out cirros ns - [Tags] comprehensive manual_scaling - :FOR ${ns} IN @{ns_ids} - \ Perform VNF Scale-out Operation ${ns} ${vnf_member_index} ${scaling_group} - - -Perform VNF/VDU Scaling-in Operation Over Launched NS Test - [Documentation] scale-in cirros ns - [Tags] comprehensive manual_scaling - :FOR ${ns} IN @{ns_ids} - \ Perform VNF Scale-in Operation ${ns} ${vnf_member_index} ${scaling_group} - - -Delete NS Instance Test - [Tags] comprehensive manual_scaling - - :FOR ${ns} IN @{ns_ids} - \ Delete NS ${ns} - - -Delete NS Descriptor Test - [Tags] comprehensive manual_scaling - - :FOR ${nsd} IN @{nsd_ids} - \ Delete NSD ${nsd} - - -Delete VNF Descriptor Test - [Tags] comprehensive manual_scaling - - :FOR ${vnfd} IN @{vnfd_ids} - \ Delete VNFD ${vnfd} - - -*** Keywords *** -Test Cleanup - [Documentation] Test Suit Cleanup: Deliting Descriptor, instance and vim - - :FOR ${ns} IN @{ns_ids} - \ Delete NS ${ns} - - :FOR ${nsd} IN @{nsd_ids} - \ Delete NSD ${nsd} - - :FOR ${vnfd} IN @{vnfd_ids} - \ Delete VNFD ${vnfd} - -# :FOR ${vim_id} IN @{vim} -# \ Delete Vim Account ${vim_id} diff --git a/robot-systest/deprecated/testsuite/cli/TS017__Feature_7326_Disable_Port_Security_at_Network_level.robot b/robot-systest/deprecated/testsuite/cli/TS017__Feature_7326_Disable_Port_Security_at_Network_level.robot deleted file mode 100644 index 562dc15d..00000000 --- a/robot-systest/deprecated/testsuite/cli/TS017__Feature_7326_Disable_Port_Security_at_Network_level.robot +++ /dev/null @@ -1,122 +0,0 @@ -# -*- coding: utf-8 -*- - -## -# Copyright 2020 Tech Mahindra Limited -# -# 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. -# -# Author: Mrityunjay Yadav , Jayant Madavi -## - - -*** Settings *** -Documentation Test Suite to test disable network port security NS -Library OperatingSystem -Library String -Library Collections -Resource ../../lib/cli/vnfd_lib.robot -Resource ../../lib/cli/nsd_lib.robot -Resource ../../lib/cli/ns_lib.robot -Resource ../../lib/cli/vim_account_lib.robot -Library ../../lib/custom_lib.py -Variables ../../resource/cli/disable_port_security_ns_data.py - -Suite Teardown Run Keyword And Ignore Error Test Cleanup - - -*** Variables *** -@{vnfd_ids} -${nsd_id} -@{nsd_ids} -@{ns_ids} - - -*** Test Cases *** -Create VNF Descriptor - [Tags] disable_port_security comprehensive - - Build VNF Descriptor ${vnfdPckgPath} - ${vnfd_id}= Create VNFD '${CURDIR}${/}../../..${vnfdPckgPath}${vnfdPckg}' - Append To List ${vnfd_ids} ${vnfd_id} - - -Create NS Descriptor - [Tags] disable_port_security comprehensive - - Build NS Descriptor ${nsdPckgPath} - ${nsd_id}= Create NSD '${CURDIR}${/}../../..${nsdPckgPath}${nsdPckg}' - Append To List ${nsd_ids} ${nsd_id} - - -Network Service Instance Test - [Documentation] Launch and terminate network services - [Tags] disable_port_security comprehensive - - :FOR ${vim_name} IN @{vim} - \ Launch Network Services and Return ${vim_name} - - -Verify Port Security - [Tags] disable_port_security comprehensive - - :FOR ${ns} IN @{ns_ids} - \ Check For Network Port Security ${ns} - - -Delete NS Instance Test - [Tags] disable_port_security comprehensive - - :FOR ${ns} IN @{ns_ids} - \ Delete NS ${ns} - - -Delete NS Descriptor Test - [Tags] disable_port_security comprehensive - - :FOR ${nsd} IN @{nsd_ids} - \ Delete NSD ${nsd} - - -Delete VNF Descriptor Test - [Tags] disable_port_security comprehensive - - :FOR ${vnfd_id} IN @{vnfd_ids} - \ Delete VNFD ${vnfd_id} - - -*** Keywords *** -Check For Network Port Security - [Arguments] ${ns_name} - ${rc} ${network_id}= Run and Return RC and Output openstack network list | grep ${ns_name} | awk '{print $2}' - Log ${network_id} - ${rc} ${stdout}= Run and Return RC and Output openstack network show ${network_id} -f json | jq '.port_security_enabled' - Log ${stdout} - Should Be Equal As Strings ${stdout} true - - -Test Cleanup - [Documentation] Test Suit Cleanup: Deliting Descriptor, instance and vim - - :FOR ${ns} IN @{ns_ids} - \ Delete NS ${ns} - - :FOR ${nsd} IN @{nsd_ids} - \ Delete NSD ${nsd} - - :FOR ${vnfd} IN @{vnfd_ids} - \ Delete VNFD ${vnfd} - -# :FOR ${vim_id} IN @{vim} -# \ Delete Vim Account ${vim_id} diff --git a/robot-systest/deprecated/testsuite/cli/TS01__Test_VNF.robot b/robot-systest/deprecated/testsuite/cli/TS01__Test_VNF.robot deleted file mode 100644 index 84e1f927..00000000 --- a/robot-systest/deprecated/testsuite/cli/TS01__Test_VNF.robot +++ /dev/null @@ -1,107 +0,0 @@ -# -*- coding: utf-8 -*- - -## -# Copyright 2019 Tech Mahindra Limited -# -# 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. Feature 7829: Mrityunjay Yadav, Jayant Madavi : MY00514913@techmahindra.com : 06-aug-2019 -## - - -*** Settings *** -Documentation Test Suite to test basic cirros VNF and NS using osm-client -Library OperatingSystem -Library String -Library Collections -Resource ../../lib/cli/vnfd_lib.robot -Resource ../../lib/cli/nsd_lib.robot -Resource ../../lib/cli/ns_lib.robot -Resource ../../lib/cli/vim_account_lib.robot -Library ../../lib/custom_lib.py -Variables ../../resource/cli/test_vnf_data.py - -Suite Teardown Run Keyword And Ignore Error Test Cleanup - - -*** Variables *** -@{vnfd_ids} -@{nsd_ids} -@{ns_ids} - - -*** Test Cases *** -Create VNF Descriptor Test - [Tags] sanity smoke - - Build VNF Descriptor ${vnfdPckgPath} - ${vnfd_id}= Create VNFD '${CURDIR}${/}../../..${vnfdPckgPath}${vnfdPckg}' - Append To List ${vnfd_ids} ${vnfd_id} - - -Create NS Descriptor Test - [Tags] sanity smoke - - Build NS Descriptor ${nsdPckgPath} - ${nsd_id}= Create NSD '${CURDIR}${/}../../..${nsdPckgPath}${nsdPckg}' - Append To List ${nsd_ids} ${nsd_id} - - -Network Service Instance Test - [Documentation] Launch and terminate network services - [Tags] sanity - - :FOR ${vim_name} IN @{vim} - \ Launch Network Services and Return ${vim_name} - - -Delete NS Instance Test - [Tags] sanity - - :FOR ${ns} IN @{ns_ids} - \ Delete NS ${ns} - - -Delete NS Descriptor Test - [Tags] sanity smoke - - :FOR ${nsd} IN @{nsd_ids} - \ Delete NSD ${nsd} - - -Delete VNF Descriptor Test - [Tags] sanity smoke - - :FOR ${vnfd} IN @{vnfd_ids} - \ Delete VNFD ${vnfd} - - -*** Keywords *** -Test Cleanup - [Documentation] Test Suit Cleanup: Deliting Descriptor, instance and vim - - :FOR ${ns} IN @{ns_ids} - \ Delete NS ${ns} - - :FOR ${nsd} IN @{nsd_ids} - \ Delete NSD ${nsd} - - :FOR ${vnfd} IN @{vnfd_ids} - \ Delete VNFD ${vnfd} - -# :FOR ${vim_id} IN @{vim} -# \ Delete Vim Account ${vim_id} diff --git a/robot-systest/deprecated/testsuite/cli/TS02__Test_Vim.robot b/robot-systest/deprecated/testsuite/cli/TS02__Test_Vim.robot deleted file mode 100644 index 18f2a501..00000000 --- a/robot-systest/deprecated/testsuite/cli/TS02__Test_Vim.robot +++ /dev/null @@ -1,49 +0,0 @@ -# -*- coding: utf-8 -*- - -## -# Copyright 2019 Tech Mahindra Limited -# -# 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. Feature 7829: Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 06-aug-2019 : Improvement to the code, robot framework initial seed code. -## - - -*** Settings *** -Documentation Test suiet to create/delete vim account via osmclient -Library OperatingSystem -Library Collections -Resource ../../lib/cli/vim_account_lib.robot - - -*** Test Cases *** -Create Vim Account Test - [Tags] smoke vim - - Create Vim Account - - -Get Vim Accounts List Test - [Tags] vim - - Get Vim List - - -Delete Vim Account Test - [Tags] smoke vim - - Delete Vim Account diff --git a/robot-systest/deprecated/testsuite/cli/TS03__Hackfest_Basic_NS.robot b/robot-systest/deprecated/testsuite/cli/TS03__Hackfest_Basic_NS.robot deleted file mode 100644 index 40492f71..00000000 --- a/robot-systest/deprecated/testsuite/cli/TS03__Hackfest_Basic_NS.robot +++ /dev/null @@ -1,108 +0,0 @@ -# -*- coding: utf-8 -*- - -## -# Copyright 2019 Tech Mahindra Limited -# -# 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. Feature 7829: Mrityunjay Yadav, Jayant Madavi : MY00514913@techmahindra.com : 06-aug-2019 -## - - -*** Settings *** -Documentation Test Suite to create hackfest basic nestwork service -Library OperatingSystem -Library String -Library Collections -Resource ../../lib/cli/vnfd_lib.robot -Resource ../../lib/cli/nsd_lib.robot -Resource ../../lib/cli/ns_lib.robot -Resource ../../lib/cli/vim_account_lib.robot -Library ../../lib/custom_lib.py -Variables ../../resource/cli/hackfest_basic_ns_data.py - -Suite Teardown Run Keyword And Ignore Error Test Cleanup - - -*** Variables *** -@{vnfd_ids} -${nsd_id} -@{nsd_ids} -@{ns_ids} - - -*** Test Cases *** -Create Hackfest Basic VNF Descriptor - [Tags] comprehensive hackfest_basic_ns - - Build VNF Descriptor ${vnfdPckgPath} - ${vnfd_id}= Create VNFD '${CURDIR}${/}../../..${vnfdPckgPath}${vnfdPckg}' - Append To List ${vnfd_ids} ${vnfd_id} - - -Create Hackfest Basic NS Descriptor - [Tags] comprehensive hackfest_basic_ns - - Build NS Descriptor ${nsdPckgPath} - ${nsd_id}= Create NSD '${CURDIR}${/}../../..${nsdPckgPath}${nsdPckg}' - Append To List ${nsd_ids} ${nsd_id} - - -Network Service Instance Test - [Documentation] Launch and terminate network services - [Tags] comprehensive hackfest_basic_ns - - :FOR ${vim_name} IN @{vim} - \ Launch Network Services and Return ${vim_name} - - -Delete NS Instance Test - [Tags] comprehensive hackfest_basic_ns - - :FOR ${ns} IN @{ns_ids} - \ Delete NS ${ns} - - -Delete NS Descriptor Test - [Tags] comprehensive hackfest_basic_ns - - :FOR ${nsd} IN @{nsd_ids} - \ Delete NSD ${nsd} - - -Delete VNF Descriptor Test - [Tags] comprehensive hackfest_basic_ns - - :FOR ${vnfd_id} IN @{vnfd_ids} - \ Delete VNFD ${vnfd_id} - - -*** Keywords *** -Test Cleanup - [Documentation] Test Suit Cleanup: Deliting Descriptor, instance and vim - - :FOR ${ns} IN @{ns_ids} - \ Delete NS ${ns} - - :FOR ${nsd} IN @{nsd_ids} - \ Delete NSD ${nsd} - - :FOR ${vnfd} IN @{vnfd_ids} - \ Delete VNFD ${vnfd} - -# :FOR ${vim_id} IN @{vim} -# \ Delete Vim Account ${vim_id} diff --git a/robot-systest/deprecated/testsuite/cli/TS04__Hackfest_Simplecharm_NS.robot b/robot-systest/deprecated/testsuite/cli/TS04__Hackfest_Simplecharm_NS.robot deleted file mode 100644 index 2a224788..00000000 --- a/robot-systest/deprecated/testsuite/cli/TS04__Hackfest_Simplecharm_NS.robot +++ /dev/null @@ -1,113 +0,0 @@ -# -*- coding: utf-8 -*- - -## -# Copyright 2019 Tech Mahindra Limited -# -# 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. Feature 7829: Mrityunjay Yadav, Jayant Madavi : MY00514913@techmahindra.com : 06-aug-2019 -## - - -*** Settings *** -Documentation Test Suite to create hackfest simplecharm ns -Library OperatingSystem -Library String -Library Collections -Resource ../../lib/cli/vnfd_lib.robot -Resource ../../lib/cli/nsd_lib.robot -Resource ../../lib/cli/ns_lib.robot -Resource ../../lib/cli/vim_account_lib.robot -Library ../../lib/custom_lib.py -Variables ../../resource/cli/hackfest_simplecharm_ns_data.py - -Suite Teardown Run Keyword And Ignore Error Test Cleanup - - -*** Variables *** -@{vnfd_ids} -${nsd_id} -@{nsd_ids} -@{ns_ids} -${vnfdftpPath} https://osm-download.etsi.org/ftp/osm-6.0-six/7th-hackfest/packages/hackfest_simplecharm_vnf.tar.gz -${nsdftpPath} https://osm-download.etsi.org/ftp/osm-6.0-six/7th-hackfest/packages/hackfest_simplecharm_ns.tar.gz - - -*** Test Cases *** -Create Hackfest Simple Charm VNF Descriptor - [Tags] hackfest_simplecharm comprehensive - - #Build VNF Descriptor ${vnfdPckgPath} - #Workarround for charm build issue - ${rc} ${stdout}= Run and Return RC and Output wget -P '${CURDIR}${/}../../..${vnfdPckgPath}${/}build/' ${vnfdftpPath} - ${vnfd_id}= Create VNFD '${CURDIR}${/}../../..${vnfdPckgPath}${vnfdPckg}' - Append To List ${vnfd_ids} ${vnfd_id} - - -Create Hackfest Simple Charm NS Descriptor - [Tags] hackfest_simplecharm comprehensive - - #Build NS Descriptor ${nsdPckgPath} - ${rc} ${stdout}= Run and Return RC and Output wget -P '${CURDIR}${/}../../..${nsdPckgPath}${/}build/' ${nsdftpPath} - ${nsd_id}= Create NSD '${CURDIR}${/}../../..${nsdPckgPath}${nsdPckg}' - Append To List ${nsd_ids} ${nsd_id} - - -Network Service Instance Test - [Documentation] Launch and terminate network services - [Tags] hackfest_simplecharm comprehensive - - :FOR ${vim_name} IN @{vim} - \ Launch Network Services and Return ${vim_name} - - -Delete NS Instance Test - [Tags] comprehensive hackfest_simplecharm - - :FOR ${ns} IN @{ns_ids} - \ Delete NS ${ns} - - -Delete NS Descriptor Test - [Tags] hackfest_simplecharm comprehensive - - :FOR ${nsd} IN @{nsd_ids} - \ Delete NSD ${nsd} - - -Delete VNF Descriptor Test - [Tags] hackfest_simplecharm comprehensive - - :FOR ${vnfd_id} IN @{vnfd_ids} - \ Delete VNFD ${vnfd_id} - - -*** Keywords *** -Test Cleanup - [Documentation] Test Suit Cleanup: Deliting Descriptor, instance and vim - - :FOR ${ns} IN @{ns_ids} - \ Delete NS ${ns} - - :FOR ${nsd} IN @{nsd_ids} - \ Delete NSD ${nsd} - - :FOR ${vnfd} IN @{vnfd_ids} - \ Delete VNFD ${vnfd} - -# :FOR ${vim_id} IN @{vim} -# \ Delete Vim Account ${vim_id} diff --git a/robot-systest/deprecated/testsuite/cli/TS05__Hackfest_Multivdu_NS.robot b/robot-systest/deprecated/testsuite/cli/TS05__Hackfest_Multivdu_NS.robot deleted file mode 100644 index e3cc4400..00000000 --- a/robot-systest/deprecated/testsuite/cli/TS05__Hackfest_Multivdu_NS.robot +++ /dev/null @@ -1,108 +0,0 @@ -# -*- coding: utf-8 -*- - -## -# Copyright 2019 Tech Mahindra Limited -# -# 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. Feature 7829: Mrityunjay Yadav, Jayant Madavi : MY00514913@techmahindra.com : 06-aug-2019 -## - - -*** Settings *** -Documentation Test Suite to create hackfest multivdu ns -Library OperatingSystem -Library String -Library Collections -Resource ../../lib/cli/vnfd_lib.robot -Resource ../../lib/cli/nsd_lib.robot -Resource ../../lib/cli/ns_lib.robot -Resource ../../lib/cli/vim_account_lib.robot -Library ../../lib/custom_lib.py -Variables ../../resource/cli/hackfest_multivdu_ns_data.py - -Suite Teardown Run Keyword And Ignore Error Test Cleanup - - -*** Variables *** -@{vnfd_ids} -${nsd_id} -@{nsd_ids} -@{ns_ids} - - -*** Test Cases *** -Create Hackfest Multivdu VNF Descriptor - [Tags] comprehensive hackfest_multivdu - - Build VNF Descriptor ${vnfdPckgPath} - ${vnfd_id}= Create VNFD '${CURDIR}${/}../../..${vnfdPckgPath}${vnfdPckg}' - Append To List ${vnfd_ids} ${vnfd_id} - - -Create Hackfest Multivdu NS Descriptor - [Tags] comprehensive hackfest_multivdu - - Build NS Descriptor ${nsdPckgPath} - ${nsd_id}= Create NSD '${CURDIR}${/}../../..${nsdPckgPath}${nsdPckg}' - Append To List ${nsd_ids} ${nsd_id} - - -Network Service Instance Test - [Documentation] Launch and terminate network services - [Tags] comprehensive hackfest_multivdu - - :FOR ${vim_name} IN @{vim} - \ Launch Network Services and Return ${vim_name} - - -Delete NS Instance Test - [Tags] comprehensive hackfest_multivdu - - :FOR ${ns} IN @{ns_ids} - \ Delete NS ${ns} - - -Delete NS Descriptor Test - [Tags] comprehensive hackfest_multivdu - - :FOR ${nsd} IN @{nsd_ids} - \ Delete NSD ${nsd} - - -Delete VNF Descriptor Test - [Tags] comprehensive hackfest_multivdu - - :FOR ${vnfd_id} IN @{vnfd_ids} - \ Delete VNFD ${vnfd_id} - - -*** Keywords *** -Test Cleanup - [Documentation] Test Suit Cleanup: Deliting Descriptor, instance and vim - - :FOR ${ns} IN @{ns_ids} - \ Delete NS ${ns} - - :FOR ${nsd} IN @{nsd_ids} - \ Delete NSD ${nsd} - - :FOR ${vnfd} IN @{vnfd_ids} - \ Delete VNFD ${vnfd} - -# :FOR ${vim_id} IN @{vim} -# \ Delete Vim Account ${vim_id} diff --git a/robot-systest/deprecated/testsuite/cli/TS06__Hackfest_Cloudinit_NS.robot b/robot-systest/deprecated/testsuite/cli/TS06__Hackfest_Cloudinit_NS.robot deleted file mode 100644 index 87bf22f3..00000000 --- a/robot-systest/deprecated/testsuite/cli/TS06__Hackfest_Cloudinit_NS.robot +++ /dev/null @@ -1,108 +0,0 @@ -# -*- coding: utf-8 -*- - -## -# Copyright 2019 Tech Mahindra Limited -# -# 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. Feature 7829: Mrityunjay Yadav, Jayant Madavi : MY00514913@techmahindra.com : 06-aug-2019 -## - - -*** Settings *** -Documentation Test Suite to create hackfest cloudinit ns -Library OperatingSystem -Library String -Library Collections -Resource ../../lib/cli/vnfd_lib.robot -Resource ../../lib/cli/nsd_lib.robot -Resource ../../lib/cli/ns_lib.robot -Resource ../../lib/cli/vim_account_lib.robot -Library ../../lib/custom_lib.py -Variables ../../resource/cli/hackfest_cloudinit_ns_data.py - -Suite Teardown Run Keyword And Ignore Error Test Cleanup - - -*** Variables *** -@{vnfd_ids} -${nsd_id} -@{nsd_ids} -@{ns_ids} - - -*** Test Cases *** -Create Hackfest Cloudinit VNF Descriptor - [Tags] comprehensive hackfest_cloudinit - - Build VNF Descriptor ${vnfdPckgPath} - ${vnfd_id}= Create VNFD '${CURDIR}${/}../../..${vnfdPckgPath}${vnfdPckg}' - Append To List ${vnfd_ids} ${vnfd_id} - - -Create Hackfest Cloudinit NS Descriptor - [Tags] comprehensive hackfest_cloudinit - - Build NS Descriptor ${nsdPckgPath} - ${nsd_id}= Create NSD '${CURDIR}${/}../../..${nsdPckgPath}${nsdPckg}' - Append To List ${nsd_ids} ${nsd_id} - - -Network Service Instance Test - [Documentation] Launch and terminate network services - [Tags] comprehensive hackfest_cloudinit - - :FOR ${vim_name} IN @{vim} - \ Launch Network Services and Return ${vim_name} - - -Delete NS Instance Test - [Tags] comprehensive hackfest_cloudinit - - :FOR ${ns} IN @{ns_ids} - \ Delete NS ${ns} - - -Delete NS Descriptor Test - [Tags] comprehensive hackfest_cloudinit - - :FOR ${nsd} IN @{nsd_ids} - \ Delete NSD ${nsd} - - -Delete VNF Descriptor Test - [Tags] comprehensive hackfest_cloudinit - - :FOR ${vnfd_id} IN @{vnfd_ids} - \ Delete VNFD ${vnfd_id} - - -*** Keywords *** -Test Cleanup - [Documentation] Test Suit Cleanup: Deliting Descriptor, instance and vim - - :FOR ${ns} IN @{ns_ids} - \ Delete NS ${ns} - - :FOR ${nsd} IN @{nsd_ids} - \ Delete NSD ${nsd} - - :FOR ${vnfd} IN @{vnfd_ids} - \ Delete VNFD ${vnfd} - -# :FOR ${vim_id} IN @{vim} -# \ Delete Vim Account ${vim_id} diff --git a/robot-systest/deprecated/testsuite/cli/TS07__Hackfest_EPA_NS.robot b/robot-systest/deprecated/testsuite/cli/TS07__Hackfest_EPA_NS.robot deleted file mode 100644 index 53165985..00000000 --- a/robot-systest/deprecated/testsuite/cli/TS07__Hackfest_EPA_NS.robot +++ /dev/null @@ -1,108 +0,0 @@ -# -*- coding: utf-8 -*- - -## -# Copyright 2019 Tech Mahindra Limited -# -# 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. Feature 7829: Mrityunjay Yadav, Jayant Madavi : MY00514913@techmahindra.com : 06-aug-2019 -## - - -*** Settings *** -Documentation Test Suite to create hackfest epa ns -Library OperatingSystem -Library String -Library Collections -Resource ../../lib/cli/vnfd_lib.robot -Resource ../../lib/cli/nsd_lib.robot -Resource ../../lib/cli/ns_lib.robot -Resource ../../lib/cli/vim_account_lib.robot -Library ../../lib/custom_lib.py -Variables ../../resource/cli/hackfest_epa_ns_data.py - -Suite Teardown Run Keyword And Ignore Error Test Cleanup - - -*** Variables *** -@{vnfd_ids} -${nsd_id} -@{nsd_ids} -@{ns_ids} - - -*** Test Cases *** -Create Hackfest EPA VNF Descriptor - [Tags] hackfest_epa - - Build VNF Descriptor ${vnfdPckgPath} - ${vnfd_id}= Create VNFD '${CURDIR}${/}../../..${vnfdPckgPath}${vnfdPckg}' - Append To List ${vnfd_ids} ${vnfd_id} - - -Create Hackfest EPA NS Descriptor - [Tags] hackfest_epa - - Build NS Descriptor ${nsdPckgPath} - ${nsd_id}= Create NSD '${CURDIR}${/}../../..${nsdPckgPath}${nsdPckg}' - Append To List ${nsd_ids} ${nsd_id} - - -Network Service Instance Test - [Documentation] Launch and terminate network services - [Tags] hackfest_epa - - :FOR ${vim_name} IN @{vim} - \ Launch Network Services and Return ${vim_name} - - -Delete NS Instance Test - [Tags] hackfest_epa - - :FOR ${ns} IN @{ns_ids} - \ Delete NS ${ns} - - -Delete NS Descriptor Test - [Tags] hackfest_epa - - :FOR ${nsd} IN @{nsd_ids} - \ Delete NSD ${nsd} - - -Delete VNF Descriptor Test - [Tags] hackfest_epa - - :FOR ${vnfd_id} IN @{vnfd_ids} - \ Delete VNFD ${vnfd_id} - - -*** Keywords *** -Test Cleanup - [Documentation] Test Suit Cleanup: Deliting Descriptor, instance and vim - - :FOR ${ns} IN @{ns_ids} - \ Delete NS ${ns} - - :FOR ${nsd} IN @{nsd_ids} - \ Delete NSD ${nsd} - - :FOR ${vnfd} IN @{vnfd_ids} - \ Delete VNFD ${vnfd} - -# :FOR ${vim_id} IN @{vim} -# \ Delete Vim Account ${vim_id} diff --git a/robot-systest/deprecated/testsuite/cli/__init__.robot b/robot-systest/deprecated/testsuite/cli/__init__.robot deleted file mode 100644 index 2d959da1..00000000 --- a/robot-systest/deprecated/testsuite/cli/__init__.robot +++ /dev/null @@ -1,39 +0,0 @@ -# -*- coding: utf-8 -*- - -## -# Copyright 2019 Tech Mahindra Limited -# -# 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. -## - -*** Settings *** -Library OperatingSystem -Library String -Library Collections -Library ../../lib/custom_lib.py -Resource ../../lib/cli/vim_account_lib.robot - -Suite Setup Wait Until Keyword Succeeds 2x 30sec VIM Setup To Launch Network Services -Suite Teardown Run Keyword And Ignore Error Suite Cleanup - - -*** Variables *** -@{vim} - - -*** Keywords *** -Suite Cleanup - :FOR ${vim_id} IN @{vim} - \ Force Delete Vim Account ${vim_id} \ No newline at end of file diff --git a/robot-systest/deprecated/testsuite/client_library/TS01__OSMClient_Library_Test.robot b/robot-systest/deprecated/testsuite/client_library/TS01__OSMClient_Library_Test.robot deleted file mode 100644 index 88d8b5cb..00000000 --- a/robot-systest/deprecated/testsuite/client_library/TS01__OSMClient_Library_Test.robot +++ /dev/null @@ -1,82 +0,0 @@ -## -# Copyright 2019 Tech Mahindra Limited -# -# 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. -## - - -*** Settings *** -Documentation Test suite to test osmclient python library -Library OperatingSystem - -Suite Setup Setup OSM Client - - -*** Variables *** -${name} helloworld-os -${user} robottest -${password} fred -${authurl} https://169.254.169.245/ -${type} openstack -${desc} a test vim -${tenant} robottest - - -*** Test Cases *** -Get VIM Account List Test - [Tags] comprehensive osmclient_lib - [Documentation] Using python's osmclient library to get vim account list - - ${vim_list}= osmclient.get_vim_list - log to console ${vim_list} - log ${vim_list} - - -Get VNF Descriptor List Test - [Tags] comprehensive osmclient_lib - [Documentation] Using python's osmclient library to get vnfd list - - ${vnfd_list}= osmclient.get_vnfd_list - log to console ${vnfd_list} - log ${vnfd_list} - - -Get NS Descriptor List Test - [Tags] comprehensive osmclient_lib - [Documentation] Using python's osmclient library to get nsd list - - ${nsd_list}= osmclient.get_nsd_list - log to console ${nsd_list} - log ${nsd_list} - - -Create Vim Account Test - [Tags] comprehensive osmclient_lib - [Documentation] Using python's osmclient library to create vim account - [Template] osmclient.create_vim_account - ${name} ${type} ${user} ${password} ${authurl} ${tenant} ${desc} - - -Delete Vim Account Test - [Tags] comprehensive osmclient_lib - [Documentation] Using python's osmclient library to delete vim account - osmclient.delete_vim_account ${name} - - -*** Keywords *** -Setup OSM Client - evaluate sys.path.append('${CURDIR}${/}../../lib/client_lib') modules=sys - ${host}= Get Environment Variable OSM_HOSTNAME 127.0.0.1 - Import Library client_lib.ClientLib host=${host} WITH NAME osmclient diff --git a/robot-systest/deprecated/testsuite/gui/TS01__Test_GUI_Login.robot b/robot-systest/deprecated/testsuite/gui/TS01__Test_GUI_Login.robot deleted file mode 100644 index 4f20a180..00000000 --- a/robot-systest/deprecated/testsuite/gui/TS01__Test_GUI_Login.robot +++ /dev/null @@ -1,41 +0,0 @@ -# -*- coding: utf-8 -*- - -## -# Copyright 2019 Tech Mahindra Limited -# -# 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. Feature 7829: Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com -## - - -*** Settings *** -Documentation Suite description -Library SeleniumLibrary -Library OperatingSystem -Resource ../../lib/gui/login_gui.robot - - -*** Test Cases *** -Valid Login - [Tags] comprehensive gui_login_test - [Setup] Set Server URL - Open Browser To Login Page - Enter Credentials admin admin - Submit Credentials - Home Page Should Be Open - [Teardown] Close Browser diff --git a/robot-systest/lib/connectivity_lib.robot b/robot-systest/lib/connectivity_lib.robot deleted file mode 100644 index 7b865935..00000000 --- a/robot-systest/lib/connectivity_lib.robot +++ /dev/null @@ -1,19 +0,0 @@ -# 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. - -*** Keywords *** -Test Connectivity - [Arguments] ${host} - - ${result} Run Process ping -c 5 -W 1 ${host} > /dev/null && echo OK shell=True - Log all output: ${result.stdout} - Should Contain ${result.stdout} OK diff --git a/robot-systest/lib/k8scluster_lib.robot b/robot-systest/lib/k8scluster_lib.robot deleted file mode 100644 index 38969413..00000000 --- a/robot-systest/lib/k8scluster_lib.robot +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright 2020 Canonical Ltd. -# -# 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. - -*** Variables *** -${success_return_code} 0 -${k8scluster_launch_max_wait_time} 2min -${k8scluster_launch_pol_time} 30sec -${k8scluster_delete_max_wait_time} 2min -${k8scluster_delete_pol_time} 15sec - -*** Keywords *** -Create K8s Cluster - [Arguments] ${k8scluster_creds} ${k8scluster_version} ${k8scluster_vim} ${k8scluster_net} ${k8scluster_name} - ${rc} ${stdout}= Run and Return RC and Output osm k8scluster-add --creds ${k8scluster_creds} --version ${k8scluster_version} --vim ${k8scluster_vim} --k8s-nets '{"net1": "${k8scluster_net}"}' ${k8scluster_name} --description "Robot cluster" - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - WAIT UNTIL KEYWORD SUCCEEDS ${k8scluster_launch_max_wait_time} ${k8scluster_launch_pol_time} Check For K8s Cluster To Be Ready ${k8scluster_name} - [Return] ${stdout} - -Delete K8s Cluster - [Arguments] ${k8scluster_name} - ${rc} ${stdout}= Run and Return RC and Output osm k8scluster-delete ${k8scluster_name} - Should Be Equal As Integers ${rc} ${success_return_code} - WAIT UNTIL KEYWORD SUCCEEDS ${k8scluster_delete_max_wait_time} ${k8scluster_delete_pol_time} Check For K8s Cluster To Be Deleted ${k8scluster_name} - -Get K8s Cluster - ${rc} ${stdout}= Run and Return RC and Output osm k8scluster-list - Should Be Equal As Integers ${rc} ${success_return_code} - log ${stdout} - [Return] ${stdout} - -Check for K8s Cluster - [Arguments] ${k8scluster_name} - ${rc} ${stdout}= Run and Return RC and Output osm k8scluster-list --filter name="${k8scluster_name}" - Should Be Equal As Integers ${rc} ${success_return_code} - [Return] ${stdout} - -Check For K8s Cluster To Be Deleted - [Arguments] ${k8scluster_name} - ${rc} ${stdout}= Run and Return RC and Output osm k8scluster-list --filter name="${k8scluster_name}" | awk '{print $2}' | grep ${k8scluster_name} - Should Be Empty ${stdout} - -Check For K8s Cluster To Be Ready - [Arguments] ${k8scluster_name} - ${rc} ${stdout}= Run and Return RC and Output osm k8scluster-list --filter name="${k8scluster_name}" --filter _admin.operationalState="ENABLED" | awk '{print $2}' | grep ${k8scluster_name} - Should Be Equal As Integers ${rc} ${success_return_code} - Should Be Equal As Strings ${stdout} ${k8scluster_name} diff --git a/robot-systest/lib/ns_lib.robot b/robot-systest/lib/ns_lib.robot deleted file mode 100644 index 6a8c84bf..00000000 --- a/robot-systest/lib/ns_lib.robot +++ /dev/null @@ -1,212 +0,0 @@ -# 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. - -*** Variables *** -${success_return_code} 0 -${ns_launch_pol_time} 30sec -${ns_delete_max_wait_time} 1min -${ns_delete_pol_time} 15sec -${ns_action_max_wait_time} 1min -${ns_action_pol_time} 15sec -${vnf_scale_max_wait_time} 5min -${vnf_scale_pol_time} 30sec - - -*** Keywords *** -Create Network Service - [Arguments] ${nsd} ${vim_name} ${ns_name} ${ns_config} ${publickey} ${ns_launch_max_wait_time}=5min - - ${config_attr} Set Variable If '${ns_config}'!='${EMPTY}' --config '${ns_config}' \ - ${sshkeys_attr} Set Variable If '${publickey}'!='${EMPTY}' --ssh_keys ${publickey} \ - - ${ns_id}= Instantiate Network Service ${ns_name} ${nsd} ${vim_name} ${config_attr} ${sshkeys_attr} - log ${ns_id} - - WAIT UNTIL KEYWORD SUCCEEDS ${ns_launch_max_wait_time} ${ns_launch_pol_time} Check For NS Instance To Configured ${ns_name} - Check For NS Instance For Failure ${ns_name} - [Return] ${ns_id} - - -Instantiate Network Service - [Arguments] ${ns_name} ${nsd} ${vim_name} ${ns_extra_args} - - ${rc} ${stdout}= Run and Return RC and Output osm ns-create --ns_name ${ns_name} --nsd_name ${nsd} --vim_account ${vim_name} ${ns_extra_args} - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - [Return] ${stdout} - - -Get Vnf Management Ip Address - [Arguments] ${ns_id} ${vnf_member_index} - - Should Not Be Empty ${ns_id} - Should Not Be Empty ${vnf_member_index} - ${rc} ${stdout}= Run and Return RC and Output osm vnf-list --filter member-vnf-index-ref=${vnf_member_index} | grep ${ns_id} | awk '{print $14}' 2>&1 - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - [Return] ${stdout} - - -Get Ns Vnf List - [Arguments] ${ns_id} - - Should Not Be Empty ${ns_id} - @{vnf_list_string}= Run and Return RC and Output osm vnf-list | grep ${ns_id} | awk '{print $2}' 2>&1 - # Returns a String of vnf_id and needs to be converted into a list - @{vnf_list} = Split String ${vnf_list_string}[1] - Log List ${vnf_list} - [Return] @{vnf_list} - - -Get Ns Ip List - [Arguments] @{vnf_list} - - should not be empty @{vnf_list} - @{temp_list}= Create List - FOR ${vnf_id} IN @{vnf_list} - log ${vnf_id} - @{vnf_ip_list} Get Vnf Ip List ${vnf_id} - @{temp_list}= Combine Lists ${temp_list} ${vnf_ip_list} - END - should not be empty ${temp_list} - [return] @{temp_list} - - -Get Vnf Ip List - [arguments] ${vnf_id} - - should not be empty ${vnf_id} - @{vnf_ip_list_string}= run and return rc and output osm vnf-show ${vnf_id} --filter vdur --literal | grep -o '[0-9]\\{1,3\\}\\.[0-9]\\{1,3\\}\\.[0-9]\\{1,3\\}\\.[0-9]\\{1,3\\}' | sort -t: -u -k1,1 2>&1 - # returns a string of ip addresses and needs to be converted into a list - should not be empty ${vnf_ip_list_string}[1] - @{vnf_ip_list} = split string ${vnf_ip_list_string}[1] - log list ${vnf_ip_list} - should not be empty ${vnf_ip_list} - [return] @{vnf_ip_list} - - -Check For Ns Instance To Configured - [arguments] ${ns_name} - - ${rc} ${stdout}= run and return rc and output osm ns-list --filter name="${ns_name}" - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - Should Contain Any ${stdout} READY BROKEN - -Check For NS Instance For Failure - [Arguments] ${ns_name} - - ${rc} ${stdout}= Run and Return RC and Output osm ns-list --filter name="${ns_name}" - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - Should Not Contain ${stdout} BROKEN - -Check For NS Instance To Be Deleted - [Arguments] ${ns} - - ${rc} ${stdout}= Run and Return RC and Output osm ns-list | awk '{print $2}' | grep ${ns} - Should Not Be Equal As Strings ${stdout} ${ns} - -Delete NS - [Documentation] Delete ns - [Arguments] ${ns} - - ${rc} ${stdout}= Run and Return RC and Output osm ns-delete ${ns} - 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 Deleted ${ns} - -Execute NS Action - [Documentation] Execute an action over the desired NS. - ... Parameters are given to this function in key=value format (one argument per key/value pair). - ... Return the ID of the operation associated to the executed action. - ... Examples of execution: - ... \${ns_op_id}= Execute NS Action \${ns_name} \${ns_action} \${vnf_member_index} - ... \${ns_op_id}= Execute NS Action \${ns_name} \${ns_action} \${vnf_member_index} \${param1}=\${value1} \${param2}=\${value2} - - [Arguments] ${ns_name} ${ns_action} ${vnf_member_index} @{action_params} - - ${params}= Set Variable ${EMPTY} - FOR ${param} IN @{action_params} - ${match} ${param_name} ${param_value} = Should Match Regexp ${param} (.+)=(.+) msg=Syntax error in parameters - ${params}= Catenate SEPARATOR= ${params} "${param_name}":"${param_value}", - END - ${osm_ns_action_command}= Set Variable osm ns-action --action_name ${ns_action} --vnf_name ${vnf_member_index} - ${osm_ns_action_command}= Run Keyword If '${params}'!='${EMPTY}' Catenate ${osm_ns_action_command} --params '{${params}}' - ... ELSE Set Variable ${osm_ns_action_command} - ${osm_ns_action_command}= Catenate ${osm_ns_action_command} ${ns_name} - ${rc} ${stdout}= Run and Return RC and Output ${osm_ns_action_command} - Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False - Wait Until Keyword Succeeds ${ns_action_max_wait_time} ${ns_action_pol_time} Check For NS Operation Completed ${stdout} - [Return] ${stdout} - - -Execute Manual VNF Scale - [Documentation] Execute a manual VNF Scale action. - ... The parameter 'scale_type' must be SCALE_IN or SCALE_OUT. - ... Return the ID of the operation associated to the executed scale action. - - [Arguments] ${ns_name} ${vnf_member_index} ${scaling_group} ${scale_type} - - Should Contain Any ${scale_type} SCALE_IN SCALE_OUT msg=Unknown scale type: ${scale_type} values=False - ${osm_vnf_scale_command}= Set Variable osm vnf-scale --scaling-group ${scaling_group} - ${osm_vnf_scale_command}= Run Keyword If '${scale_type}'=='SCALE_IN' Catenate ${osm_vnf_scale_command} --scale-in - ... ELSE Catenate ${osm_vnf_scale_command} --scale-out - ${osm_vnf_scale_command}= Catenate ${osm_vnf_scale_command} ${ns_name} ${vnf_member_index} - ${rc} ${stdout}= Run and Return RC and Output ${osm_vnf_scale_command} - Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False - Wait Until Keyword Succeeds ${ns_action_max_wait_time} ${ns_action_pol_time} Check For NS Operation Completed ${stdout} - [Return] ${stdout} - - -Get Operations List - [Arguments] ${ns_name} - - ${rc} ${stdout}= Run and Return RC and Output osm ns-op-list ${ns_name} - log ${stdout} - log ${rc} - Should Be Equal As Integers ${rc} ${success_return_code} - - -Check For NS Operation Completed - [Documentation] Check wheter the status of the desired operation is "COMPLETED" or not. - - [Arguments] ${ns_operation_id} - - ${rc} ${stdout}= Run and Return RC and Output osm ns-op-show ${ns_operation_id} --literal | yq r - operationState - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - Should Contain ${stdout} COMPLETED msg=Timeout waiting for ns-action with id ${ns_operation_id} values=False - - -Get Ns Vnfr Ids - [Documentation] Return a list with the IDs of the VNF records of a NS instance. - - [Arguments] ${ns_id} - - ${rc} ${stdout}= Run and Return RC and Output osm vnf-list | grep ${ns_id} | awk '{print $2}' 2>&1 - Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False - @{vdur} = Split String ${stdout} - [Return] @{vdur} - - -Get Vnf Vdur Names - [Documentation] Return a list with the names of the VDU records of a VNF instance. - - [Arguments] ${vnf_id} - - ${rc} ${stdout}= Run and Return RC and Output osm vnf-show ${vnf_id} --literal | yq r - vdur.*.name - Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False - @{vdur} = Split String ${stdout} - [Return] @{vdur} - diff --git a/robot-systest/lib/nsd_lib.robot b/robot-systest/lib/nsd_lib.robot deleted file mode 100644 index c7ebbe75..00000000 --- a/robot-systest/lib/nsd_lib.robot +++ /dev/null @@ -1,67 +0,0 @@ -# -*- coding: utf-8 -*- - -## -# Copyright 2019 Tech Mahindra Limited -# -# 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. Feature 7829: Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 06-sep-2019 -## - -*** Settings *** -Library String - - -*** Variables *** -${success_return_code} 0 -${delete_max_wait_time} 1min -${delete_pol_time} 15sec - - -*** Keywords *** -Get NSDs List - ${rc} ${stdout}= Run and Return RC and Output osm nsd-list - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - - -Create NSD - [Arguments] ${nsd_pkg} - - ${rc} ${stdout}= Run and Return RC and Output osm nsd-create ${nsd_pkg} - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - ${lines}= Get Line Count ${stdout} - ${last}= Evaluate ${lines} - 1 - ${id}= Get Line ${stdout} ${last} - [Return] ${id} - - -Delete NSD - [Arguments] ${nsd_id} - - ${rc} ${stdout}= Run Keyword And Continue On Failure Run and Return RC and Output osm nsd-delete ${nsd_id} - Should Be Equal As Integers ${rc} ${success_return_code} - log ${stdout} - WAIT UNTIL KEYWORD SUCCEEDS ${delete_max_wait_time} ${delete_pol_time} Check For NSD ${nsd_id} - - -Check For NSD - [Arguments] ${nsd_id} - - ${rc} ${stdout}= Run and Return RC and Output osm nsd-list | awk '{print $2}' | grep ${nsd_id} - Should Not Be Equal As Strings ${stdout} ${nsd_id} diff --git a/robot-systest/lib/nsi_lib.robot b/robot-systest/lib/nsi_lib.robot deleted file mode 100644 index 28bb872a..00000000 --- a/robot-systest/lib/nsi_lib.robot +++ /dev/null @@ -1,206 +0,0 @@ -# Copyright 2020 Atos -# -# 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. - -*** Settings *** -Library Collections - - -*** Variables *** -${success_return_code} 0 -${slice_launch_max_wait_time} 5min -${slice_launch_pol_time} 30sec -${slice_delete_max_wait_time} 1min -${slice_delete_pol_time} 15sec - -*** Keywords *** - -Create Network Slice - [Documentation] Instantiates a NST and returns an instantiation id (nsi), verifying the slice is successfully instantiated - ... Parameters: - ... nst: Name of the slice template - ... vim_name: Name of the VIM entry already in OSM - ... slice_name: Name of the slice instance - ... slice_config: Extra parameters that might require the slice instantiation i.e. configuration attributes - ... publickey: SSH public key of the local machine - ... Execution example: - ... \${nsi}= Create Network Slice \${nst} \${vim_name} \${slice_name} \${slice_config} \${publickey} - - [Arguments] ${nst} ${vim_name} ${slice_name} ${slice_config} ${publickey} - - ${config_attr} Set Variable If '${slice_config}'!='${EMPTY}' --config '${slice_config}' \ - ${sshkeys_attr} Set Variable If '${publickey}'!='${EMPTY}' --ssh_keys ${publickey} \ - - ${nsi_id}= Instantiate Network Slice ${slice_name} ${nst} ${vim_name} ${config_attr} #${sshkeys_attr} - log ${nsi_id} - - WAIT UNTIL KEYWORD SUCCEEDS ${slice_launch_max_wait_time} ${slice_launch_pol_time} Check For Network Slice Instance To Configured ${slice_name} - Check For Network Slice Instance For Failure ${slice_name} - [Return] ${nsi_id} - - -Instantiate Network Slice - [Documentation] Instantiates a NST and returns an instantiation id (nsi) - ... Parameters: - ... slice_name: Name of the slice instance - ... nst: Name of the slice template - ... vim_name: Name of the VIM entry already in OSM - ... slice_extra_args: Extra parameters that might require the slice instantiation i.e. configuration attributes - ... Execution example: - ... \${nsi}= Instantiate Network Slice \${slice_name} \${nst} \${vim_name} \${config_attr} - - [Arguments] ${slice_name} ${nst} ${vim_name} ${slice_extra_args} - - ${rc} ${stdout}= Run and Return RC and Output osm nsi-create --nsi_name ${slice_name} --nst_name ${nst} --vim_account ${vim_name} ${slice_extra_args} - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - [Return] ${stdout} - - -Get Slice Ns List - [Documentation] Retrieves the list of NS in a slice - ... Parameters: - ... slice_name: Name of the slice instance - ... Execution example: - ... \@{slice_ns_list}= Get Slice Ns List \${slice_name} - - [Arguments] ${slice_name} - - Should Not Be Empty ${slice_name} - @{ns_list_string}= Run and Return RC and Output osm ns-list | grep ${slice_name} | awk '{print $4}' 2>&1 - # Returns a String of ns_id and needs to be converted into a list - @{ns_list} = Split String ${ns_list_string}[1] - Log List ${ns_list} - [Return] @{ns_list} - - -Get Slice Ns List Except One - [Documentation] Retrieves the list of NS in a slice removing one from the list. This is done to save time in the tests, avoiding one VNF to ping itself. - ... Parameters: - ... slice_name: Name of the slice instance - ... exception_ns: Name of the ns that will not appear in the final list - ... Execution example: - ... \@{slice_ns_list}= Get Slice Ns List Except One \${slice_name} \${exception_ns} - - [Arguments] ${slice_name} ${exception_ns} - - Should Not Be Empty ${slice_name} - Should Not Be Empty ${exception_ns} - - @{ns_list_string}= Run and Return RC and Output osm ns-list | grep ${slice_name} | awk '!/${exception_ns}/' | awk '{print $4}' 2>&1 - # Returns a String of ns_id and needs to be converted into a list - @{ns_list} = Split String ${ns_list_string}[1] - Log List ${ns_list} - [Return] @{ns_list} - - -Get Slice Ns Count - [Documentation] Returns the count of all the NS in a slice - ... Parameters: - ... slice_name: Name of the slice instance - ... Execution example: - ... \${slice_ns_count}= Get Slice Ns Count \${slice_name} - - [Arguments] ${slice_name} - - Should Not Be Empty ${slice_name} - ${rc} ${stdout}= Run and Return RC and Output osm ns-list | grep ${slice_name} | wc -l 2>&1 - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - [Return] ${stdout} - - -Get Slice Vnf Ip Addresses - [Documentation] Retrieves the list of IP addresses that belong to each of the VNFs in the slice - ... Parameters: - ... slice_name: Name of the slice instance - ... Execution example: - ... \@{slice_ip_address_list}= Get Slice Vnf Ip Addresses \${slice_name} - - [Arguments] ${slice_name} - - # Get all the ns_id in the slice - @{slice_ns_list} Get Slice Ns List ${slice_name} - log many @{slice_ns_list} - @{temp_list}= Create List - # For each ns_id in the list, get all the vnf_id and their IP addresses - FOR ${ns_id} IN @{slice_ns_list} - log ${ns_id} - @{vnf_id_list} Get Ns Vnf List ${ns_id} - # For each vnf_id in the list, get all its IP addresses - @{ns_ip_list} Get Ns Ip List @{vnf_id_list} - @{temp_list}= Combine Lists ${temp_list} ${ns_ip_list} - END - Log List ${temp_list} - [Return] @{temp_list} - - -Check For Network Slice Instance To Configured - [Documentation] Verify the slice has been instantiated - ... Parameters: - ... slice_name: Name of the slice instance - ... Execution example: - ... Check For Network Slice Instance To Configured \${slice_name} - - [Arguments] ${slice_name} - - ${rc} ${stdout}= Run and Return RC and Output osm nsi-list --filter name="${slice_name}" - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - Should Contain Any ${stdout} READY BROKEN configured - - -Check For Network Slice Instance For Failure - [Documentation] Verify the slice instance is not in failure - ... Parameters: - ... slice_name: Name of the slice instance - ... Execution example: - ... Check For Network Slice Instance For Failure \${slice_name} - - [Arguments] ${slice_name} - - ${rc} ${stdout}= Run and Return RC and Output osm nsi-list --filter name="${slice_name}" - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - Should Not Contain ${stdout} BROKEN - - -Delete NSI - [Documentation] Delete Network Slice Instance (NSI) - ... Parameters: - ... slice_name: Name of the slice instance - ... Execution example: - ... Delete NST \${slice_name} - - [Arguments] ${slice_name} - - ${rc} ${stdout}= Run and Return RC and Output osm nsi-delete ${slice_name} - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - - WAIT UNTIL KEYWORD SUCCEEDS ${slice_delete_max_wait_time} ${slice_delete_pol_time} Check For Network Slice Instance To Be Deleted ${slice_name} - - -Check For Network Slice Instance To Be Deleted - [Documentation] Verify the slice instance is not present - ... Parameters: - ... slice_name: Name of the slice instance - ... Execution example: - ... Check For Network Slice Instance \${slice_name} - - [Arguments] ${slice_name} - - ${rc} ${stdout}= Run and Return RC and Output osm nsi-list | awk '{print $2}' | grep ${slice_name} - Should Not Be Equal As Strings ${stdout} ${slice_name} - - diff --git a/robot-systest/lib/nst_lib.robot b/robot-systest/lib/nst_lib.robot deleted file mode 100644 index 60d874a4..00000000 --- a/robot-systest/lib/nst_lib.robot +++ /dev/null @@ -1,53 +0,0 @@ -# Copyright 2020 Atos -# -# 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. - -*** Variables *** -${success_return_code} 0 -${ns_launch_max_wait_time} 5min -${ns_launch_pol_time} 30sec -${ns_delete_max_wait_time} 1min -${ns_delete_pol_time} 15sec - -*** Keywords *** -Get NST List - ${rc} ${stdout}= Run and Return RC and Output osm netslice-template-list - log ${stdout} - log ${rc} - Should Be Equal As Integers ${rc} ${success_return_code} - - -Create NST - [Arguments] ${nst} - - ${rc} ${stdout}= Run and Return RC and Output osm netslice-template-create ${nst} - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - [Return] ${stdout} - - -Delete NST - [Arguments] ${nst_id} - - ${rc} ${stdout}= Run and Return RC and Output osm netslice-template-delete ${nst_id} - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - WAIT UNTIL KEYWORD SUCCEEDS ${delete_max_wait_time} ${delete_pol_time} Check For NST ${nst_id} - - -Check For NST - [Arguments] ${nst_id} - - ${rc} ${stdout}= Run and Return RC and Output osm netslice-template-list | awk '{print $2}' | grep ${nst_id} - Should Not Be Equal As Strings ${stdout} ${nst_id} - diff --git a/robot-systest/lib/prometheus_lib.robot b/robot-systest/lib/prometheus_lib.robot deleted file mode 100644 index d4c6b143..00000000 --- a/robot-systest/lib/prometheus_lib.robot +++ /dev/null @@ -1,60 +0,0 @@ -# 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. - -*** Settings *** -Documentation Library to obtain metrics from Prometheus. - -Library String -Library Collections -Library RequestsLibrary - - -*** Variables *** -${timeout} 1000 -${max_retries} 1 - - -*** Keywords *** -Get Metric - [Documentation] Get the instant value of a metric from Prometheus using multiple filter parameters. - ... The filter parameters are given to this function in key=value format (one argument per key/value pair). - ... Fails if the metric is not found or has multiple values. - ... Examples of execution: - ... \${metric}= Get Metric \${prometheus_ip} \${prometheus_port} \${metric} - ... \${metric}= Get Metric \${prometheus_ip} \${prometheus_port} \${metric} \${param1}=\${value1} \${param2}=\${value2} - - [Arguments] ${prometheus_ip} ${prometheus_port} ${metric} @{filter_parameters} - - ${filter}= Set Variable ${EMPTY} - FOR ${param} IN @{filter_parameters} - ${match} ${param_name} ${param_value} = Should Match Regexp ${param} (.+)=(.+) msg=Syntax error in filter parameters - ${filter}= Catenate SEPARATOR= ${filter} ${param_name}="${param_value}", - END - ${resp}= Execute Prometheus Instant Query ${prometheus_host} ${prometheus_port} query=${metric}{${filter}} - ${result_list}= Convert To List ${resp["data"]["result"]} - ${results}= Get Length ${result_list} - Should Not Be Equal As Numbers 0 ${results} msg=Metric ${metric} not found values=false - Should Be Equal As Integers 1 ${results} msg=Metric ${metric} with multiple values values=false - [Return] ${result_list[0]["value"][1]} - - -Execute Prometheus Instant Query - [Documentation] Execute a Prometheus Instant Query using HTTP API. - ... Return an inline json with the result of the query. - ... The requested URL is the next: http://\${prometheus_ip}:\${prometheus_port}/api/v1/query?\${querystring} - - [Arguments] ${prometheus_ip} ${prometheus_port} ${querystring} - - Create Session prometheus http://${prometheus_ip}:${prometheus_port} timeout=${timeout} max_retries=${max_retries} - ${resp}= Get Request prometheus /api/v1/query?${querystring} timeout=${timeout} - Status Should Be 200 ${resp} - [Return] ${resp.json()} diff --git a/robot-systest/lib/ssh_lib.robot b/robot-systest/lib/ssh_lib.robot deleted file mode 100644 index 23e5ae49..00000000 --- a/robot-systest/lib/ssh_lib.robot +++ /dev/null @@ -1,69 +0,0 @@ -# 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. - -*** Keywords *** -Test SSH Connection - [Arguments] ${host} ${username} ${password} ${privatekey} - - Open Connection ${host} - Run Keyword If '${password}'!='${EMPTY}' Login ${username} ${password} - ... ELSE Login With Public Key ${username} ${privatekey} - Execute Command hostname - Close All Connections - -Check If remote File Exists - [Arguments] ${host} ${username} ${password} ${privatekey} ${file} - - Open Connection ${host} - Run Keyword If '${password}'!='${EMPTY}' Login ${username} ${password} - ... ELSE Login With Public Key ${username} ${privatekey} - ${rc}= Execute Command ls ${file} >& /dev/null return_stdout=False return_rc=True - Close All Connections - Should Be Equal As Integers ${rc} 0 - -Get Remote File Content - [Arguments] ${host} ${username} ${password} ${privatekey} ${file} - - Open Connection ${host} - Run Keyword If '${password}'!='${EMPTY}' Login ${username} ${password} - ... ELSE Login With Public Key ${username} ${privatekey} - ${output}= Execute Command cat ${file} - Close All Connections - [Return] ${output} - -Ping Many - [Arguments] ${host} ${username} ${password} ${privatekey} @{ip_list} - - Open Connection ${host} - Run Keyword If '${password}'!='${EMPTY}' Login ${username} ${password} - ... ELSE Login With Public Key ${username} ${privatekey} - FOR ${ip} IN @{ip_list} - ${result}= Execute Command ping -c 5 -W 1 ${ip} > /dev/null && echo OK shell=True - Log ${result} - Should Contain ${result} OK - END - Close All Connections - - -Execute Remote Command Check Rc Return Output - [Arguments] ${host} ${username} ${password} ${privatekey} ${command} - - Open Connection ${host} - Run Keyword If '${password}'!='${EMPTY}' Login ${username} ${password} - ... ELSE Login With Public Key ${username} ${privatekey} - ${stdout} ${rc}= Execute Command ${command} return_rc=True return_stdout=True - log ${rc} - log ${stdout} - Close All Connections - Should Be Equal As Integers ${rc} 0 - [Return] ${stdout} - diff --git a/robot-systest/lib/vim_lib.robot b/robot-systest/lib/vim_lib.robot deleted file mode 100644 index b6c452f3..00000000 --- a/robot-systest/lib/vim_lib.robot +++ /dev/null @@ -1,93 +0,0 @@ -# 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. - -*** Settings *** -Documentation Library to manage VIM Targets. - -Library String -Library Collections -Library OperatingSystem - -Resource %{ROBOT_DEVOPS_FOLDER}/lib/prometheus_lib.robot - - -*** Variables *** -${success_return_code} 0 -${delete_max_wait_time} 1min -${delete_pol_time} 15sec -${vim_status_max_wait_time} 1min -${vim_status_pol_time} 15sec - - -*** Keywords *** -Create VIM Target - [Documentation] Create a VIM Target in OSM. - ... The optional parameters (such as 'config' or 'sdn_controller') are given to this function in name=value format. These parameters will be appended to the 'osm vim-create' command with the next syntax: --param_name=param_value - ... Return the ID of the created VIM Target. - ... Example of execution: - ... \${vim_account_id}= Create VIM Target \${vim_name} \${vim_user} \${vim_password} \${vim_auth_url} \${vim_tenant} \${vim_account_type} config='{...}' - - [Arguments] ${vim_name} ${vim_user} ${vim_password} ${vim_auth_url} ${vim_tenant} ${vim_account_type} @{optional_parameters} - - ${osm_vim_create_command}= Set Variable osm vim-create --name ${vim_name} --user ${vim_user} --password ${vim_password} --auth_url ${vim_auth_url} --tenant ${vim_tenant} --account_type ${vim_account_type} - FOR ${param} IN @{optional_parameters} - ${match} ${param_name} ${param_value} = Should Match Regexp ${param} (.+)=(.+) msg=Syntax error in optional parameters - ${osm_vim_create_command}= Catenate ${osm_vim_create_command} --${param_name}=${param_value} - END - ${rc} ${stdout}= Run and Return RC and Output ${osm_vim_create_command} - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - [Return] ${stdout} - - -Delete VIM Target - [Arguments] ${vim_name} - - ${rc} ${stdout}= Run Keyword And Continue On Failure Run and Return RC and Output osm vim-delete ${vim_name} - log ${stdout} - Wait Until Keyword Succeeds ${delete_max_wait_time} ${delete_pol_time} Check for VIM Target ${vim_name} - - -Get VIM Targets - ${rc} ${stdout}= Run and Return RC and Output osm vim-list - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - - -Check for VIM Target - [Arguments] ${vim_name} - - ${rc} ${stdout}= Run and Return RC and Output osm vim-list | awk '{print $2}' | grep ${vim_name} - Should Not Be Equal As Strings ${stdout} ${vim_name} - - -Check for VIM Target Status - [Arguments] ${vim_name} ${prometheus_host} ${prometheus_port} - - ${vim_account_id}= Get VIM Target ID ${vim_name} - Wait Until Keyword Succeeds ${vim_status_max_wait_time} ${vim_status_pol_time} Check If VIM Target Is Available ${vim_account_id} ${prometheus_host} ${prometheus_port} - - -Get VIM Target ID - [Arguments] ${vim_name} - - ${rc} ${stdout}= Run and Return RC and Output osm vim-list | grep " ${vim_name} " | awk '{print $4}' - Should Be Equal As Integers ${rc} ${success_return_code} - Should Not Be Equal As Strings ${stdout} ${EMPTY} msg=VIM Target '${vim_name}' not found values=false - [Return] ${stdout} - - -Check If VIM Target Is Available - [Arguments] ${vim_account_id} ${prometheus_host} ${prometheus_port} - - ${metric}= Get Metric ${prometheus_host} ${prometheus_port} osm_vim_status vim_account_id=${vim_account_id} - Should Be Equal As Integers ${metric} 1 msg=VIM Target '${vim_account_id}' is not active values=false diff --git a/robot-systest/lib/vnfd_lib.robot b/robot-systest/lib/vnfd_lib.robot deleted file mode 100644 index fdef1acc..00000000 --- a/robot-systest/lib/vnfd_lib.robot +++ /dev/null @@ -1,68 +0,0 @@ -# -*- coding: utf-8 -*- - -## -# Copyright 2019 Tech Mahindra Limited -# -# 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. Feature 7829: Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 06-sep-2019 -## - -*** Settings *** -Library String - - -*** Variables *** -${success_return_code} 0 -${delete_max_wait_time} 1min -${delete_pol_time} 15sec - - -*** Keywords *** -Get VNFDs List - ${rc} ${stdout}= Run and Return RC and Output osm vnfd-list - log ${stdout} - log ${rc} - Should Be Equal As Integers ${rc} ${success_return_code} - - -Create VNFD - [Arguments] ${vnfd_pkg} - - ${rc} ${stdout}= Run and Return RC and Output osm vnfd-create ${vnfd_pkg} - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - ${lines}= Get Line Count ${stdout} - ${last}= Evaluate ${lines} - 1 - ${id}= Get Line ${stdout} ${last} - [Return] ${id} - - -Delete VNFD - [Arguments] ${vnfd_id} - - ${rc} ${stdout}= Run and Return RC and Output osm vnfd-delete ${vnfd_id} - log ${stdout} - Should Be Equal As Integers ${rc} ${success_return_code} - WAIT UNTIL KEYWORD SUCCEEDS ${delete_max_wait_time} ${delete_pol_time} Check For VNFD ${vnfd_id} - - -Check For VNFD - [Arguments] ${vnfd_id} - - ${rc} ${stdout}= Run and Return RC and Output osm vnfd-list | awk '{print $2}' | grep ${vnfd_id} - Should Not Be Equal As Strings ${stdout} ${vnfd_id} diff --git a/robot-systest/resources/basic_01-crud_operations_on_vim_targets_data.py b/robot-systest/resources/basic_01-crud_operations_on_vim_targets_data.py deleted file mode 100644 index c30314e5..00000000 --- a/robot-systest/resources/basic_01-crud_operations_on_vim_targets_data.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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. - -import os -import yaml -from pathlib import Path - -# Prometheus host and port -prometheus_host = os.environ.get("OSM_HOSTNAME") -prometheus_port = "9091" - -# VIM Configuration -vim_account_type = "openstack" -vim_name_prefix = "basic_01_vim_test" -# Get credentias from Openstack Clouds file -os_cloud = os.environ.get("OS_CLOUD") -clouds_file_paths = ["./clouds.yaml", str(Path.home()) + "/.config/openstack/clouds.yaml", "/etc/openstack/clouds.yaml"] -for path in clouds_file_paths: - clouds_file_path = Path(path) - if clouds_file_path.exists(): break -if not clouds_file_path.exists(): raise Exception("Openstack clouds file not found") -with clouds_file_path.open() as clouds_file: - clouds = yaml.safe_load(clouds_file) - if not os_cloud in clouds["clouds"]: raise Exception("Openstack cloud '" + os_cloud + "' not found") - cloud = clouds["clouds"][os_cloud] - if not "username" in cloud["auth"]: raise Exception("Username not found in Openstack cloud '" + os_cloud + "'") - vim_user = cloud["auth"]["username"] - if not "password" in cloud["auth"]: raise Exception("Password not found in Openstack cloud '" + os_cloud + "'") - vim_password = cloud["auth"]["password"] - if not "auth_url" in cloud["auth"]: raise Exception("Auth url not found in Openstack cloud '" + os_cloud + "'") - vim_auth_url = cloud["auth"]["auth_url"] - if not "project_name" in cloud["auth"]: raise Exception("Project name not found in Openstack cloud '" + os_cloud + "'") - vim_tenant = cloud["auth"]["project_name"] - vim_user_domain_name = cloud["auth"]["user_domain_name"] if "user_domain_name" in cloud["auth"] else "Default" - vim_project_domain_name = cloud["auth"]["project_domain_name"] if "project_domain_name" in cloud["auth"] else "Default" -# Extra config -vim_config = "'{project_domain_name: " + vim_project_domain_name + ", user_domain_name: " + vim_user_domain_name + ", vim_network_name: " + os.environ.get("VIM_MGMT_NET") + "}'" diff --git a/robot-systest/resources/basic_05-instantiation_parameters_in_cloud_init_data.py b/robot-systest/resources/basic_05-instantiation_parameters_in_cloud_init_data.py deleted file mode 100644 index d4e5312e..00000000 --- a/robot-systest/resources/basic_05-instantiation_parameters_in_cloud_init_data.py +++ /dev/null @@ -1,24 +0,0 @@ -# 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. - -from pathlib import Path - -# Get ${HOME} from local machine -home = str(Path.home()) -# NS and VNF descriptor package folder -vnfd_pkg = 'ubuntu_cloudinit_vnf' -nsd_pkg = 'ubuntu_cloudinit_ns' -# NS and VNF descriptor id -vnfd_name = 'ubuntu_cloudinit-vnf' -nsd_name = 'ubuntu_cloudinit-ns' -# NS instance name -ns_name = 'basic_05_instantiation_params_cloud_init' diff --git a/robot-systest/resources/basic_06-vnf_with_charm_data.py b/robot-systest/resources/basic_06-vnf_with_charm_data.py deleted file mode 100644 index c1a154ce..00000000 --- a/robot-systest/resources/basic_06-vnf_with_charm_data.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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. - -from pathlib import Path - -# Get ${HOME} from local machine -home = str(Path.home()) -# NS and VNF descriptor package folder -vnfd_pkg = 'hackfest_proxycharm_vnf' -nsd_pkg = 'hackfest_proxycharm_ns' -# NS and VNF descriptor id -vnfd_name = 'hackfest_proxycharm-vnf' -nsd_name = 'hackfest_proxycharm-ns' -# NS instance name -ns_name = 'basic_06_charm_test' -# SSH keys to be used -publickey = home + '/.ssh/id_rsa.pub' -privatekey = home + '/.ssh/id_rsa' diff --git a/robot-systest/resources/basic_07-secure_key_management_data.py b/robot-systest/resources/basic_07-secure_key_management_data.py deleted file mode 100644 index 8bd8b38f..00000000 --- a/robot-systest/resources/basic_07-secure_key_management_data.py +++ /dev/null @@ -1,24 +0,0 @@ -# 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. - -from pathlib import Path - -# Get ${HOME} from local machine -home = str(Path.home()) -# NS and VNF descriptor package folder -vnfd_pkg = 'simple_nopasswd_vnf' -nsd_pkg = 'simple_nopasswd_ns' -# NS and VNF descriptor id -vnfd_name = 'simple_nopasswd-vnf' -nsd_name = 'simple_nopasswd-ns' -# NS instance name -ns_name = 'basic_07_secure_key_management' diff --git a/robot-systest/resources/basic_09-manual_vdu_scaling_data.py b/robot-systest/resources/basic_09-manual_vdu_scaling_data.py deleted file mode 100644 index 31b45a23..00000000 --- a/robot-systest/resources/basic_09-manual_vdu_scaling_data.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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. - -from pathlib import Path - -# Get ${HOME} from local machine -home = str(Path.home()) -# NS and VNF descriptor package folder -vnfd_pkg = 'hackfest_basic_metrics_vnf' -nsd_pkg = 'hackfest_basic_metrics_ns' -# NS and VNF descriptor id -vnfd_name = 'hackfest_basic_metrics-vnf' -nsd_name = 'hackfest_basic-ns-metrics' -# NS instance name -ns_name = 'basic_09_manual_scaling_test' -# SSH keys to be used -publickey = home + '/.ssh/id_rsa.pub' -privatekey = home + '/.ssh/id_rsa' diff --git a/robot-systest/resources/basic_network_slicing_data.py b/robot-systest/resources/basic_network_slicing_data.py deleted file mode 100644 index 7ad30f4b..00000000 --- a/robot-systest/resources/basic_network_slicing_data.py +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright 2020 Atos -# -# 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. - -from pathlib import Path - -# Get ${HOME} from local machine -home = str(Path.home()) -# NS and VNF descriptor package files -vnfd1_pkg = 'slice_basic_vnf' -vnfd2_pkg = 'slice_basic_middle_vnfd' -nsd1_pkg = 'slice_basic_ns' -nsd2_pkg = 'slice_basic_middle_nsd' -nst = 'slice_basic_nst/slice_basic_nst.yaml' -# Instance names -slice_name = 'slicebasic' -middle_ns_name = 'slicebasic.slice_basic_nsd_2' -# Descriptor names -nst_name = 'slice_basic_nst' -vnfd1_name = 'slice_basic_vnfd' -vnfd2_name = 'slice_basic_middle_vnfd' -nsd1_name = 'slice_basic_nsd' -nsd2_name = 'slice_basic_middle_nsd' -# SSH keys to be used -publickey = home + '/.ssh/id_rsa.pub' -privatekey = home + '/.ssh/id_rsa' - diff --git a/robot-systest/resources/hackfest_basic_ns_data.py b/robot-systest/resources/hackfest_basic_ns_data.py deleted file mode 100644 index 0f927ed7..00000000 --- a/robot-systest/resources/hackfest_basic_ns_data.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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. - -from pathlib import Path - -# Get ${HOME} from local machine -home = str(Path.home()) -# NS and VNF descriptor package folder -vnfd_pkg = 'hackfest_basic_vnf' -nsd_pkg = 'hackfest_basic_ns' -# NS and VNF descriptor package id -vnfd_name = 'hackfest_basic-vnf' -nsd_name = 'hackfest_basic-ns' -# NS instance name -ns_name = 'hfbasic' -# SSH keys to be used -publickey = home + '/.ssh/id_rsa.pub' -privatekey = home + '/.ssh/id_rsa' diff --git a/robot-systest/resources/hackfest_cloudinit_ns_data.py b/robot-systest/resources/hackfest_cloudinit_ns_data.py deleted file mode 100644 index d914c496..00000000 --- a/robot-systest/resources/hackfest_cloudinit_ns_data.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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. - -from pathlib import Path - -# Get ${HOME} from local machine -home = str(Path.home()) -# NS and VNF descriptor package folder -vnfd_pkg = 'hackfest_cloudinit_vnf' -nsd_pkg = 'hackfest_cloudinit_ns' -# NS and VNF descriptor package id -vnfd_name = 'hackfest_cloudinit-vnf' -nsd_name = 'hackfest_cloudinit-ns' -# NS instance name -ns_name = 'hfcloudinit' -# SSH keys to be used -publickey = home + '/.ssh/id_rsa.pub' -privatekey = home + '/.ssh/id_rsa' diff --git a/robot-systest/resources/hackfest_multivdu_ns_data.py b/robot-systest/resources/hackfest_multivdu_ns_data.py deleted file mode 100644 index 7c75b67b..00000000 --- a/robot-systest/resources/hackfest_multivdu_ns_data.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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. - -from pathlib import Path - -# Get ${HOME} from local machine -home = str(Path.home()) -# NS and VNF descriptor package folder -vnfd_pkg = 'hackfest_multivdu_vnf' -nsd_pkg = 'hackfest_multivdu_ns' -# NS and VNF descriptor package id -vnfd_name = 'hackfest_multivdu-vnf' -nsd_name = 'hackfest_multivdu-ns' -# NS instance name -ns_name = 'hfmultivdu' -# SSH keys to be used -publickey = home + '/.ssh/id_rsa.pub' -privatekey = home + '/.ssh/id_rsa' diff --git a/robot-systest/resources/k8s_02-k8scluster_creation_data.py b/robot-systest/resources/k8s_02-k8scluster_creation_data.py deleted file mode 100644 index 8a816ab8..00000000 --- a/robot-systest/resources/k8s_02-k8scluster_creation_data.py +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright 2020 Canonical Ltd. -# -# 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. - -from pathlib import Path - -# Get ${HOME} from local machine -home = str(Path.home()) -# K8s cluster name -k8scluster_name = 'k8s-test' -k8scluster_version = 'v1' -# SSH keys to be used -publickey = home + '/.ssh/id_rsa.pub' -privatekey = home + '/.ssh/id_rsa' diff --git a/robot-systest/resources/k8s_03-simple_k8s_data.py b/robot-systest/resources/k8s_03-simple_k8s_data.py deleted file mode 100644 index 4ecfe595..00000000 --- a/robot-systest/resources/k8s_03-simple_k8s_data.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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. - -from pathlib import Path - -# Get ${HOME} from local machine -home = str(Path.home()) -# K8s cluster name -k8scluster_name = 'k8s-test' -k8scluster_version = 'v1' -# NS and VNF descriptor package files -vnfd_pkg = 'hackfest_simple_k8s_vnfd.tar.gz' -nsd_pkg = 'hackfest_simple_k8s_nsd.tar.gz' -# NS and VNF descriptor package files -vnfd_name = 'hackfest-simple-k8s-vnfd' -nsd_name = 'hackfest-simple-k8s-nsd' -# NS instance name -ns_name = 'simple-k8s' -# SSH keys to be used -publickey = home + '/.ssh/id_rsa.pub' -privatekey = home + '/.ssh/id_rsa' diff --git a/robot-systest/resources/shared_network_slicing_data.py b/robot-systest/resources/shared_network_slicing_data.py deleted file mode 100644 index 3af6a395..00000000 --- a/robot-systest/resources/shared_network_slicing_data.py +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 2020 Atos -# -# 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. - -from pathlib import Path - -# Get ${HOME} from local machine -home = str(Path.home()) -# NS and VNF descriptor package files -vnfd1_pkg = 'slice_basic_vnf' -vnfd2_pkg = 'slice_basic_middle_vnfd' -nsd1_pkg = 'slice_basic_ns' -nsd2_pkg = 'slice_basic_middle_nsd' -nst = 'slice_basic_nst/slice_basic_nst.yaml' -nst2 = 'slice_basic_nst/slice_basic_2nd_nst.yaml' -# Instance names -slice_name = 'slicebasic' -slice2_name = 'sliceshared' -middle_ns_name = 'slicebasic.slice_basic_nsd_2' -# Descriptor names -nst_name = 'slice_basic_nst' -nst2_name = 'slice_basic_nst2' -vnfd1_name = 'slice_basic_vnfd' -vnfd2_name = 'slice_basic_middle_vnfd' -nsd1_name = 'slice_basic_nsd' -nsd2_name = 'slice_basic_middle_nsd' -# SSH keys to be used -publickey = home + '/.ssh/id_rsa.pub' -privatekey = home + '/.ssh/id_rsa' - diff --git a/robot-systest/resources/slice_shared_ns_data.py b/robot-systest/resources/slice_shared_ns_data.py deleted file mode 100644 index e345f378..00000000 --- a/robot-systest/resources/slice_shared_ns_data.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright 2020 Atos -# -# 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. - -from pathlib import Path - -# Get ${HOME} from local machine -home = str(Path.home()) -# NS and VNF descriptor package files -vnfd1_pkg = 'slice_hackfest_vnf.tar.gz' -vnfd2_pkg = 'slice_hackfest_middle_vnfd.tar.gz' -nsd1_pkg = 'slice_hackfest_ns.tar.gz' -nsd2_pkg = 'slice_hackfest_middle_nsd.tar.gz' -nst = 'slice_hackfest_nst.yaml' -nst2 = 'slice_hackfest2_nst.yaml' -# Instance names -slice_name = 'slicehfbasic' -slice2_name = 'sliceshared' -middle_ns_name = 'slicehfbasic.slice_hackfest_nsd_2' -# Descriptor names -nst_name = 'slice_hackfest_nst' -nst2_name = 'slice_hackfest2_nst' -vnfd1_name = 'slice_hackfest_vnfd' -vnfd2_name = 'slice_hackfest_middle_vnfd' -nsd1_name = 'slice_hackfest_nsd' -nsd2_name = 'slice_hackfest_middle_nsd' -# SSH keys to be used -publickey = home + '/.ssh/id_rsa.pub' -privatekey = home + '/.ssh/id_rsa' diff --git a/robot-systest/testsuite/basic_01-crud_operations_on_vim_targets.robot b/robot-systest/testsuite/basic_01-crud_operations_on_vim_targets.robot deleted file mode 100644 index 1e4b1210..00000000 --- a/robot-systest/testsuite/basic_01-crud_operations_on_vim_targets.robot +++ /dev/null @@ -1,67 +0,0 @@ -# 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. - -*** Settings *** -Documentation [BASIC-01] CRUD operations on VIM targets. -... All tests will be performed over an Openstack VIM, and the credentials will be loaded from clouds.yaml file. - -Resource %{ROBOT_DEVOPS_FOLDER}/lib/vim_lib.robot - -Variables %{ROBOT_DEVOPS_FOLDER}/resources/basic_01-crud_operations_on_vim_targets_data.py - - -*** Test Cases *** -Create VIM Target Basic - [Documentation] Create a VIM Target only with the mandatory parameters. - ... Checks the status of the VIM in Prometheus after it creation. - [Tags] vim - - ${rand}= Generate Random String 8 [NUMBERS] - ${vim_name}= Catenate SEPARATOR=_ ${vim_name_prefix} ${rand} - Set Suite Variable ${vim_name} - ${created_vim_account_id}= Create VIM Target ${vim_name} ${vim_user} ${vim_password} ${vim_auth_url} ${vim_tenant} ${vim_account_type} - Set Suite Variable ${created_vim_account_id} - Check for VIM Target Status ${vim_name} ${prometheus_host} ${prometheus_port} - - -Delete VIM Target By Name - [Documentation] Delete the VIM Target created in previous test-case by its name. - ... Checks whether the VIM Target was created or not before perform the deletion. - [Tags] vim cleanup - - ${vim_account_id}= Get VIM Target ID ${vim_name} - Should Be Equal As Strings ${vim_account_id} ${created_vim_account_id} - Delete VIM Target ${vim_name} - - -Create VIM Target With Extra Config - [Documentation] Create a VIM Target using the extra parameter 'config'. - ... Checks the status of the VIM in Prometheus after it creation. - [Tags] vim - - ${rand}= Generate Random String 8 [NUMBERS] - ${vim_name}= Catenate SEPARATOR=_ ${vim_name_prefix} ${rand} - Set Suite Variable ${vim_name} - ${created_vim_account_id}= Create VIM Target ${vim_name} ${vim_user} ${vim_password} ${vim_auth_url} ${vim_tenant} ${vim_account_type} config=${vim_config} - Set Suite Variable ${created_vim_account_id} - Check for VIM Target Status ${vim_name} ${prometheus_host} ${prometheus_port} - - -Delete VIM Target By ID - [Documentation] Delete the VIM Target created in previous test-case by its ID. - ... Checks whether the VIM Target was created or not before perform the deletion. - [Tags] vim cleanup - - ${vim_account_id}= Get VIM Target ID ${vim_name} - Should Be Equal As Strings ${vim_account_id} ${created_vim_account_id} - Delete VIM Target ${vim_account_id} - diff --git a/robot-systest/testsuite/basic_05-instantiation_parameters_in_cloud_init.robot b/robot-systest/testsuite/basic_05-instantiation_parameters_in_cloud_init.robot deleted file mode 100644 index 5a1f834b..00000000 --- a/robot-systest/testsuite/basic_05-instantiation_parameters_in_cloud_init.robot +++ /dev/null @@ -1,101 +0,0 @@ -# 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. - -*** Settings *** -Documentation [BASIC-05] Instantiation parameters in cloud-init. - -Library OperatingSystem -Library SSHLibrary - -Resource %{ROBOT_DEVOPS_FOLDER}/lib/vnfd_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/nsd_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/ns_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/ssh_lib.robot - -Variables %{ROBOT_DEVOPS_FOLDER}/resources/basic_05-instantiation_parameters_in_cloud_init_data.py - -Suite Teardown Run Keyword And Ignore Error Test Cleanup - - -*** Variables *** -${username} ubuntu -${new_password} newpassword -${vnf_member_index} 1 -${ns_config} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ], additionalParamsForVnf: [ { member-vnf-index: "${vnf_member_index}", additionalParams: { password: "${new_password}" } } ] } - - -*** Test Cases *** -Create Cloudinit VNF Descriptor - [Tags] instantiation_params - - Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' - - -Create Cloudinit NS Descriptor - [Tags] instantiation_params - - Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' - - -Instantiate Cloudinit Network Service Using Instantiation Parameters - [Documentation] Instantiates the NS using the instantiation parameter 'additionalParamsForVnf' to change the password of the default user. - [Tags] instantiation_params - - ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${EMPTY} - Set Suite Variable ${ns_id} ${id} - - -Get Management Ip Addresses - [Tags] instantiation_params - - ${ip_addr} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index} - log ${ip_addr} - Set Suite Variable ${vnf_ip_addr} ${ip_addr} - - -Test SSH Access With The New Password - [Documentation] Test SSH access with the new password configured via cloud-init. - [Tags] instantiation_params - - Variable Should Exist ${vnf_ip_addr} msg=IP address of the management VNF is not available - Sleep 30s Waiting ssh daemon to be up - Test SSH Connection ${vnf_ip_addr} ${username} ${new_password} ${EMPTY} - - -Delete NS Instance - [Tags] instantiation_params cleanup - - Delete NS ${ns_name} - - -Delete NS Descriptor - [Tags] instantiation_params cleanup - - Delete NSD ${nsd_name} - - -Delete VNF Descriptor - [Tags] instantiation_params cleanup - - Delete VNFD ${vnfd_name} - - -*** Keywords *** -Test Cleanup - [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance - - Run Keyword If Test Failed Delete NS ${ns_name} - - Run Keyword If Test Failed Delete NSD ${nsd_name} - - Run Keyword If Test Failed Delete VNFD ${vnfd_name} - diff --git a/robot-systest/testsuite/basic_06-vnf_with_charm.robot b/robot-systest/testsuite/basic_06-vnf_with_charm.robot deleted file mode 100644 index 2514ce26..00000000 --- a/robot-systest/testsuite/basic_06-vnf_with_charm.robot +++ /dev/null @@ -1,136 +0,0 @@ -# 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. - -*** Settings *** -Documentation [BASIC-06] VNF with Charm. - -Library OperatingSystem -Library SSHLibrary - -Resource %{ROBOT_DEVOPS_FOLDER}/lib/vnfd_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/nsd_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/ns_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/ssh_lib.robot - -Variables %{ROBOT_DEVOPS_FOLDER}/resources/basic_06-vnf_with_charm_data.py - -Suite Teardown Run Keyword And Ignore Error Test Cleanup - - -*** Variables *** -${username} ubuntu -${password} ${EMPTY} -${ns_config} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] } -${action_name} touch -${vnf_member_index_1} 1 -${vnf_member_index_2} 2 -${day_1_file_name} /home/ubuntu/first-touch -${day_2_file_name_1} /home/ubuntu/mytouch1 -${day_2_file_name_2} /home/ubuntu/mytouch2 -${ns_timeout} 15min - - -*** Test Cases *** -Create Charm VNF Descriptor - [Tags] charm - - Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' - - -Create Charm NS Descriptor - [Tags] charm - - Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' - - -Instantiate Charm Network Service - [Tags] charm - - ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} ${ns_timeout} - Set Suite Variable ${ns_id} ${id} - - -Get Management Ip Addresses - [Tags] charm - - ${ip_addr_1} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_1} - log ${ip_addr_1} - Set Suite Variable ${vnf_1_ip_addr} ${ip_addr_1} - ${ip_addr_2} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index_2} - log ${ip_addr_2} - Set Suite Variable ${vnf_2_ip_addr} ${ip_addr_2} - - -Test SSH Access - [Tags] charm - - Variable Should Exist ${vnf_1_ip_addr} msg=IP address of the management VNF '${vnf_member_index_1}' is not available - Variable Should Exist ${vnf_2_ip_addr} msg=IP address of the management VNF '${vnf_member_index_2}' is not available - Sleep 30s Waiting ssh daemon to be up - Test SSH Connection ${vnf_1_ip_addr} ${username} ${password} ${privatekey} - Test SSH Connection ${vnf_2_ip_addr} ${username} ${password} ${privatekey} - - -Check Remote Files Created Via Day 1 Operations - [Documentation] The Charm VNF has a Day 1 operation that creates a file named ${day_1_file_name}. - ... This test checks whether that files have been created or not. - [Tags] charm - - Check If remote File Exists ${vnf_1_ip_addr} ${username} ${password} ${privatekey} ${day_1_file_name} - Check If remote File Exists ${vnf_2_ip_addr} ${username} ${password} ${privatekey} ${day_1_file_name} - - -Execute Day 2 Operations - [Documentation] Performs one Day 2 operation per VNF that creates a new file. - [Tags] charm - - Variable Should Exist ${ns_id} msg=Network service instance is not available - ${ns_op_id_1}= Execute NS Action ${ns_name} ${action_name} ${vnf_member_index_1} filename=${day_2_file_name_1} - ${ns_op_id_2}= Execute NS Action ${ns_name} ${action_name} ${vnf_member_index_2} filename=${day_2_file_name_2} - - -Check Remote Files Created Via Day 2 Operations - [Documentation] Check whether the files created in the previous test via Day 2 operations exist or not. - [Tags] charm - - Check If remote File Exists ${vnf_1_ip_addr} ${username} ${password} ${privatekey} ${day_2_file_name_1} - Check If remote File Exists ${vnf_2_ip_addr} ${username} ${password} ${privatekey} ${day_2_file_name_2} - - -Delete NS Instance - [Tags] charm cleanup - - Delete NS ${ns_name} - - -Delete NS Descriptor - [Tags] charm cleanup - - Delete NSD ${nsd_name} - - -Delete VNF Descriptor - [Tags] charm cleanup - - Delete VNFD ${vnfd_name} - - -*** Keywords *** -Test Cleanup - [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance - - Run Keyword If Test Failed Delete NS ${ns_name} - - Run Keyword If Test Failed Delete NSD ${nsd_name} - - Run Keyword If Test Failed Delete VNFD ${vnfd_name} - diff --git a/robot-systest/testsuite/basic_07-secure_key_management.robot b/robot-systest/testsuite/basic_07-secure_key_management.robot deleted file mode 100644 index b0e0377c..00000000 --- a/robot-systest/testsuite/basic_07-secure_key_management.robot +++ /dev/null @@ -1,126 +0,0 @@ -# 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. - -*** Settings *** -Documentation [BASIC-07] Secure key management. - -Library OperatingSystem -Library SSHLibrary - -Resource %{ROBOT_DEVOPS_FOLDER}/lib/vnfd_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/nsd_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/ns_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/ssh_lib.robot - -Variables %{ROBOT_DEVOPS_FOLDER}/resources/basic_07-secure_key_management_data.py - -Suite Teardown Run Keyword And Ignore Error Test Cleanup - - -*** Variables *** -${username} ubuntu -${password} osm4u -${ns_config} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] } -${action_name} touch -${vnf_member_index} 1 -${day_1_file_name} /home/ubuntu/first-touch -${day_2_file_name} /home/ubuntu/mytouch1 -${ns_timeout} 15min - - -*** Test Cases *** -Create Nopasswd Charm VNF Descriptor - [Tags] nopasswd - - Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' - - -Create Nopasswd Charm NS Descriptor - [Tags] nopasswd - - Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' - - -Instantiate Nopasswd Charm Network Service - [Tags] nopasswd - - ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${EMPTY} ${ns_timeout} - Set Suite Variable ${ns_id} ${id} - - -Get Management Ip Addresses - [Tags] nopasswd - - ${ip_addr} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index} - log ${ip_addr} - Set Suite Variable ${vnf_ip_addr} ${ip_addr} - - -Test SSH Access - [Tags] nopasswd - - Variable Should Exist ${vnf_ip_addr} msg=IP address of the management VNF is not available - Sleep 30s Waiting ssh daemon to be up - Test SSH Connection ${vnf_ip_addr} ${username} ${password} ${EMPTY} - - -Check Remote Files Created Via Day 1 Operations - [Documentation] The Nopasswd VNF has a Day 1 operation that creates a file named ${day_1_file_name} and performs it without password. - ... This test checks whether that files have been created or not. - [Tags] nopasswd - - Check If remote File Exists ${vnf_ip_addr} ${username} ${password} ${EMPTY} ${day_1_file_name} - - -Execute Day 2 Operations - [Documentation] Performs one Day 2 operation that creates a new file, this action is executed without password too. - [Tags] nopasswd - - Variable Should Exist ${ns_id} msg=Network service instance is not available - ${ns_op_id}= Execute NS Action ${ns_name} ${action_name} ${vnf_member_index} filename=${day_2_file_name} - - -Check Remote Files Created Via Day 2 Operations - [Documentation] Check whether the file created in the previous test via Day 2 operation exists or not. - [Tags] nopasswd - - Check If remote File Exists ${vnf_ip_addr} ${username} ${password} ${EMPTY} ${day_2_file_name} - - -Delete NS Instance - [Tags] nopasswd cleanup - - Delete NS ${ns_name} - - -Delete NS Descriptor - [Tags] nopasswd cleanup - - Delete NSD ${nsd_name} - - -Delete VNF Descriptor - [Tags] nopasswd cleanup - - Delete VNFD ${vnfd_name} - - -*** Keywords *** -Test Cleanup - [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance - - Run Keyword If Test Failed Delete NS ${ns_name} - - Run Keyword If Test Failed Delete NSD ${nsd_name} - - Run Keyword If Test Failed Delete VNFD ${vnfd_name} - diff --git a/robot-systest/testsuite/basic_09-manual_vdu_scaling.robot b/robot-systest/testsuite/basic_09-manual_vdu_scaling.robot deleted file mode 100644 index a2e9d110..00000000 --- a/robot-systest/testsuite/basic_09-manual_vdu_scaling.robot +++ /dev/null @@ -1,138 +0,0 @@ -# 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. - -*** Settings *** -Documentation [BASIC-09] Manual VNF/VDU Scaling. - -Library OperatingSystem -Library String -Library Collections - -Resource %{ROBOT_DEVOPS_FOLDER}/lib/vnfd_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/nsd_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/ns_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/ssh_lib.robot - -Variables %{ROBOT_DEVOPS_FOLDER}/resources/basic_09-manual_vdu_scaling_data.py - -Suite Teardown Run Keyword And Ignore Error Test Cleanup - - -*** Variables *** -${ns_config} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] } -${scaling_group} vdu_autoscale -${vnf_member_index} 1 - - -*** Test Cases *** -Create Scaling VNF Descriptor - [Tags] manual_scaling - - Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' - - -Create Scaling NS Descriptor - [Tags] manual_scaling - - Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' - - -Instantiate Scaling Network Service - [Tags] manual_scaling - - ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} - Set Suite Variable ${ns_id} ${id} - - -Get Vnf Id - [Tags] manual_scaling - - Variable Should Exist ${ns_id} msg=Network service instance is not available - @{vnfr_list}= Get Ns Vnfr Ids ${ns_id} - Log List ${vnfr_list} - Set Suite Variable ${vnf_id} ${vnfr_list}[0] - - -Get Vdus Before Scale Out - [Documentation] Get the number of VDU records before the manual scaling. - [Tags] manual_scaling - - @{vdur_list}= Get Vnf Vdur Names ${vnf_id} - Log List ${vdur_list} - ${vdurs}= Get Length ${vdur_list} - Set Suite Variable ${initial_vdur_count} ${vdurs} - - -Perform Manual Vdu Scale Out - [Tags] manual_scaling - - Variable Should Exist ${ns_id} msg=Network service instance is not available - ${ns_op_id}= Execute Manual VNF Scale ${ns_name} ${vnf_member_index} ${scaling_group} SCALE_OUT - - -Check Vdus After Scale Out - [Documentation] Check whether there is one more VDU after scaling or not. - [Tags] manual_scaling - - Variable Should Exist ${ns_id} msg=Network service instance is not available - @{vdur_list}= Get Vnf Vdur Names ${vnf_id} - Log List ${vdur_list} - ${vdurs}= Get Length ${vdur_list} - Run Keyword Unless ${vdurs} == ${initial_vdur_count} + 1 Fail msg=There is no new VDU records in the VNF after Scale Out - - -Perform Manual Vdu Scale In - [Tags] manual_scaling - - Variable Should Exist ${ns_id} msg=Network service instance is not available - ${ns_op_id}= Execute Manual VNF Scale ${ns_name} ${vnf_member_index} ${scaling_group} SCALE_IN - - -Check Vdus After Scaling In - [Documentation] Check whether there is one less VDU after scaling or not. - [Tags] manual_scaling - - Variable Should Exist ${ns_id} msg=Network service instance is not available - @{vdur_list}= Get Vnf Vdur Names ${vnf_id} - Log List ${vdur_list} - ${vdurs}= Get Length ${vdur_list} - Run Keyword Unless ${vdurs} == ${initial_vdur_count} Fail msg=There is the same number of VDU records in the VNF after Scale In - - -Delete NS Instance - [Tags] manual_scaling cleanup - - Delete NS ${ns_name} - - -Delete NS Descriptor - [Tags] manual_scaling cleanup - - Delete NSD ${nsd_name} - - -Delete VNF Descriptor - [Tags] manual_scaling cleanup - - Delete VNFD ${vnfd_name} - - -*** Keywords *** -Test Cleanup - [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance - - Run Keyword If Test Failed Delete NS ${ns_name} - - Run Keyword If Test Failed Delete NSD ${nsd_name} - - Run Keyword If Test Failed Delete VNFD ${vnfd_name} - diff --git a/robot-systest/testsuite/basic_network_slicing.robot b/robot-systest/testsuite/basic_network_slicing.robot deleted file mode 100644 index d28c6775..00000000 --- a/robot-systest/testsuite/basic_network_slicing.robot +++ /dev/null @@ -1,184 +0,0 @@ -# Copyright 2020 Atos -# -# 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. - -*** Settings *** -Library OperatingSystem -Library String -Library Collections -Library Process -Library SSHLibrary -Library yaml - -Resource %{ROBOT_DEVOPS_FOLDER}/lib/vnfd_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/nsd_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/nst_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/nsi_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/ns_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/connectivity_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/ssh_lib.robot - -Variables %{ROBOT_DEVOPS_FOLDER}/resources/basic_network_slicing_data.py - -Suite Teardown Run Keyword And Ignore Error Test Cleanup - - -*** Variables *** - -${ns_id} ${EMPTY} -${username} osm -${password} osm4u -${vnf_member_index} 1 -${vnf_ip_addr} ${EMPTY} -${nst_config} {netslice-vld: [ {name: slice_vld_mgmt, vim-network-name: %{VIM_MGMT_NET}} ] } - - -*** Test Cases *** - -Create Slice VNF Descriptors - [Documentation] Onboards all the VNFDs required for the test: vnfd1_pkg and vnfd2_pkg (in the variables file) - - [Tags] basic_network_slicing SLICING-01 - - Create VNFD '%{PACKAGES_FOLDER}/${vnfd1_pkg}' - Create VNFD '%{PACKAGES_FOLDER}/${vnfd2_pkg}' - - -Create Slice NS Descriptors - [Documentation] Onboards all the NSDs required for the test: nsd1_pkg and nsd2_pkg (in the variables file) - - [Tags] basic_network_slicing SLICING-01 - - Create NSD '%{PACKAGES_FOLDER}/${nsd1_pkg}' - Create NSD '%{PACKAGES_FOLDER}/${nsd2_pkg}' - -Create Slice Template - [Documentation] Onboards the Network Slice Template: nst (in the variables file) - - [Tags] basic_network_slicing SLICING-01 - - Create NST '%{PACKAGES_FOLDER}/${nst}' - -Network Slice Instance Test - [Documentation] Instantiates the NST recently onboarded and sets the instantiation id as a suite variable (nsi_id) - - [Tags] basic_network_slicing SLICING-01 - - ${id}= Create Network Slice ${nst_name} %{VIM_TARGET} ${slice_name} ${nst_config} ${publickey} - Set Suite Variable ${nsi_id} ${id} - - -Get Middle Vnf Management Ip - [Documentation] Obtains the management IP of the slice middle VNF (name in the reources file) and sets the ip as a suite variable (mgmt_vnf_ip) - - [Tags] basic_network_slicing SLICING-01 - - ${middle_ns_id}= Run and Return RC and Output osm ns-list | grep ${middle_ns_name} | awk '{print $4}' 2>&1 - ${vnf_ip} Get Vnf Management Ip Address ${middle_ns_id}[1] ${vnf_member_index} - Set Suite Variable ${mgmt_vnf_ip} ${vnf_ip} - - -Get Slice Vnf Ip Addresses - [Documentation] Obtains the list of IPs addresses in the slice and sets the list as a suite variable (slice_vnfs_ips) - - [Tags] basic_network_slicing SLICING-01 - - # Get all the ns_id in the slice except the middle one to avoid self ping - @{slice_ns_list} Get Slice Ns List Except One ${slice_name} ${middle_ns_name} - log many @{slice_ns_list} - @{temp_list}= Create List - # For each ns_id in the list, get all the vnf_id and their IP addresses - FOR ${ns_id} IN @{slice_ns_list} - log ${ns_id} - @{vnf_id_list} Get Ns Vnf List ${ns_id} - # For each vnf_id in the list, get all its IP addresses - @{ns_ip_list} Get Ns Ip List @{vnf_id_list} - @{temp_list}= Combine Lists ${temp_list} ${ns_ip_list} - END - Log List ${temp_list} - Set Suite Variable ${slice_vnfs_ips} ${temp_list} - - -Test Middle Ns Ping - [Documentation] Pings the slice middle vnf (mgmt_vnf_ip) - - [Tags] basic_network_slicing SLICING-01 - Sleep 60s Waiting for the network to be up - # Ping to the middle VNF - Test Connectivity ${mgmt_vnf_ip} - - -Test Middle Vnf SSH Access - [Documentation] SSH access to the slice middle vnf (mgmt_vnf_ip) with the credentials provided in the variables file - - [Tags] basic_network_slicing SLICING-01 - Sleep 30s Waiting ssh daemon to be up - Test SSH Connection ${mgmt_vnf_ip} ${username} ${password} ${privatekey} - - -Test Slice Connectivity - [Documentation] SSH access to the slice middle vnf (mgmt_vnf_ip) with the credentials provided in the variables file - ... and pings all the IP addresses in the list (slice_vnfs_ips) - - [Tags] basic_network_slicing SLICING-01 - Ping Many ${mgmt_vnf_ip} ${username} ${password} ${privatekey} @{slice_vnfs_ips} - - -Stop Slice Instance - [Documentation] Stops the slice instance (slice_name) - - [Tags] basic_network_slicing SLICING-01 cleanup - - Delete NSI ${slice_name} - - -Delete Slice Template - [Documentation] Deletes the NST (nst_name) from OSM - - [Tags] basic_network_slicing SLICING-01 cleanup - - Delete NST ${nst_name} - - -Delete NS Descriptors - [Documentation] Deletes all the NSDs created for the test: nsd1_name, nsd2_name - - [Tags] basic_network_slicing SLICING-01 cleanup - - Delete NSD ${nsd1_name} - Delete NSD ${nsd2_name} - - -Delete VNF Descriptors - [Documentation] Deletes all the VNFDs created for the test: vnfd1_name, vnfd2_name - - [Tags] basic_network_slicing SLICING-01 cleanup - - Delete VNFD ${vnfd1_name} - Delete VNFD ${vnfd2_name} - - -*** Keywords *** -Test Cleanup - [Documentation] Test Suit Cleanup: Deleting Descriptors, instance and template - - Run Keyword If Test Failed Delete NST ${nst_name} - - Run Keyword If Test Failed Delete NSD ${nsd1_name} - Run Keyword If Test Failed Delete NSD ${nsd2_name} - - Run Keyword If Test Failed Delete VNFD ${vnfd1_name} - Run Keyword If Test Failed Delete VNFD ${vnfd2_name} - - - diff --git a/robot-systest/testsuite/hackfest_basic.robot b/robot-systest/testsuite/hackfest_basic.robot deleted file mode 100644 index 7e5d3317..00000000 --- a/robot-systest/testsuite/hackfest_basic.robot +++ /dev/null @@ -1,103 +0,0 @@ -# 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. - -*** Settings *** -Library OperatingSystem -Library String -Library Collections -Library Process -Library SSHLibrary - -Resource %{ROBOT_DEVOPS_FOLDER}/lib/vnfd_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/nsd_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/ns_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/connectivity_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/ssh_lib.robot - -Variables %{ROBOT_DEVOPS_FOLDER}/resources/hackfest_basic_ns_data.py - -Suite Teardown Run Keyword And Ignore Error Test Cleanup - - -*** Variables *** -${ns_id} ${EMPTY} -${username} ubuntu -${password} ${EMPTY} -${vnf_member_index} 1 -${vnf_ip_addr} ${EMPTY} -${ns_config} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] } -# ${ns_config} ${EMPTY} - -*** Test Cases *** -Create Hackfest Basic VNF Descriptor - [Tags] hackfest_basic - - Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' - - -Create Hackfest Basic NS Descriptor - [Tags] hackfest_basic - - Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' - -Network Service Instance Test - [Tags] hackfest_basic - - ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} - Set Suite Variable ${ns_id} ${id} - - -Get Vnf Ip Address - [Tags] hackfest_basic - - ${ip_addr} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index} - log ${ip_addr} - Set Suite Variable ${vnf_ip_addr} ${ip_addr} - -Test Ping - [Tags] hackfest_basic - Test Connectivity ${vnf_ip_addr} - -Test SSH Access - [Tags] hackfest_basic - Sleep 30s Waiting ssh daemon to be up - Test SSH Connection ${vnf_ip_addr} ${username} ${password} ${privatekey} - -Delete NS Instance Test - [Tags] hackfest_basic cleanup - - Delete NS ${ns_name} - - -Delete NS Descriptor Test - [Tags] hackfest_basic cleanup - - Delete NSD ${nsd_name} - - -Delete VNF Descriptor Test - [Tags] hackfest_basic cleanup - - Delete VNFD ${vnfd_name} - - -*** Keywords *** -Test Cleanup - [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim - - Run Keyword If Test Failed Delete NS ${ns_name} - - Run Keyword If Test Failed Delete NSD ${nsd_name} - - Run Keyword If Test Failed Delete VNFD ${vnfd_name} - - diff --git a/robot-systest/testsuite/hackfest_cloudinit.robot b/robot-systest/testsuite/hackfest_cloudinit.robot deleted file mode 100644 index fff6975a..00000000 --- a/robot-systest/testsuite/hackfest_cloudinit.robot +++ /dev/null @@ -1,110 +0,0 @@ -# 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. - -*** Settings *** -Library OperatingSystem -Library String -Library Collections -Library Process -Library SSHLibrary - -Resource %{ROBOT_DEVOPS_FOLDER}/lib/vnfd_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/nsd_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/ns_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/connectivity_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/ssh_lib.robot - -Variables %{ROBOT_DEVOPS_FOLDER}/resources/hackfest_cloudinit_ns_data.py - -Suite Teardown Run Keyword And Ignore Error Test Cleanup - - -*** Variables *** -${ns_id} ${EMPTY} -${username} ubuntu -${password} ${EMPTY} -${vnf_member_index} 1 -${vnf_ip_addr} ${EMPTY} -${ns_config} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] } -# ${ns_config} ${EMPTY} - -*** Test Cases *** -Create Hackfest Cloudinit VNF Descriptor - [Tags] hackfest_cloudinit - - Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' - - -Create Hackfest Cloudinit NS Descriptor - [Tags] hackfest_cloudinit - - Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' - - -Network Service Instance Test - [Tags] hackfest_cloudinit - - ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} - Set Suite Variable ${ns_id} ${id} - - -Get Vnf Ip Address - [Tags] hackfest_cloudinit - - ${ip_addr} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index} - log ${ip_addr} - Set Suite Variable ${vnf_ip_addr} ${ip_addr} - - -Test SSH Access - [Tags] hackfest_cloudinit - - Sleep 30s Waiting ssh daemon to be up - Test SSH Connection ${vnf_ip_addr} ${username} ${password} ${privatekey} - - -Check Remote File Injected Via Cloud-init - [Tags] hackfest_cloudinit - - ${stdout}= Execute Remote Command Check Rc Return Output ${vnf_ip_addr} ${username} ${password} ${privatekey} sudo cat /root/helloworld.txt - log ${stdout} - - -Delete NS Instance Test - [Tags] hackfest_cloudinit cleanup - - Delete NS ${ns_name} - - -Delete NS Descriptor Test - [Tags] hackfest_cloudinit cleanup - - Delete NSD ${nsd_name} - - -Delete VNF Descriptor Test - [Tags] hackfest_cloudinit cleanup - - Delete VNFD ${vnfd_name} - - -*** Keywords *** -Test Cleanup - [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim - - Run Keyword If Test Failed Delete NS ${ns_name} - - Run Keyword If Test Failed Delete NSD ${nsd_name} - - Run Keyword If Test Failed Delete VNFD ${vnfd_name} - - diff --git a/robot-systest/testsuite/hackfest_multivdu.robot b/robot-systest/testsuite/hackfest_multivdu.robot deleted file mode 100644 index 7c5abeda..00000000 --- a/robot-systest/testsuite/hackfest_multivdu.robot +++ /dev/null @@ -1,105 +0,0 @@ -# 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. - -*** Settings *** -Library OperatingSystem -Library String -Library Collections -Library Process -Library SSHLibrary - -Resource %{ROBOT_DEVOPS_FOLDER}/lib/vnfd_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/nsd_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/ns_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/connectivity_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/ssh_lib.robot - -Variables %{ROBOT_DEVOPS_FOLDER}/resources/hackfest_multivdu_ns_data.py - -Suite Teardown Run Keyword And Ignore Error Test Cleanup - - -*** Variables *** -${ns_id} ${EMPTY} -${username} osm -${password} osm4u -${vnf_member_index} 1 -${vnf_ip_addr} ${EMPTY} -${ns_config} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] } -${wait_guard_for_vm_boot} 50s -# ${ns_config} ${EMPTY} - -*** Test Cases *** -Create Hackfest multivdu VNF Descriptor - [Tags] hackfest_multivdu - - Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' - - -Create Hackfest Multivdu NS Descriptor - [Tags] hackfest_multivdu - - Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' - -Network Service Instance Test - [Tags] hackfest_multivdu - - ${status} ${message}= Run Keyword And Ignore Error Variable Should Exist ${publickey} - Run Keyword If "${status}" == "FAIL" Set Global Variable ${publickey} ${EMPTY} - ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} - Set Suite Variable ${ns_id} ${id} - Sleep ${wait_guard_for_vm_boot} Waiting for VM's daemons to be up and running - -Get Vnf Ip Address - [Tags] hackfest_multivdu - - ${ip_addr} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index} - log ${ip_addr} - Set Suite Variable ${vnf_ip_addr} ${ip_addr} - -Test Ping - [Tags] hackfest_multivdu - Test Connectivity ${vnf_ip_addr} - -Test SSH Access - [Tags] hackfest_multivdu - ${status} ${message}= Run Keyword And Ignore Error Variable Should Exist ${privatekey} - Run Keyword If "${status}" == "FAIL" Set Global Variable ${privatekey} ${EMPTY} - Test SSH Connection ${vnf_ip_addr} ${username} ${password} ${privatekey} - -Delete NS Instance Test - [Tags] hackfest_multivdu cleanup - - Delete NS ${ns_name} - - -Delete NS Descriptor Test - [Tags] hackfest_multivdu cleanup - - Delete NSD ${nsd_name} - - -Delete VNF Descriptor Test - [Tags] hackfest_multivdu cleanup - - Delete VNFD ${vnfd_name} - - -*** Keywords *** -Test Cleanup - [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim - - Run Keyword If Test Failed Delete NS ${ns_name} - - Run Keyword If Test Failed Delete NSD ${nsd_name} - - Run Keyword If Test Failed Delete VNFD ${vnfd_name} diff --git a/robot-systest/testsuite/k8s_02-k8scluster_creation.robot b/robot-systest/testsuite/k8s_02-k8scluster_creation.robot deleted file mode 100644 index 5f3dfadb..00000000 --- a/robot-systest/testsuite/k8s_02-k8scluster_creation.robot +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright 2020 Canonical Ltd. -# -# 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. - -*** Settings *** -Library OperatingSystem -Library String -Library Collections -Library Process - -Resource %{ROBOT_DEVOPS_FOLDER}/lib/k8scluster_lib.robot - -Variables %{ROBOT_DEVOPS_FOLDER}/resources/k8s_02-k8scluster_creation_data.py - -Suite Teardown Run Keyword And Ignore Error Test Cleanup - -*** Test Cases *** -Add K8s Cluster To OSM - [Tags] k8scluster - Create K8s Cluster %{K8S_CREDENTIALS} ${k8scluster_version} %{VIM_TARGET} %{VIM_MGMT_NET} ${k8scluster_name} - -List K8s Clusters - [Tags] k8scluster - ${stdout}= Get K8s Cluster - Log To Console \n${stdout} - -Remove K8s Cluster from OSM - [Tags] k8scluster - Delete K8s Cluster ${k8scluster_name} - -*** Keywords *** -Test Cleanup - [Documentation] Test Suit Cleanup: Deleting K8s Cluster - Run Keyword If Test Failed Delete K8s Cluster ${k8scluster_name} diff --git a/robot-systest/testsuite/k8s_03-simple_k8s.robot b/robot-systest/testsuite/k8s_03-simple_k8s.robot deleted file mode 100644 index 6fd6551d..00000000 --- a/robot-systest/testsuite/k8s_03-simple_k8s.robot +++ /dev/null @@ -1,78 +0,0 @@ -# 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. - -*** Settings *** -Library OperatingSystem -Library String -Library Collections -Library Process - -Resource %{ROBOT_DEVOPS_FOLDER}/lib/vnfd_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/nsd_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/ns_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/connectivity_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/ssh_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/k8scluster_lib.robot - -Variables %{ROBOT_DEVOPS_FOLDER}/resources/k8s_03-simple_k8s_data.py - -Suite Teardown Run Keyword And Ignore Error Test Cleanup - - -*** Variables *** -${ns_id} ${EMPTY} -${ns_config} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] } -${publickey} ${EMPTY} - -*** Test Cases *** -Create Simple K8s VNF Descriptor - [Tags] simple_k8s - Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' - -Create Simple K8s Descriptor - [Tags] simple_k8s - Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' - -Add K8s Cluster To OSM - [Tags] k8scluster - Create K8s Cluster %{K8S_CREDENTIALS} ${k8scluster_version} %{VIM_TARGET} %{VIM_MGMT_NET} ${k8scluster_name} - -Network Service K8s Instance Test - [Tags] simple_k8s - ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} - Set Suite Variable ${ns_id} ${id} - -Delete NS K8s Instance Test - [Tags] simple_k8s cleanup - Delete NS ${ns_name} - -Remove K8s Cluster from OSM - [Tags] k8scluster - Delete K8s Cluster ${k8scluster_name} - -Delete NS Descriptor Test - [Tags] simple_k8s cleanup - Delete NSD ${nsd_name} - -Delete VNF Descriptor Test - [Tags] simple_k8s cleanup - Delete VNFD ${vnfd_name} - - -*** Keywords *** -Test Cleanup - [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim - Run Keyword If Test Failed Delete NS ${ns_name} - Run Keyword If Test Failed Delete NSD ${nsd_name} - Run Keyword If Test Failed Delete VNFD ${vnfd_name} - - diff --git a/robot-systest/testsuite/shared_network_slicing.robot b/robot-systest/testsuite/shared_network_slicing.robot deleted file mode 100644 index 43a7332d..00000000 --- a/robot-systest/testsuite/shared_network_slicing.robot +++ /dev/null @@ -1,244 +0,0 @@ -# Copyright 2020 Atos -# -# 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. - -*** Settings *** -Library OperatingSystem -Library String -Library Collections -Library Process -Library SSHLibrary - -Resource %{ROBOT_DEVOPS_FOLDER}/lib/vnfd_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/nsd_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/nst_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/nsi_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/ns_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/connectivity_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/ssh_lib.robot - -Variables %{ROBOT_DEVOPS_FOLDER}/resources/shared_network_slicing_data.py - -Suite Teardown Run Keyword And Ignore Error Test Cleanup - - -*** Variables *** - -${ns_id} ${EMPTY} -${username} osm -${password} osm4u -${vnf_member_index} 1 -${vnf_ip_addr} ${EMPTY} -${nst_config} {netslice-vld: [ {name: slice_vld_mgmt, vim-network-name: %{VIM_MGMT_NET}} ] } - - -*** Test Cases *** - -Create Slice VNF Descriptors - [Documentation] Onboards all the VNFDs required for the test: vnfd1_pkg and vnfd2_pkg (in the variables file) - - [Tags] shared_network_slicing SLICING-02 - - Create VNFD '%{PACKAGES_FOLDER}/${vnfd1_pkg}' - Create VNFD '%{PACKAGES_FOLDER}/${vnfd2_pkg}' - - -Create Slice NS Descriptors - [Documentation] Onboards all the NSDs required for the test: nsd1_pkg and nsd2_pkg (in the variables file) - - [Tags] shared_network_slicing SLICING-02 - - Create NSD '%{PACKAGES_FOLDER}/${nsd1_pkg}' - Create NSD '%{PACKAGES_FOLDER}/${nsd2_pkg}' - -Create Slice Templates - [Documentation] Onboards the Network Slice Templates: nst, nst2 (in the variables file) - - [Tags] shared_network_slicing SLICING-02 - - Create NST '%{PACKAGES_FOLDER}/${nst}' - Create NST '%{PACKAGES_FOLDER}/${nst2}' - -Network Slice One Instance Test - [Documentation] Instantiates the first NST recently onboarded (nst_name) and sets the instantiation id as a suite variable (nsi_id) - ... The slice contains 3 NS (1 shared) - - [Tags] shared_network_slicing SLICING-02 - - ${id}= Create Network Slice ${nst_name} %{VIM_TARGET} ${slice_name} ${nst_config} ${publickey} - Set Suite Variable ${nsi_id} ${id} - - -Network Slice Two Instance Test - [Documentation] Instantiates the second NST recently onboarded (nst2_name) and sets the instantiation id as a suite variable (nsi2_id) - ... The slice contains 2 NS (1 shared) - - [Tags] shared_network_slicing SLICING-02 - - ${id}= Create Network Slice ${nst2_name} %{VIM_TARGET} ${slice2_name} ${nst_config} ${publickey} - Set Suite Variable ${nsi2_id} ${id} - - -First Network Slice Ns Count - [Documentation] Counts the NS in both slice instances and shoul be equal to 4 - - [Tags] shared_network_slicing SLICING-02 - - ${slice1_count}= Get Slice Ns Count ${slice_name} - ${slice2_count}= Get Slice Ns Count ${slice2_name} - ${together}= Evaluate ${slice1_count} + ${slice2_count} - Should Be Equal As Integers ${together} 4 - - -Get Middle Vnf Management Ip - [Documentation] Obtains the management IP of the shared NS main (only) VNF and sets it as a suite variable (mgmt_vnf_ip) - - [Tags] shared_network_slicing SLICING-02 - - ${middle_ns_id}= Run and Return RC and Output osm ns-list | grep ${middle_ns_name} | awk '{print $4}' 2>&1 - ${vnf_ip} Get Vnf Management Ip Address ${middle_ns_id}[1] ${vnf_member_index} - Set Suite Variable ${mgmt_vnf_ip} ${vnf_ip} - - -Get First Slice Vnf IPs - [Documentation] Obtains the list of IPs addresses in the first slice and sets the list as a suite variable (slice1_vnfs_ips) - - [Tags] shared_network_slicing SLICING-02 - - # Get all the ns_id in the slice except the middle one - @{ip_list} Get Slice Vnf Ip Addresses ${slice_name} - Set Suite Variable ${slice1_vnfs_ips} ${ip_list} - - -Test Middle Ns Ping - [Documentation] Pings the slice middle vnf (mgmt_vnf_ip) - - [Tags] shared_network_slicing SLICING-02 - - Sleep 60s Waiting for the network to be up - # Ping to the middle VNF - Test Connectivity ${mgmt_vnf_ip} - - -Test Middle Vnf SSH Access - [Documentation] SSH access to the slice middle vnf (mgmt_vnf_ip) with the credentials provided in the variables file - - [Tags] shared_network_slicing SLICING-02 - - Sleep 30s Waiting ssh daemon to be up - Test SSH Connection ${mgmt_vnf_ip} ${username} ${password} ${privatekey} - - -Test First Slice Connectivity - [Documentation] SSH access to the slice middle vnf (mgmt_vnf_ip) with the credentials provided in the variables file - ... and pings all the IP addresses in the list (slice1_vnfs_ips) - - [Tags] shared_network_slicing SLICING-02 - - Ping Many ${mgmt_vnf_ip} ${username} ${password} ${privatekey} @{slice1_vnfs_ips} - - -Stop Slice One Instance - [Documentation] Stops the slice instance (slice_name) - - [Tags] shared_network_slicing SLICING-02 cleanup - - Delete NSI ${slice_name} - - -Second Network Slice Ns Count - [Documentation] Counts the NS in both slice instances and should be equal to 2 - - [Tags] shared_network_slicing SLICING-02 - - ${slice1_count}= Get Slice Ns Count ${slice_name} - ${slice2_count}= Get Slice Ns Count ${slice2_name} - ${together}= Evaluate ${slice1_count} + ${slice2_count} - Should Be Equal As Integers ${together} 2 - -Get Second Slice Vnf IPs - [Documentation] Obtains the list of IPs addresses in the second slice and sets the list as a suite variable (slice2_vnfs_ips) - - [Tags] shared_network_slicing SLICING-02 - - # Get all the ns_id in the slice - @{ip_list} Get Slice Vnf Ip Addresses ${slice2_name} - Set Suite Variable ${slice2_vnfs_ips} ${ip_list} - - -Test Second Slice Connectivity - [Documentation] SSH access to the slice middle vnf (mgmt_vnf_ip) with the credentials provided in the variables file - ... and pings all the IP addresses in the list (slice2_vnfs_ips) - - [Tags] shared_network_slicing SLICING-02 - - Ping Many ${mgmt_vnf_ip} ${username} ${password} ${privatekey} @{slice2_vnfs_ips} - - -Stop Slice Two Instance - [Documentation] Stops the slice instance (slice2_name) - - [Tags] shared_network_slicing SLICING-02 cleanup - - Delete NSI ${slice2_name} - - -Delete Slice One Template - [Documentation] Deletes the NST (nst_name) from OSM - - [Tags] shared_network_slicing SLICING-02 cleanup - - Delete NST ${nst_name} - - -Delete Slice Two Template - [Documentation] Deletes the NST (nst2_name) from OSM - - [Tags] shared_network_slicing SLICING-02 cleanup - - Delete NST ${nst2_name} - - -Delete NS Descriptors - [Documentation] Deletes all the NSDs created for the test: nsd1_name, nsd2_name - - [Tags] shared_network_slicing SLICING-02 cleanup - - Delete NSD ${nsd1_name} - Delete NSD ${nsd2_name} - - -Delete VNF Descriptors - [Documentation] Deletes all the VNFDs created for the test: vnfd1_name, vnfd2_name - - [Tags] shared_network_slicing SLICING-02 cleanup - - Delete VNFD ${vnfd1_name} - Delete VNFD ${vnfd2_name} - - -*** Keywords *** -Test Cleanup - [Documentation] Test Suit Cleanup: Deleting Descriptors, instance and templates - - Run Keyword If Test Failed Delete NST ${nst_name} - Run Keyword If Test Failed Delete NST ${nst2_name} - - Run Keyword If Test Failed Delete NSD ${nsd1_name} - Run Keyword If Test Failed Delete NSD ${nsd2_name} - - Run Keyword If Test Failed Delete VNFD ${vnfd1_name} - Run Keyword If Test Failed Delete VNFD ${vnfd2_name} - - - diff --git a/tools/cleanupBuilds.py b/tools/cleanupBuilds.py index 2c44ae23..4e6dfbcb 100755 --- a/tools/cleanupBuilds.py +++ b/tools/cleanupBuilds.py @@ -25,12 +25,12 @@ from dateutil.tz import tzutc from datetime import datetime import time -arg_parser=argparse.ArgumentParser(description="Tool to retrieve the latest build from the artifactory server") +arg_parser = argparse.ArgumentParser(description="Tool to retrieve the latest build from the artifactory server") arg_parser.add_argument('branch') -arg_parser.add_argument('--project',default='osm-stage_3') -arg_parser.add_argument('--url',default='http://osm1.etsi.org:8081/') -arg_parser.add_argument('--keep',default=5) -arg_parser.add_argument('--password',default='') +arg_parser.add_argument('--project', default='osm-stage_3') +arg_parser.add_argument('--url', default='https://artifactory-osm.etsi.org/') +arg_parser.add_argument('--keep', default=5) +arg_parser.add_argument('--password', default='') args = arg_parser.parse_args() url = args.url + 'artifactory/api/build/' + args.project + " :: " + args.branch @@ -42,7 +42,7 @@ if 'buildsNumbers' not in jsonData: exit(1) # first entry is the latest build -buildlist = sorted(jsonData['buildsNumbers'], key=lambda x: int(x['uri'][1:]),reverse=True) +buildlist = sorted(jsonData['buildsNumbers'], key=lambda x: int(x['uri'][1:]), reverse=True) print("total builds is {}".format(len(buildlist))) pprint.pprint(buildlist) @@ -50,15 +50,17 @@ if len(buildlist) < args.keep: print("nothing to cleanup") exit(0) + def convert_to_ms(datetime): - #get the millisecond from the date/time - ms=datetime.split('.')[1].split('+')[0] - parser_out=parser.parse(datetime) - timeval=parser_out - tuple=int(time.mktime(timeval.timetuple())) - return (tuple*1000+int(ms)-(time.timezone*1000)) + # get the millisecond from the date/time + ms = datetime.split('.')[1].split('+')[0] + parser_out = parser.parse(datetime) + timeval = parser_out + tuple = int(time.mktime(timeval.timetuple())) + return (tuple * 1000 + int(ms) - (time.timezone * 1000)) + -def buildPost(dateInMS,buildNumber): +def buildPost(dateInMS, buildNumber): build = {} data = {} build['buildName'] = args.project + " :: " + args.branch @@ -68,14 +70,15 @@ def buildPost(dateInMS,buildNumber): data['buildsCoordinates'] = list() data['buildsCoordinates'].append(build) return data - + + delete_url = args.url + 'artifactory/ui/builds/buildsDelete' headers = {'Content-Type': 'application/json'} for entry in buildlist[int(args.keep):]: - ms = convert_to_ms(entry['started']) - buildNumber = entry['uri'].split('/')[1] - print("deleting build {} ms {}".format(args.project + " :: " + args.branch + '/' + buildNumber,ms)) - postData = buildPost(ms,entry['uri'].split('/')[1]) + ms = convert_to_ms(entry['started']) + buildNumber = entry['uri'].split('/')[1] + print("deleting build {} ms {}".format(args.project + " :: " + args.branch + '/' + buildNumber, ms)) + postData = buildPost(ms, entry['uri'].split('/')[1]) - requests.post(delete_url,data=json.dumps(postData),headers=headers,auth=('admin',args.password)) + requests.post(delete_url, data=json.dumps(postData), headers=headers, auth=('admin', args.password)) diff --git a/tools/cleanupRepo.py b/tools/cleanupRepo.py index d25b5c55..997d6bf1 100755 --- a/tools/cleanupRepo.py +++ b/tools/cleanupRepo.py @@ -28,7 +28,7 @@ import time arg_parser=argparse.ArgumentParser(description="Tool to retrieve the latest build from the artifactory server") arg_parser.add_argument('--branch',default=None) arg_parser.add_argument('repo') -arg_parser.add_argument('--url',default='http://osm1.etsi.org:8081/') +arg_parser.add_argument('--url',default='https://artifactory-osm.etsi.org/) arg_parser.add_argument('--keep',default=5) arg_parser.add_argument('--password',default='') arg_parser.add_argument('--debug',default=None) diff --git a/tools/getbuild.py b/tools/getbuild.py index de4dcdff..7a54ba05 100755 --- a/tools/getbuild.py +++ b/tools/getbuild.py @@ -20,10 +20,10 @@ import json import pprint import argparse -parser=argparse.ArgumentParser(description="Tool to retrieve the latest build from the artifactory server") +parser = argparse.ArgumentParser(description="Tool to retrieve the latest build from the artifactory server") parser.add_argument('branch') -parser.add_argument('--project',default='osm-stage_3') -parser.add_argument('--url',default='http://osm1.etsi.org:8081/artifactory/api/build/') +parser.add_argument('--project', default='osm-stage_3') +parser.add_argument('--url', default='https://artifactory-osm.etsi.org/artifactory/api/build/') args = parser.parse_args() url = args.url + args.project + " :: " + args.branch @@ -36,6 +36,6 @@ if 'buildsNumbers' not in jsonData: exit(1) # first entry is the latest build -build = sorted(jsonData['buildsNumbers'], key=lambda x: int(x['uri'][1:]),reverse=True)[0] +build = sorted(jsonData['buildsNumbers'], key=lambda x: int(x['uri'][1:]), reverse=True)[0] -print "{} :: {}{}".format(args.project,args.branch,build['uri']) +print "{} :: {}{}".format(args.project, args.branch, build['uri']) diff --git a/tools/license_scan.sh b/tools/license_scan.sh index 5af31dff..dfcda7e4 100755 --- a/tools/license_scan.sh +++ b/tools/license_scan.sh @@ -29,7 +29,7 @@ dpkg -l curl &>/dev/null ||sudo apt-get install -y curl apache=0 nolicense=0 other=0 -exception_list="':(exclude)*.pdf' ':(exclude)*.png' ':(exclude)*.jpeg' ':(exclude)*.jpg' ':(exclude)*.gif' ':(exclude)*.json' ':(exclude)*.ico'" +exception_list="':(exclude)*.pdf' ':(exclude)*.png' ':(exclude)*.jpeg' ':(exclude)*.jpg' ':(exclude)*.gif' ':(exclude)*.json' ':(exclude)*.ico' ':(exclude)*.svg' ':(exclude)*.tiff'" git fetch RE="FATAL: your file did not get passed through" diff --git a/tools/newbranch.sh b/tools/newbranch.sh new file mode 100755 index 00000000..6428c980 --- /dev/null +++ b/tools/newbranch.sh @@ -0,0 +1,59 @@ +#!/bin/bash +# +# Copyright 2020 ETSI +# +# 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. +# + +if [ $# -ne 3 ]; then + echo "Usage $0 " + echo "Example: $0 all v8.0 beierlm" + echo "Example: $0 devops v8.0 beierlm" + exit 1 +fi + +BRANCH="$2" +USER="$3" +tag_message="Start of $BRANCH" + +modules="common devops IM LCM LW-UI MON N2VC NBI openvim osmclient RO vim-emu POL NG-UI PLA tests" +list="" +for i in $modules; do + if [ "$1" == "$i" -o "$1" == "all" ]; then + list="$1" + break + fi +done + +[ "$1" == "all" ] && list=$modules + +if [ -z "$list" ]; then + echo "Repo must be one of these: $modules all" + exit 1 +fi + +for i in $list; do + echo "=============================================" + echo $i + if [ ! -d $i ]; then + git clone ssh://$USER@osm.etsi.org:29418/osm/$i + fi + git -C $i checkout master + git -C $i pull --rebase + git -C $i tag -a "release-$BRANCH-start" -m"$tag_message" + git -C $i push origin $TAG --follow-tags + git -C $i checkout -b "$BRANCH" + git -C $i push -u origin "$BRANCH" +done + +exit 0