From: Juha Kosonen Date: Mon, 20 Jan 2020 10:14:09 +0000 (+0000) Subject: Merge "Add PTL to INFO.yaml" X-Git-Tag: 3.0.0~15 X-Git-Url: https://gerrit.akraino.org/r/gitweb?p=validation.git;a=commitdiff_plain;h=6956370b1e022b7fb4da42107542fc49964bfc72;hp=d5cf129a4d3d42bb8b036bac94dce020c39dfbe2 Merge "Add PTL to INFO.yaml" --- diff --git a/.gitignore b/.gitignore index 2e45b8c..92f8161 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +bluval/__pycache__ docker/manifest-tool *.sw? diff --git a/bluval/Dockerfile b/bluval/Dockerfile index 08753f7..7125c73 100644 --- a/bluval/Dockerfile +++ b/bluval/Dockerfile @@ -15,16 +15,22 @@ ############################################################################## # ref: https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#use-multi-stage-builds -FROM ubuntu:18.04 as build +FROM python:3.6-alpine3.10 -RUN apt-get update && apt-get -y install git python3-pip python3.6 +RUN apk --no-cache add --update \ + gcc \ + git \ + docker-cli \ + libc6-compat \ + libc-dev \ + libffi \ + libffi-dev \ + make \ + openssl-dev # Build binaries RUN git clone https://gerrit.akraino.org/r/validation /opt/akraino/validation RUN pip3 install -r /opt/akraino/validation/bluval/requirements.txt -ENV LC_ALL=C.UTF-8 -ENV LANG=C.UTF-8 - WORKDIR /opt/akraino/validation -ENTRYPOINT ["python3", "bluval/blucon.py"] \ No newline at end of file +ENTRYPOINT ["python3", "-B", "bluval/blucon.py"] diff --git a/bluval/blucon.py b/bluval/blucon.py index cea16de..0d5d7ca 100644 --- a/bluval/blucon.py +++ b/bluval/blucon.py @@ -61,7 +61,7 @@ def invoke_docker(bluprint, layer): " akraino/validation:{0}-latest" " /bin/sh -c" " 'cd /opt/akraino/validation " - "&& python bluval/bluval.py -l {0} {1} {2}'" + "&& python -B bluval/bluval.py -l {0} {1} {2}'" .format(layer, ("-o" if _OPTIONAL_ALSO else ""), bluprint)) args = [cmd] diff --git a/bluval/blucon.sh b/bluval/blucon.sh index 3cc1e5e..afe54db 100755 --- a/bluval/blucon.sh +++ b/bluval/blucon.sh @@ -52,7 +52,6 @@ set -x docker run --rm \ -v /var/run/docker.sock:/var/run/docker.sock \ - -v /usr/bin/docker:/usr/bin/docker \ -v $AKRAINO_HOME/results:/opt/akraino/results \ -v $AKRAINO_HOME/validation:/opt/akraino/validation \ akraino/validation:blucon-$image_tag "$@" diff --git a/bluval/bluval-kni.yaml b/bluval/bluval-kni.yaml new file mode 100644 index 0000000..75f941b --- /dev/null +++ b/bluval/bluval-kni.yaml @@ -0,0 +1,39 @@ +--- +############################################################################## +# Copyright (c) 2019 Red Hat. # +# # +# 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. # +############################################################################## +blueprint: + name: kni + layers: + - hardware + - os + - k8s + # Any hardware some basic tests + hardware: + - + name: bios_version + skip: "False" + what: bios_version + os: + - + name: ltp + what: ltp + - + name: cyclictest + what: cyclictest + k8s: + - + name: conformance + what: conformance diff --git a/bluval/bluval-unicycle.yaml b/bluval/bluval-unicycle.yaml new file mode 100644 index 0000000..02e6b31 --- /dev/null +++ b/bluval/bluval-unicycle.yaml @@ -0,0 +1,52 @@ +--- +############################################################################## +# Copyright (c) 2019 AT&T Intellectual Property. # +# # +# 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. # +############################################################################## +blueprint: + name: unicycle + layers: + - hardware + - os + - docker + - k8s + # Any hardware some basic tests + hardware: &hardware_unicycle + - + name: hp_baremetal + what: hp_baremetal + os: &os_unicycle + - + name: ltp + what: ltp + - + name: cyclictest + what: cyclictest + optional: "True" + docker: &docker_unicycle + - + name: docker_bench + what: docker_bench + k8s: &k8s_unicycle + - + name: conformance + what: conformance + - + name: etcd_ha + what: etcd_ha + optional: "True" + openstack: &openstack_unicycle + - + name: tempest + what: tempest diff --git a/bluval/volumes.yaml b/bluval/volumes.yaml index da0a839..6c48e65 100644 --- a/bluval/volumes.yaml +++ b/bluval/volumes.yaml @@ -42,6 +42,10 @@ volumes: results_dir: local: '' target: '/opt/akraino/results' + # location on where to store openrc file + openrc: + local: '' + target: '/root/openrc' # parameters that will be passed to the container at each layer layers: @@ -64,6 +68,8 @@ layers: k8s_networking: - ssh_key_dir - kube_config_dir + openstack: + - openrc sds: sdn: vim: diff --git a/docker/logging/Dockerfile b/docker/services/Dockerfile similarity index 100% rename from docker/logging/Dockerfile rename to docker/services/Dockerfile diff --git a/docker/logging/Makefile b/docker/services/Makefile similarity index 100% rename from docker/logging/Makefile rename to docker/services/Makefile diff --git a/docker/logging/pip-requirements.txt b/docker/services/pip-requirements.txt similarity index 100% rename from docker/logging/pip-requirements.txt rename to docker/services/pip-requirements.txt diff --git a/tests/docker/docker_bench/docker_bench.resource b/tests/docker/docker_bench/docker_bench.resource index 674087f..8a93e3d 100644 --- a/tests/docker/docker_bench/docker_bench.resource +++ b/tests/docker/docker_bench/docker_bench.resource @@ -18,6 +18,7 @@ *** Settings *** Library BuiltIn +Library Collections Library OperatingSystem Library Process Library SSHLibrary @@ -43,12 +44,18 @@ Upload Test Software To Nodes Copy Test Software To All Nodes Run Test Software On Nodes - :FOR ${node} IN @{nodes} - \ Execute Command ssh ${SSH_OPTS} ${node} "cd ${NODEDIR}; sudo ./docker-bench-security.sh -b -l bench.log" - \ Execute Command scp ${SSH_OPTS} ${node}:${NODEDIR}/bench.log ${DESTDIR}/docker-bench-${node}.log - \ Execute Command scp ${SSH_OPTS} ${node}:${NODEDIR}/bench.log.json ${DESTDIR}/docker-bench-${node}.json - \ SSHLibrary.Get File ${DESTDIR}/docker-bench-${node}.log ${REPORTDIR}/ - \ SSHLibrary.Get File ${DESTDIR}/docker-bench-${node}.json ${REPORTDIR}/ + FOR ${node} IN @{nodes} + Start Command ssh ${SSH_OPTS} ${node} "cd ${NODEDIR}; sudo ./docker-bench-security.sh -b -l bench.log" + END + @{tmp}= Copy List ${nodes} + Reverse List ${tmp} + FOR ${node} IN @{tmp} + Read Command Output return_stdout=False + Execute Command scp ${SSH_OPTS} ${node}:${NODEDIR}/bench.log ${DESTDIR}/docker-bench-${node}.log + Execute Command scp ${SSH_OPTS} ${node}:${NODEDIR}/bench.log.json ${DESTDIR}/docker-bench-${node}.json + SSHLibrary.Get File ${DESTDIR}/docker-bench-${node}.log ${REPORTDIR}/ + SSHLibrary.Get File ${DESTDIR}/docker-bench-${node}.json ${REPORTDIR}/ + END Get Node Addresses ${stdout}= Execute Command @@ -57,11 +64,13 @@ Get Node Addresses Set Test Variable @{nodes} Copy Test Software To All Nodes - :FOR ${node} IN @{nodes} - \ Execute Command ssh ${SSH_OPTS} ${node} "mkdir -p ${NODEDIR}" - \ Execute Command scp ${SSH_OPTS} -rp ${DESTDIR}/. ${node}:${NODEDIR} + FOR ${node} IN @{nodes} + Execute Command ssh ${SSH_OPTS} ${node} "mkdir -p ${NODEDIR}" + Execute Command scp ${SSH_OPTS} -rp ${DESTDIR}/. ${node}:${NODEDIR} + END Remove Test Software From Nodes - :FOR ${node} IN @{nodes} - \ Execute Command ssh ${SSH_OPTS} ${node} "rm -rf ${NODEDIR}" + FOR ${node} IN @{nodes} + Execute Command ssh ${SSH_OPTS} ${node} "rm -rf ${NODEDIR}" + END Execute Command rm -rf ${DESTDIR} diff --git a/tests/hardware/redfish/redfish.resource b/tests/hardware/redfish/redfish.resource index 433f9db..87516ed 100644 --- a/tests/hardware/redfish/redfish.resource +++ b/tests/hardware/redfish/redfish.resource @@ -17,6 +17,7 @@ *** Settings *** +Library Collections Library JSONLibrary Library OperatingSystem Library Process @@ -29,31 +30,64 @@ ${REDFISHDIR} ${TEMPDIR}/Redfish *** Keywords *** Update Config File - ${conf}= Load JSON From File ${REDFISHDIR}/framework_conf.json + [Arguments] ${config_file} + ${conf}= Load JSON From File ${config_file} ${conf}= Update Value To Json ${conf} $.password ${BMC_PASSWORD} ${conf}= Convert JSON To String ${conf} - Create File ${REDFISHDIR}/framework_conf.json ${conf} + Create File ${config_file} ${conf} Run Suite Against Target Node [Arguments] ${ip} - ${result}= Run Process python test_framework.py - ... --directory ${REDFISHDIR} + Start Process python test_framework.py + ... --directory ${REDFISHDIR}/${ip} ... --rhost ${ip} ... --user ${BMC_USER} ... --interpreter python ... --secure Always - ... cwd=${REDFISHDIR} - Copy Files ${REDFISHDIR}/reports/output-*/results*.json ${REPORTDIR}/${ip} - Copy Files ${REDFISHDIR}/output-*/*.html ${REPORTDIR}/${ip} - Should Be Equal As Integers ${result.rc} 0 - Should Not Contain ${result.stderr} FAILED${\n} (Failures= + ... cwd=${REDFISHDIR}/${ip} + ... alias=${ip} + Process Should Be Running -Run Usecase Checkers Suite +Install Usecase Checkers Test Suite + @{BMC_IP}= Remove Duplicates ${BMC_IP} + Set Test Variable @{BMC_IP} + FOR ${ip} IN @{BMC_IP} + Copy Directory /opt/akraino/Redfish-Test-Framework + ... ${REDFISHDIR}/${ip} + Copy Directory /opt/akraino/Redfish-Usecase-Checkers + ... ${REDFISHDIR}/${ip}/Redfish-Usecase-Checkers + Create Directory ${REDFISHDIR}/${ip}/reports + Update Config File ${REDFISHDIR}/${ip}/framework_conf.json + END + +Uninstall Test Suite + Remove Directory ${REDFISHDIR} recursive=True + +Start Suite + @{ips}= Create List + Set Test Variable @{ips} FOR ${ip} IN @{BMC_IP} - Copy Directory /opt/akraino/Redfish-Test-Framework ${REDFISHDIR} - Copy Directory /opt/akraino/Redfish-Usecase-Checkers ${REDFISHDIR}/Redfish-Usecase-Checkers - Create Directory ${REDFISHDIR}/reports - Update Config File Run Suite Against Target Node ${ip} - Remove Directory ${REDFISHDIR} recursive=True + Append To List ${ips} ${ip} + END + +Suite Finished + @{tmp}= Copy List ${ips} + FOR ${ip} IN @{tmp} + ${result}= Wait For Process ${ip} timeout=1ms + Continue For Loop If '${result}' == '${NONE}' + Remove Values From List ${ips} ${ip} + Copy Files ${REDFISHDIR}/${ip}/reports/output-*/results*.json ${REPORTDIR}/${ip} + Copy Files ${REDFISHDIR}/${ip}/output-*/*.html ${REPORTDIR}/${ip} + END + Should Be Empty ${ips} + +Wait Until Suite Finishes + Wait Until Keyword Succeeds 45m 15s Suite Finished + +Check Suite Results + FOR ${ip} IN @{BMC_IP} + ${result}= Get Process Result ${ip} + Should Be Equal As Integers ${result.rc} 0 + Should Not Contain ${result.stderr} FAILED${\n} (Failures= END diff --git a/tests/hardware/redfish/redfish.robot b/tests/hardware/redfish/redfish.robot index 0ff6f31..8ab0064 100644 --- a/tests/hardware/redfish/redfish.robot +++ b/tests/hardware/redfish/redfish.robot @@ -20,8 +20,14 @@ Documentation Redfish Test Framework is a tool and a model for organizing ... and running a set of Redfish interoperability test Resource redfish.resource +Test Teardown Run Keywords +... Terminate All Processes +... Uninstall Test Suite *** Test Cases *** Validate Common Use Cases - Run Usecase Checkers Suite + [Setup] Install Usecase Checkers Test Suite + Start Suite + Wait Until Suite Finishes + Check Suite Results