Merge "Add validaton tests for KNI"
authorCristina Pauna <cristina.pauna@enea.com>
Tue, 7 Jan 2020 08:54:06 +0000 (08:54 +0000)
committerGerrit Code Review <gerrit@akraino.org>
Tue, 7 Jan 2020 08:54:06 +0000 (08:54 +0000)
37 files changed:
.coafile
.gitignore
bluval/Dockerfile [moved from tests/os/ltp/variables.resource with 64% similarity]
bluval/blucon.py
bluval/blucon.sh [new file with mode: 0755]
bluval/bluval-rec.yaml
bluval/bluval-unicycle.yaml [new file with mode: 0644]
bluval/bluval.py
bluval/requirements.txt
bluval/volumes.yaml
docker/README.rst
docker/k8s/Dockerfile
docker/k8s/pip-requirements.txt
docker/kube-conformance/Makefile
docker/os/Dockerfile
docker/ui/Dockerfile
docker/ui/deploy.sh
tests/hardware/bios_version/bios_version_dell.robot
tests/hardware/redfish/redfish.resource
tests/hardware/redfish/redfish.robot
tests/k8s/conformance/conformance.robot
tests/k8s/etcd_ha/etcd_ha.resource
tests/os/cyclictest/cyclictest.robot
tests/os/ltp/ltp.robot
tests/os/lynis/lynis.robot [new file with mode: 0644]
tests/variables.yaml
ui/CHANGELOG.md
ui/docker-files/index.jsp [moved from docker/ui/root_index.jsp with 100% similarity]
ui/docker-files/server.xml [moved from docker/ui/server.xml with 100% similarity]
ui/pom.xml
ui/src/main/java/org/akraino/validation/ui/client/nexus/NexusExecutorClient.java
ui/src/main/java/org/akraino/validation/ui/service/IntegratedResultService.java
ui/src/main/resources/portal.properties
ui/src/main/webapp/.eslintrc
ui/src/main/webapp/app/BluvalUI/CommittedSubmissions/CommittedSubmissions.html
ui/src/main/webapp/app/BluvalUI/ValidationResults/ValidationResults.Services.js
ui/ui-docker-assembly.xml [new file with mode: 0644]

index 50e636c..fd4a0cc 100644 (file)
--- a/.coafile
+++ b/.coafile
@@ -1,6 +1,7 @@
 [all]
 ignore = .tox/**,
     .py35/**,
+    .py36/**,
     .git/**,
     .gitignore,
     .gitreview,
index 2e45b8c..92f8161 100644 (file)
@@ -1,3 +1,4 @@
+bluval/__pycache__
 docker/manifest-tool
 *.sw?
 
similarity index 64%
rename from tests/os/ltp/variables.resource
rename to bluval/Dockerfile
index 6f46166..f01deaa 100644 (file)
@@ -1,6 +1,5 @@
 ##############################################################################
-# Copyright (c) 2019 AT&T Intellectual Property.                             #
-# Copyright (c) 2019 Nokia.                                                  #
+# Copyright (c) 2019 AT&T, ENEA Nokia and others                             #
 #                                                                            #
 # Licensed under the Apache License, Version 2.0 (the "License");            #
 # you maynot use this file except in compliance with the License.            #
 # limitations under the License.                                             #
 ##############################################################################
 
-*** Variables ***
-# Manual test: robot  ltp.robot
+# ref: https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#use-multi-stage-builds
+FROM python:3.6-alpine3.9
 
-${HOST}        aknode109    # cluster's master node address
-${ROOTUSER}    root         # Required root user to log in to the host
-${ROOTPSWD}    root_passwd  # Required root password to log in to the host
+RUN apk --no-cache add --update \
+        gcc \
+        git \
+        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
+
+WORKDIR /opt/akraino/validation
+ENTRYPOINT  ["python3", "-B", "bluval/blucon.py"]
index 7fc8002..0d5d7ca 100644 (file)
@@ -57,11 +57,11 @@ def invoke_docker(bluprint, layer):
     """Start docker container for given layer
     """
     volume_list = get_volumes('common') + get_volumes(layer)
-    cmd = ("docker run" + volume_list + _SUBNET +
+    cmd = ("docker run --rm" + volume_list + _SUBNET +
            " 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
new file mode 100755 (executable)
index 0000000..3cc1e5e
--- /dev/null
@@ -0,0 +1,58 @@
+#!/bin/bash
+
+##############################################################################
+# Copyright (c) 2019 AT&T, ENEA Nokia and others                             #
+#                                                                            #
+# Licensed under the Apache License, Version 2.0 (the "License");            #
+# you maynot 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 [ -z "$AKRAINO_HOME" ]
+then
+    echo "AKRAINO_HOME not available. Setting..."
+    this_file="$(readlink -f $0)"
+    bluval_dir="$(dirname $this_file)"
+    validation_dir="$(dirname $bluval_dir)"
+    parent_dir="$(dirname $validation_dir)"
+    export AKRAINO_HOME="$parent_dir"
+fi
+echo "AKRAINO_HOME=$AKRAINO_HOME"
+
+if [ "$#" -eq 0 ]
+then
+    echo 'Usage: sh blucon.sh [OPTIONS] BLUEPRINT
+
+    Invokes blucon.py and passes parameters as it is.
+    You can pass all the parameters blucon.py accepts,
+    and as of now here is the list
+
+    Options:
+        -l, --layer TEXT
+        -n, --network TEXT
+        -o, --optional_also
+        --help               Show this message and exit.'
+
+    exit 1
+fi
+
+echo "Building docker image"
+image_tag=$( (git branch || echo "* local") | grep "^\*" | awk '{print $2}')
+docker build -t akraino/validation:blucon-$image_tag $AKRAINO_HOME/validation/bluval
+
+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 "$@"
index b611dd6..8bc3203 100644 (file)
@@ -35,6 +35,11 @@ blueprint:
             name: cyclictest
             what: cyclictest
             optional: "True"
+        -
+            name: lynis
+            what: lynis
+            optional: "True"
+
     docker: &docker_base
         -
             name: docker_bench
diff --git a/bluval/bluval-unicycle.yaml b/bluval/bluval-unicycle.yaml
new file mode 100644 (file)
index 0000000..02e6b31
--- /dev/null
@@ -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
index feefa5e..c79c830 100644 (file)
@@ -59,11 +59,12 @@ def run_testcase(testcase):
     variables_file = mypath.parents[1].joinpath("tests/variables.yaml")
     variables_dict = yaml.safe_load(variables_file.open())
     variables_dict['log_path'] = str(results_path)
-    variables_file.write_text(str(variables_dict))
+    variables_updated_file = mypath.parents[1].joinpath("tests/variables_updated.yaml")
+    variables_updated_file.write_text(str(variables_dict))
 
     # run the test
-    args = ["robot", "-V", str(variables_file), "-d",
-            str(results_path), str(test_path)]
+    args = ["robot", "-V", str(variables_updated_file), "-d", str(results_path),
+            "-b", "debug.log", str(test_path)]
 
     print('Executing testcase {}'.format(name))
     print('show_stopper {}'.format(show_stopper))
index bdd48f9..7784bcd 100644 (file)
@@ -1,2 +1,7 @@
 pyyaml
 click
+robotframework
+robotframework-httplibrary
+robotframework-jsonlibrary
+robotframework-requests
+robotframework-sshlibrary
index 0e062ea..6c48e65 100644 (file)
@@ -23,7 +23,7 @@
 
 volumes:
     # location of the ssh key to access the cluster
-    ssh_key_file:
+    ssh_key_dir:
         local: ''
         target: '/root/.ssh'
     # location of the k8s access files (config file, certificates, keys)
@@ -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:
@@ -51,17 +55,21 @@ layers:
         - blueprint_dir
         - results_dir
     hardware:
-        - ssh_key_file
+        - ssh_key_dir
     os:
-        - ssh_key_file
+        - ssh_key_dir
     networking:
-        - ssh_key_file
+        - ssh_key_dir
+    docker:
+        - ssh_key_dir
     k8s:
-        - ssh_key_file
+        - ssh_key_dir
         - kube_config_dir
     k8s_networking:
-        - ssh_key_File
+        - ssh_key_dir
         - kube_config_dir
+    openstack:
+        - openrc
     sds:
     sdn:
     vim:
index 6e0cc7d..0fff3ed 100644 (file)
@@ -231,7 +231,7 @@ Example:
 
 .. code-block:: console
 
-    docker run -ti akraino/validation:kube-conformance-v1.15
+    docker run -ti akraino/validation:kube-conformance-v1.16
 
 By default, the container will run the `run_e2e.sh` script. If you want to
 enter the container, add */bin/sh* at the end of the command above
index 925ac3d..43c6d80 100644 (file)
@@ -19,9 +19,9 @@ FROM golang:alpine3.9 as build
 
 # Sonobuoy supports 3 Kubernetes minor versions: the current release and 2
 # minor versions before.
-ARG SB_TAG=v0.15.1
+ARG SB_TAG=v0.16.1
 # Determine the latest stable git tag at build time based on stable major version
-ARG K8S_VER=1.15
+ARG K8S_VER=1.16
 
 # Install dependencies
 COPY pip-requirements.txt /wheels/requirements/pip-requirements.txt
index 6139a45..18b264c 100644 (file)
@@ -1,4 +1,5 @@
 robotframework
 robotframework-httplibrary
+robotframework-jsonlibrary
 robotframework-requests
 robotframework-sshlibrary
index 8e76e14..ee7b40f 100644 (file)
@@ -15,7 +15,7 @@
 ##############################################################################
 
 export WORK_DIR?=$(TAG_PRE)
-export KUBE_VERSION=1.15
+export KUBE_VERSION=1.16
 export TAG_VER?=v$(KUBE_VERSION)
 
 .PHONY: .build
index 291267b..58bed23 100644 (file)
@@ -49,15 +49,20 @@ RUN make autotools && \
     make -j $(getconf _NPROCESSORS_ONLN) 2>&1 | tee ../build-log.txt && \
     make install 2>&1 | tee ../install-log.txt
 RUN tar czvf /opt/akraino/ltp.tar.gz /opt/ltp
+WORKDIR /root/src
+RUN git clone https://github.com/CISOfy/lynis && tar czvf /opt/akraino/lynis-remote.tar.gz ./lynis
 
 # Copy binaries into the final container and install robot framework
 FROM ubuntu:18.04
 COPY --from=build /wheels /wheels
 COPY --from=build /opt/akraino/validation /opt/akraino/validation
 COPY --from=build /opt/akraino/ltp.tar.gz /opt/akraino/ltp.tar.gz
+COPY --from=build /opt/akraino/lynis-remote.tar.gz /opt/akraino/lynis-remote.tar.gz
+
 
 RUN apt-get update && apt-get -y install \
-    python3-pip && \
+    python3-pip python3.6 && \
+    cd /usr/bin && ln -s python3 python && \
     pip3 install -r /wheels/requirements/pip-requirements.txt \
                  -f /wheels && \
     rm -rf /wheels && \
@@ -65,5 +70,7 @@ RUN apt-get update && apt-get -y install \
     rm -rf /var/cache/apt/* && \
     rm -rf /var/lib/apt/lists/*
 
-# Install blueval dependencies
+# Install bluval dependencies
 RUN pip3 install -r /opt/akraino/validation/bluval/requirements.txt
+ENV LC_ALL=C.UTF-8
+ENV LANG=C.UTF-8
index c7a6a5e..0ef94f6 100644 (file)
@@ -20,3 +20,5 @@ RUN cd /opt/akraino/validation/ui && mvn clean package
 
 FROM tomcat:8.5.37
 COPY  --from=build /opt/akraino/validation/ui/target/bluvalui.war /usr/local/tomcat/webapps
+COPY  --from=build /opt/akraino/validation/ui/docker-files/index.jsp /usr/local/tomcat/webapps/ROOT
+COPY  --from=build /opt/akraino/validation/ui/docker-files/server.xml /usr/local/tomcat/conf
index 6a0d58f..8c9a231 100755 (executable)
@@ -76,8 +76,8 @@ echo "Note: If there is a password already stored in database, the supplied UI_A
 IMAGE="$REGISTRY"/"$NAME":"$TAG_PRE"-"$TAG_VER"
 if [[ $USE_NETWORK_HOST = "true" ]]
   then
-    docker run --detach --name $CONTAINER_NAME --network="host" -v "$(pwd)/server.xml:/usr/local/tomcat/conf/server.xml" -v "$CERTDIR/bluval.key:/usr/local/tomcat/bluval.key" -v "$CERTDIR/bluval.crt:/usr/local/tomcat/bluval.crt" -v "$(pwd)/root_index.jsp:/usr/local/tomcat/webapps/ROOT/index.jsp" -e DB_IP_PORT="$DB_IP_PORT" -e MYSQL_USER="$MYSQL_USER" -e MYSQL_PASSWORD="$MYSQL_PASSWORD" -e JENKINS_URL="$JENKINS_URL" -e JENKINS_USERNAME="$JENKINS_USERNAME" -e JENKINS_USER_PASSWORD="$JENKINS_USER_PASSWORD" -e JENKINS_JOB_NAME="$JENKINS_JOB_NAME" -e NEXUS_PROXY="$NEXUS_PROXY" -e JENKINS_PROXY="$JENKINS_PROXY" -e ENCRYPTION_KEY="$ENCRYPTION_KEY" -e UI_ADMIN_PASSWORD="$UI_ADMIN_PASSWORD" -e TRUST_ALL="$TRUST_ALL" $IMAGE
+    docker run --detach --name $CONTAINER_NAME --network="host" -v "$CERTDIR/bluval.key:/usr/local/tomcat/bluval.key" -v "$CERTDIR/bluval.crt:/usr/local/tomcat/bluval.crt" -e DB_IP_PORT="$DB_IP_PORT" -e MYSQL_USER="$MYSQL_USER" -e MYSQL_PASSWORD="$MYSQL_PASSWORD" -e JENKINS_URL="$JENKINS_URL" -e JENKINS_USERNAME="$JENKINS_USERNAME" -e JENKINS_USER_PASSWORD="$JENKINS_USER_PASSWORD" -e JENKINS_JOB_NAME="$JENKINS_JOB_NAME" -e NEXUS_PROXY="$NEXUS_PROXY" -e JENKINS_PROXY="$JENKINS_PROXY" -e ENCRYPTION_KEY="$ENCRYPTION_KEY" -e UI_ADMIN_PASSWORD="$UI_ADMIN_PASSWORD" -e TRUST_ALL="$TRUST_ALL" $IMAGE
   else
-    docker run --detach --name $CONTAINER_NAME -v "$(pwd)/server.xml:/usr/local/tomcat/conf/server.xml" -v "$CERTDIR/bluval.key:/usr/local/tomcat/bluval.key" -v "$CERTDIR/bluval.crt:/usr/local/tomcat/bluval.crt" -v "$(pwd)/root_index.jsp:/usr/local/tomcat/webapps/ROOT/index.jsp" -e DB_IP_PORT="$DB_IP_PORT" -e MYSQL_USER="$MYSQL_USER" -e MYSQL_PASSWORD="$MYSQL_PASSWORD" -e JENKINS_URL="$JENKINS_URL" -e JENKINS_USERNAME="$JENKINS_USERNAME" -e JENKINS_USER_PASSWORD="$JENKINS_USER_PASSWORD" -e JENKINS_JOB_NAME="$JENKINS_JOB_NAME" -e NEXUS_PROXY="$NEXUS_PROXY" -e JENKINS_PROXY="$JENKINS_PROXY" -e ENCRYPTION_KEY="$ENCRYPTION_KEY" -e UI_ADMIN_PASSWORD="$UI_ADMIN_PASSWORD" -e TRUST_ALL="$TRUST_ALL" $IMAGE
+    docker run --detach --name $CONTAINER_NAME -v "$CERTDIR/bluval.key:/usr/local/tomcat/bluval.key" -v "$CERTDIR/bluval.crt:/usr/local/tomcat/bluval.crt" -e DB_IP_PORT="$DB_IP_PORT" -e MYSQL_USER="$MYSQL_USER" -e MYSQL_PASSWORD="$MYSQL_PASSWORD" -e JENKINS_URL="$JENKINS_URL" -e JENKINS_USERNAME="$JENKINS_USERNAME" -e JENKINS_USER_PASSWORD="$JENKINS_USER_PASSWORD" -e JENKINS_JOB_NAME="$JENKINS_JOB_NAME" -e NEXUS_PROXY="$NEXUS_PROXY" -e JENKINS_PROXY="$JENKINS_PROXY" -e ENCRYPTION_KEY="$ENCRYPTION_KEY" -e UI_ADMIN_PASSWORD="$UI_ADMIN_PASSWORD" -e TRUST_ALL="$TRUST_ALL" $IMAGE
 fi
 sleep 10
index 166182c..682e596 100644 (file)
@@ -28,6 +28,7 @@ Suite Teardown    Close All Connections
 #${USERNAME}       localadmin
 #${SYSINFO}        PowerEdge R740xd
 #${BIOS_REVISION}   1.3
+${SSH_KEYFILE}     /root/.ssh/id_rsa
 ${LOG}             ${LOG_PATH}${/}${SUITE_NAME.replace(' ','_')}.log
 
 *** Test Cases ***
@@ -60,5 +61,5 @@ Verify Block Devices
 *** Keywords ***
 Open Connection And Log In
   Open Connection       ${HOST}
-  Login With Public Key    ${USERNAME}  /root/.ssh/${USERNAME}_id_rsa
+  Login With Public Key    ${USERNAME}  ${SSH_KEYFILE}
 
index 433f9db..87516ed 100644 (file)
@@ -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
index 0ff6f31..8ab0064 100644 (file)
 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
index 2c9d3ee..edd2271 100644 (file)
@@ -24,8 +24,10 @@ Library           Collections
 Library           String
 Library           SSHLibrary
 Library           Process
+Library           JSONLibrary
 Test Setup        Run Keywords
 ...               Check that k8s cluster is reachable
+...               Define Images
 ...               Onboard Images
 ...               Create Manifest File
 Test Teardown     Run Keywords
@@ -36,9 +38,9 @@ Test Teardown     Run Keywords
 ${LOG}            ${LOG_PATH}${/}${SUITE_NAME.replace(' ','_')}.log
 
 &{SONOBUOY}         path=gcr.io/heptio-images
-...                 name=sonobuoy:v0.15.1
+...                 name=sonobuoy:v0.16.1
 &{E2E}              path=akraino
-...                 name=validation:kube-conformance-v1.15
+...                 name=Actual value set dynamically
 &{SYSTEMD_LOGS}     path=akraino
 ...                 name=validation:sonobuoy-plugin-systemd-logs-latest
 &{SONOBUOY_IMGS}    sonobuoy=&{SONOBUOY}
@@ -50,7 +52,16 @@ ${DNS_DOMAIN_TESTS}  SEPARATOR=
 ...                 DNS should provide /etc/hosts entries for the cluster|
 ...                 DNS should provide DNS for services|
 ...                 DNS should provide DNS for ExternalName services|
-...                 DNS should provide DNS for the cluster
+...                 DNS should provide DNS for the cluster|
+...                 DNS should provide DNS for pods for Subdomain|
+...                 DNS should provide DNS for pods for Hostname
+
+# Images listed by Sonobuoy but not available for downloading
+@{SKIP_IMGS}        gcr.io/kubernetes-e2e-test-images/windows-nanoserver:v1
+...                 gcr.io/authenticated-image-pulling/windows-nanoserver:v1
+...                 gcr.io/authenticated-image-pulling/alpine:3.7
+...                 k8s.gcr.io/invalid-image:invalid-tag
+...                 invalid.com/invalid/alpine:3.1
 
 *** Test Cases ***
 Run Sonobuoy Conformance Test
@@ -58,10 +69,11 @@ Run Sonobuoy Conformance Test
         Run                     kubectl apply -f ${CURDIR}${/}sonobuoy.yaml
         Sleep                   20s
         ${rc}  ${output}=       Run And Return Rc And Output
-                                ...  kubectl describe pod/sonobuoy -n heptio-sonobuoy
+                                ...  kubectl describe pod/sonobuoy -n sonobuoy
         Append To File          ${LOG}  ${output}${\n}
 
         # Wait until the test finishes execution
+        Wait Until Keyword Succeeds    3x    20 sec    Check that sonobuoy is running
         Run                     while sonobuoy status | grep "Sonobuoy is still running"; do sleep 180; done
         Append To File          ${LOG}  "Sonobuoy has completed"${\n}
 
@@ -78,9 +90,13 @@ Check that k8s cluster is reachable
 
         # Make sure the pod is reachable with the local k8s client
         ${rc}  ${output}=       Run And Return Rc And Output
-                                ...  kubectl get pods --all-namespaces
+                                ...  kubectl version
         Append To File          ${LOG}  ${output}${\n}
-        Should Contain          ${output}      kube-system
+        Should Contain          ${output}      Server Version: version.Info
+
+Check that sonobuoy is running
+       ${output}=              Run    kubectl get pod sonobuoy --namespace sonobuoy
+       Should Contain          ${output}     Running
 
 Cleanup Sonobuoy
         ${rc}  ${output}=       Run And Return Rc And Output
@@ -121,10 +137,19 @@ Onboard Kubernetes e2e Test Images
         Should Be Equal As Integers  ${result.rc}  0
         @{images}=              Split String  ${result.stdout}
         FOR  ${img}  IN  @{images}
+            Continue For Loop If  $img in $SKIP_IMGS
             ${path}  ${name}  Split String From Right  ${img}  /  1
             Upload To Internal Registry  ${path}  ${name}
         END
 
+Define Images
+        ${result}=              Run Process  kubectl  version  -o  json
+        Should Be Equal As Integers  ${result.rc}  0
+        ${versions}=            Convert String To JSON  ${result.stdout}
+        ${major}=               Get Value From Json  ${versions}  $.serverVersion.major
+        ${minor}=               Get Value From Json  ${versions}  $.serverVersion.minor
+        Set To Dictionary       ${SONOBUOY_IMGS['e2e']}  name=validation:kube-conformance-v${major[0]}.${minor[0]}
+
 Onboard Images
         ${INT_REG}=             Get Variable Value  ${INTERNAL_REGISTRY}  ${EMPTY}
         Set Test Variable       ${INT_REG}
index 1486b9e..c3b7e42 100644 (file)
@@ -25,7 +25,7 @@ Library            OperatingSystem
 
 *** Variables ***
 ${ETCD_VERSION}         3
-${SSH_KEYFILE}          ${HOME}/.ssh/id_rsa
+${SSH_KEYFILE}          /root/.ssh/id_rsa
 
 *** Keywords ***
 Open Connection And Log In
index f7b6709..d272c77 100644 (file)
@@ -26,9 +26,7 @@ Suite Teardown    Close All Connections
 
 *** Variables ***
 ${LOG}             ${LOG_PATH}${/}${SUITE_NAME.replace(' ','_')}.log
-#${USERNAME}       mm747b
-#${HOME}           /home/${USERNAME}
-#${HOST}           aknode109
+${SSH_KEYFILE}     /root/.ssh/id_rsa
 
 
 *** Test Cases ***
@@ -41,5 +39,5 @@ Latency Test
 *** Keywords ***
 Open Connection And Log In
   Open Connection       ${HOST}
-  Login With Public Key    ${USERNAME}   ${HOME}/.ssh/id_rsa
+  Login With Public Key    ${USERNAME}   ${SSH_KEYFILE}
 
index 8418bc8..a9ed9ec 100644 (file)
@@ -21,38 +21,50 @@ Library           SSHLibrary
 Library           OperatingSystem
 Library           BuiltIn
 Library           Process
-Resource          variables.resource
-Suite Setup       Open Connection And Log In
-Suite Teardown    Close All Connections
+Suite Setup       Run Keywords
+...               Open Connection And Log In
+...               Install LTP
+Test Teardown     Download Logs
+Suite Teardown    Run Keywords
+...               Uninstall LTP
+...               Close All Connections
 
 *** Variables ***
-${LOG}            ${LOG_PATH}${/}${SUITE_NAME.replace(' ','_')}.log
-
+${FULL_SUITE}            ${SUITE_NAME.replace(' ','_')}
 
 *** Test Cases ***
-#Run whole ltp test suite
-#    [Documentation]         Wait ~5hrs to complete 2536 tests
-#    ${result}=              Run Process       ./runltp     shell=yes     cwd=/opt/ltp     stdout=${LOG}
-#    Append To File          ${LOG}  ${result}${\n}
-#    Sleep                   2s
-#    Should Contain          ${result.stdout}   failed   0
-
-#Run ltp syscalls test suite
-#    [Documentation]         Wait ~45m for syscalls to complete
-#    ${result}=              Run Process       ./runltp -f syscalls      shell=yes     cwd=/opt/ltp     stdout=${LOG}
-#    Append To File          ${LOG}  ${result}${\n}
-#    Sleep                   2s
-#    Should Contain          ${result.stdout}   failed   0
-
-Run ltp syscalls madvise
+# Plese maintain shortest job first order
+RunLTP syscalls madvise only
     [Documentation]         Wait ~1m for madvise01-10 to complete
-    ${result}=              Run Process       ./runltp -f syscalls -s madvise     shell=yes     cwd=/opt/ltp     stdout=${LOG}
-    Append To File          ${LOG}  ${result}${\n}
-    Sleep                   2s
-    Should Contain          ${result.stdout}   failed   0
+    ${log} =  Set Variable  ${OUTPUT DIR}${/}${FULL_SUITE}.${TEST NAME.replace(' ','_')}.log
+    ${result}=              Execute Command  yes | sudo /opt/ltp/runltp -f syscalls -s madvise
+    Append To File          ${log}  ${result}${\n}
+    Should Contain          ${result}    INFO: ltp-pan reported all tests PASS
+
+RunLTP syscalls only
+    [Documentation]         Wait ~45m for syscalls to complete
+    ${log} =  Set Variable  ${OUTPUT DIR}${/}${FULL_SUITE}.${TEST NAME.replace(' ','_')}.log
+    ${result}=              Execute Command  yes | sudo /opt/ltp/runltp -f syscalls
+    Append To File          ${log}  ${result}${\n}
+    Should Contain          ${result}    INFO: ltp-pan reported all tests PASS
 
 *** Keywords ***
 Open Connection And Log In
-  Open Connection       ${HOST}
-  Login                 ${ROOTUSER}     ${ROOTPSWD}
+    Open Connection        ${HOST}
+    Login With Public Key  ${USERNAME}  ${SSH_KEYFILE}
+
+Install LTP
+    Put File  /opt/akraino/ltp.tar.gz  /tmp/ltp.tar.gz
+    Execute Command  tar -xf /tmp/ltp.tar.gz -C /  sudo=true
+
+Uninstall LTP
+    Execute Command  rm -rf /opt/ltp  sudo=True
+    Execute Command  rm /tmp/ltp.tar.gz
 
+Download Logs
+    Execute Command  chmod -R a+r /opt/ltp/output  sudo=True
+    SSHLibrary.Get File  /opt/ltp/output/*  ${OUTPUT DIR}/output/
+    Execute Command  rm -rf /opt/ltp/output/*  sudo=True
+    Execute Command  chmod -R a+r /opt/ltp/results  sudo=True
+    SSHLibrary.Get File  /opt/ltp/results/*  ${OUTPUT DIR}/results/
+    Execute Command  rm -rf /opt/ltp/results/*  sudo=True
\ No newline at end of file
diff --git a/tests/os/lynis/lynis.robot b/tests/os/lynis/lynis.robot
new file mode 100644 (file)
index 0000000..8d0069a
--- /dev/null
@@ -0,0 +1,64 @@
+##############################################################################
+# Copyright (c) 2019 AT&T Intellectual Property.                             #
+# Copyright (c) 2019 Nokia.                                                  #
+#                                                                            #
+# Licensed under the Apache License, Version 2.0 (the "License");            #
+# you maynot 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     Validation, Auditing Hardening Compliance
+Library           SSHLibrary
+Library           OperatingSystem
+Library           BuiltIn
+Library           Process
+Suite Setup       Run Keywords
+...               Open Connection And Log In
+...               Install Lynis
+Test Teardown     Download Logs
+Suite Teardown    Run Keywords
+...               Uninstall Lynis
+...               Close All Connections
+
+*** Variables ***
+${FULL_SUITE}  ${SUITE_NAME.replace(' ','_')}
+
+*** Test Cases ***
+Run Lynis Audit System
+    [Documentation]  Run Lynis
+    ${log} =  Set Variable  ${OUTPUT DIR}${/}${FULL_SUITE}.${TEST NAME.replace(' ','_')}.log
+    ${stdout}    ${rc} =  Execute Command  cd lynis && sudo ./lynis audit system --quick  return_rc=True
+    Append To File  ${log}  ${stdout}${\n}
+    Should Be Equal As Integers  ${rc} 0
+
+
+*** Keywords ***
+Open Connection And Log In
+    Open Connection  ${HOST}
+    Login With Public Key  ${USERNAME}  ${SSH_KEYFILE}
+
+Install Lynis
+    [Documentation]  Install Lynis
+    Put File  /opt/akraino/lynis-remote.tar.gz
+    Execute Command  tar xzf lynis-remote.tar.gz && sudo chown -R 0:0 lynis
+
+Uninstall Lynis
+    [Documentation]  Uninstall Lynis
+    Execute Command  rm lynis-remote.tar.gz
+    Execute Command  rm -rf ~/lynis /var/log/lynis.log /var/log/lynis-report.dat  sudo=True
+
+Download Logs
+    [Documentation]  Downloading logs and removing them
+    SSHLibrary.Get File  /var/log/lynis.log  ${OUTPUT DIR}/lynis.log
+    Execute Command  rm /var/log/lynis.log  sudo=True
+    SSHLibrary.Get File  /var/log/lynis-report.dat  ${OUTPUT DIR}/lynis-report.dat
+    Execute Command  rm /var/log/lynis-report.dat  sudo=True
\ No newline at end of file
index 1da77ef..4a68a51 100644 (file)
 
 # This file provides variables required by robot testcases
 # This file can be passed to robot testcases as follows
-# $ robot -v varables.yaml <robot test case file>
+# $ robot -V variables.yaml <robot test case file>
 #
 # All keys are converted UPPERCASE before submitting to robot. YAML notation is
 # smallcase and Robot variables notation is UPPERCASE so industry is following
 # this.
+#
+# bluval.py takes this file and updates it to new file and passes to
+# robot framework
+#
+
 
 ### Input variables cluster's master host
-host: aknode109             # cluster's master host address
-username: mm747b            # user credentials
-home: /home/mm747b          # Public keys location
-ssh_keyfile: ~/.ssh/id_rsa  # Identity file for authentication
+host: 172.28.17.206             # cluster's master host address
+username: cloudadmin            # login name to connect to cluster
+ssh_keyfile: /root/.ssh/id_rsa  # Identity file for authentication
+
+### bluval.py adds/modifies following, before passing to robot.
+### while debugging from CLI user has to modify these
+# log_path: /opt/akraino/results/<layer>/<what>
 
 ### Input variables for bios_version_dell.robot
 sysinfo: PowerEdge R740xd
index bea59b6..6ea7dfc 100644 (file)
@@ -234,7 +234,7 @@ All notable changes to this project will be documented in this file.
 
 ### Removed
 
-## [0.4.4-SNAPSHOT] - 4 October 2019
+## [0.4.4-SNAPSHOT] - 4 October 2019 - Tagged as 2.0.0
 ### Added
 - The user can define whether the UI can trust all SSL certificates or not.
 - The mysql user name can be configured.
@@ -243,3 +243,19 @@ All notable changes to this project will be documented in this file.
 - New approach is used for interpreting shell script input variables. Now, all symbols are recognized.
 
 ### Removed
+
+## [0.4.5-SNAPSHOT] - 15 November 2019
+### Added
+
+### Changed
+- The files 'server.xml' and index.jsp are embedded inside the UI docker image during build stage
+
+### Removed
+
+## [0.4.6-SNAPSHOT] - 02 December 2019
+### Added
+
+### Changed
+- Validation results are ignored when there are no robot test results associated with them
+
+### Removed
index d69dbd2..1a77fc8 100644 (file)
@@ -14,7 +14,7 @@
 
     <groupId>org.akraino.validation</groupId>
     <artifactId>ui</artifactId>
-    <version>0.4.4-SNAPSHOT</version>
+    <version>0.4.6-SNAPSHOT</version>
     <name>Bluval UI Maven Webapp</name>
     <packaging>war</packaging>
 
                             <build>
                                 <from>tomcat:8.5.37</from>
                                 <assembly>
-                                    <descriptorRef>artifact</descriptorRef>
+                                    <descriptor>${project.basedir}/ui-docker-assembly.xml</descriptor>
                                 </assembly>
                                 <runCmds>
                                     <!-- must be all on one line; use CDATA
                                         to turn off the Eclipse formatter -->
-                                    <run><![CDATA[mv /maven/*.war /usr/local/tomcat/webapps]]></run>
+                                    <run><![CDATA[mv /maven/target/*.war /usr/local/tomcat/webapps; mv /maven/docker-files/index.jsp /usr/local/tomcat/webapps/ROOT; mv /maven/docker-files/server.xml /usr/local/tomcat/conf; rm -fr /maven]]></run>
                                 </runCmds>
                             </build>
                         </image>
                         <image>
                             <name>akraino/validation:dev-mysql-latest</name>
                             <build>
-                                <from>mysql:5.6</from>
+                                <from>mysql:5.6</from>ll
                                 <assembly>
                                     <descriptorRef>project</descriptorRef>
                                 </assembly>
index 263d7de..ffd27a8 100644 (file)
@@ -156,8 +156,8 @@ public final class NexusExecutorClient {
 
     public ValidationDbTestResult getResult(@Nonnull String name, @Nonnull String version, @Nonnull String siloText,
             @Nonnull String timestamp)
-                    throws ClientHandlerException, UniformInterfaceException, JsonParseException, JsonMappingException,
-                    IOException, KeyManagementException, NoSuchAlgorithmException, ParseException, NullPointerException {
+            throws ClientHandlerException, UniformInterfaceException, JsonParseException, JsonMappingException,
+            IOException, KeyManagementException, NoSuchAlgorithmException, ParseException, NullPointerException {
         String nexusUrl = this.baseurl + "/" + siloText + "/" + "bluval_results/" + name + "/" + version;
         LOGGER.info(EELFLoggerDelegate.applicationLogger, "Trying to get validation nexus test result");
         WebResource webResource = this.client.resource(nexusUrl + "/");
@@ -215,8 +215,8 @@ public final class NexusExecutorClient {
 
     public List<ValidationDbTestResult> getResults(@Nonnull String name, @Nonnull String version,
             @Nonnull String siloText, int noOfLastElements)
-                    throws ClientHandlerException, UniformInterfaceException, JsonParseException, JsonMappingException,
-                    IOException, KeyManagementException, NoSuchAlgorithmException, ParseException {
+            throws ClientHandlerException, UniformInterfaceException, JsonParseException, JsonMappingException,
+            IOException, KeyManagementException, NoSuchAlgorithmException, ParseException {
         String nexusUrl = this.baseurl + "/" + siloText + "/" + "bluval_results/" + name + "/" + version;
         LOGGER.info(EELFLoggerDelegate.applicationLogger, "Trying to get validation Nexus test results");
         WebResource webResource = this.client.resource(nexusUrl + "/");
@@ -254,7 +254,7 @@ public final class NexusExecutorClient {
                     vDbResult.setTimestamp(timestamp);
                     vDbResults.add(vDbResult);
                 }
-            } catch (IllegalArgumentException | HttpException | NullPointerException | NoSuchElementException ex) {
+            } catch (HttpException | RuntimeException ex) {
                 LOGGER.warn(EELFLoggerDelegate.auditLogger, "Exception occured while retrieving timestamp : "
                         + timestamp + " result." + UserUtils.getStackTrace(ex));
                 continue;
@@ -265,8 +265,8 @@ public final class NexusExecutorClient {
 
     public List<ValidationDbTestResult> getResults(@Nonnull String name, @Nonnull String version,
             @Nonnull String siloText, @Nonnull Date date)
-                    throws ClientHandlerException, UniformInterfaceException, JsonParseException, JsonMappingException,
-                    IOException, KeyManagementException, NoSuchAlgorithmException, ParseException, NullPointerException {
+            throws ClientHandlerException, UniformInterfaceException, JsonParseException, JsonMappingException,
+            IOException, KeyManagementException, NoSuchAlgorithmException, ParseException, NullPointerException {
         String nexusUrl = this.baseurl + "/" + siloText + "/" + "bluval_results/" + name + "/" + version;
         LOGGER.debug(EELFLoggerDelegate.applicationLogger, "Trying to get validation Nexus results based on date");
         WebResource webResource = this.client.resource(nexusUrl + "/");
@@ -287,7 +287,7 @@ public final class NexusExecutorClient {
                 timestamp = timestamp.substring(0, timestamp.length() - 1);
                 ValidationDbTestResult vDbResult = this.getResult(name, version, siloText, timestamp);
                 vDbResults.add(vDbResult);
-            } catch (IllegalArgumentException | HttpException | NullPointerException ex) {
+            } catch (HttpException | RuntimeException ex) {
                 LOGGER.warn(EELFLoggerDelegate.auditLogger,
                         "Exception occured while retrieving timestamp results. " + UserUtils.getStackTrace(ex));
                 continue;
@@ -298,8 +298,8 @@ public final class NexusExecutorClient {
 
     public ValidationDbTestResult getLastResultBasedOnOutcome(@Nonnull String name, @Nonnull String version,
             @Nonnull String siloText, List<String> layers, Boolean optional, boolean outcome)
-                    throws ClientHandlerException, UniformInterfaceException, JsonParseException, JsonMappingException,
-                    IOException, KeyManagementException, NoSuchAlgorithmException, ParseException, NullPointerException {
+            throws ClientHandlerException, UniformInterfaceException, JsonParseException, JsonMappingException,
+            IOException, KeyManagementException, NoSuchAlgorithmException, ParseException, NullPointerException {
         String nexusUrl = this.baseurl + "/" + siloText + "/" + "bluval_results/" + name + "/" + version;
         LOGGER.info(EELFLoggerDelegate.applicationLogger, "Trying to get last result based on outcome");
         WebResource webResource = this.client.resource(nexusUrl + "/");
@@ -351,7 +351,7 @@ public final class NexusExecutorClient {
                     }
                 }
                 return vDbResult;
-            } catch (IllegalArgumentException | HttpException | NullPointerException ex) {
+            } catch (HttpException | RuntimeException ex) {
                 LOGGER.warn(EELFLoggerDelegate.auditLogger,
                         "Error when trying to retrieve results. " + UserUtils.getStackTrace(ex));
                 continue;
@@ -362,8 +362,8 @@ public final class NexusExecutorClient {
 
     public ValidationDbTestResult getLastResultBasedOnOutcome(@Nonnull String name, @Nonnull String version,
             @Nonnull String siloText, Boolean allLayers, Boolean optional, boolean outcome)
-                    throws ClientHandlerException, UniformInterfaceException, JsonParseException, JsonMappingException,
-                    IOException, KeyManagementException, NoSuchAlgorithmException, ParseException, NullPointerException {
+            throws ClientHandlerException, UniformInterfaceException, JsonParseException, JsonMappingException,
+            IOException, KeyManagementException, NoSuchAlgorithmException, ParseException, NullPointerException {
         String nexusUrl = this.baseurl + "/" + siloText + "/" + "bluval_results/" + name + "/" + version;
         LOGGER.info(EELFLoggerDelegate.applicationLogger, "Trying to get last result based on outcome");
         WebResource webResource = this.client.resource(nexusUrl + "/");
@@ -409,7 +409,7 @@ public final class NexusExecutorClient {
                     continue;
                 }
                 return vDbResult;
-            } catch (IllegalArgumentException | HttpException | NullPointerException ex) {
+            } catch (HttpException | RuntimeException ex) {
                 LOGGER.warn(EELFLoggerDelegate.auditLogger,
                         "Error when trying to retrieve results. " + UserUtils.getStackTrace(ex));
                 continue;
@@ -420,8 +420,8 @@ public final class NexusExecutorClient {
 
     public List<WRobotNexusTestResult> getWRobotTestResults(@Nonnull String name, @Nonnull String version,
             @Nonnull String siloText, @Nonnull String timestamp)
-                    throws ClientHandlerException, UniformInterfaceException, JsonParseException, JsonMappingException,
-                    IOException, KeyManagementException, NoSuchAlgorithmException {
+            throws ClientHandlerException, UniformInterfaceException, JsonParseException, JsonMappingException,
+            IOException, KeyManagementException, NoSuchAlgorithmException {
         String nexusUrl = this.baseurl + "/" + siloText + "/" + "bluval_results/" + name + "/" + version + "/"
                 + timestamp + "/results";
         List<WRobotNexusTestResult> listOfwrappers = new ArrayList<WRobotNexusTestResult>();
@@ -444,6 +444,9 @@ public final class NexusExecutorClient {
                     continue;
                 }
                 List<RobotTestResult> robotTestResults = getRobotTestResults(nexusUrl + "/" + layer);
+                if (robotTestResults.size() < 1) {
+                    continue;
+                }
                 WRobotNexusTestResult wrapper = new WRobotNexusTestResult();
                 wrapper.setLayer(layer);
                 wrapper.setRobotNexusTestResults(robotTestResults);
@@ -473,24 +476,31 @@ public final class NexusExecutorClient {
         List<Element> elements = document.getElementsByTag("body").get(0).getElementsByTag("table").get(0)
                 .getElementsByTag("tbody").get(0).getElementsByTag("tr");
         for (int i = 2; i < elements.size(); i++) {
-            String testSuiteName = elements.get(i).getElementsByTag("td").get(0).getElementsByTag("a").get(0).text();
-            testSuiteName = testSuiteName.substring(0, testSuiteName.length() - 1);
-            webResource = this.client.resource(resultsUrl + "/" + testSuiteName + "/output.xml");
-            LOGGER.debug(EELFLoggerDelegate.debugLogger, "Request URI of get: " + webResource.getURI().toString());
-            response = webResource.get(ClientResponse.class);
-            if (response.getStatus() != 200) {
-                throw new HttpException("Could not retrieve test suite result from Nexus. HTTP error code : "
-                        + response.getStatus() + " and message: " + response.getEntity(String.class));
+            try {
+                String testSuiteName = elements.get(i).getElementsByTag("td").get(0).getElementsByTag("a").get(0)
+                        .text();
+                testSuiteName = testSuiteName.substring(0, testSuiteName.length() - 1);
+                webResource = this.client.resource(resultsUrl + "/" + testSuiteName + "/output.xml");
+                LOGGER.debug(EELFLoggerDelegate.debugLogger, "Request URI of get: " + webResource.getURI().toString());
+                response = webResource.get(ClientResponse.class);
+                if (response.getStatus() != 200) {
+                    throw new HttpException("Could not retrieve test suite result from Nexus. HTTP error code : "
+                            + response.getStatus() + " and message: " + response.getEntity(String.class));
+                }
+                String result = response.getEntity(String.class);
+                JSONObject xmlJSONObj = XML.toJSONObject(result);
+                ObjectMapper mapper = new ObjectMapper();
+                mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
+                mapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true);
+                mapper.setSerializationInclusion(Include.NON_NULL);
+                RobotTestResult robotTestResult = mapper.readValue(xmlJSONObj.toString(), RobotTestResult.class);
+                robotTestResult.setName(testSuiteName);
+                rTestResults.add(robotTestResult);
+            } catch (Exception ex) {
+                LOGGER.warn(EELFLoggerDelegate.auditLogger,
+                        "Exception occured while retrieving robot results. " + UserUtils.getStackTrace(ex));
+                continue;
             }
-            String result = response.getEntity(String.class);
-            JSONObject xmlJSONObj = XML.toJSONObject(result);
-            ObjectMapper mapper = new ObjectMapper();
-            mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
-            mapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true);
-            mapper.setSerializationInclusion(Include.NON_NULL);
-            RobotTestResult robotTestResult = mapper.readValue(xmlJSONObj.toString(), RobotTestResult.class);
-            robotTestResult.setName(testSuiteName);
-            rTestResults.add(robotTestResult);
         }
         return rTestResults;
     }
index 555b948..5ad2201 100644 (file)
@@ -198,7 +198,7 @@ public class IntegratedResultService {
         }
         List<ValidationDbTestResult> vNexusResults = new ArrayList<ValidationDbTestResult>();
         List<ValidationDbTestResult> vResults = nexusService.getResults(name, version, labInfo.getSilo(), date);
-        if (vResults != null && vResults.size() > 1) {
+        if (vResults != null && vResults.size() >= 1) {
             for (ValidationDbTestResult vNexusResult : vResults) {
                 if (dbAdapter.checkValidityOfNexusResult(vNexusResult)) {
                     vNexusResult.setLab(labInfo);
index d870e02..e10f136 100644 (file)
@@ -56,7 +56,7 @@ use_rest_for_functional_menu=true
 portal.api.impl.class = org.onap.portalapp.service.OnBoardingApiServiceImpl
 
 # URL of the Portal where this app is onboarded
-ecomp_redirect_url = https://bluval.akraino.org:8443/bluvalui/
+ecomp_redirect_url = https://bluval.akraino.org:443/bluvalui/
 
 # URL of the ECOMP Portal REST API
 ecomp_rest_url = http://portal.onap.org:50580/ecompportal/auxapi
index 8cc24f1..37832b3 100644 (file)
@@ -1,10 +1,10 @@
 {
   "globals": {
     "angular": writable,
-    "console": 1,
-    "confirm":1,
-    "localStorage":1,
-    "window":1,
-    "appDS2":1
+    "console": writable,
+    "confirm":writable,
+    "localStorage":writable,
+    "window":writable,
+    "appDS2":writable
   }
 }
index 3352960..45eebd2 100644 (file)
@@ -49,7 +49,7 @@ limitations under the License.
     href="app/fusion/styles/ecomp.css">
 
 <link rel="stylesheet"
-    href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" />
+    href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" />
 <link rel="stylesheet"
     href="https://cdnjs.cloudflare.com/ajax/libs/ng-table/1.0.0/ng-table.css">
 
index eb545eb..46d1543 100644 (file)
@@ -78,11 +78,20 @@ app
                     }
                     svc.filterWithResult = function(validationDbTestResults,
                             filterResult) {
+                        var validationDbTestResultsWithNoErrors = [];
+                        angular
+                                .forEach(
+                                        validationDbTestResults,
+                                        function(validationDbTestResult) {
+                                            if (validationDbTestResult.submission || (validationDbTestResult.wrobotDbTestResults && validationDbTestResult.wrobotDbTestResults.length > 0)) {
+                                                validationDbTestResultsWithNoErrors.push(validationDbTestResult);
+                                            }
+                                        });
                         if (filterResult === undefined || filterResult === '') {
-                            return validationDbTestResults;
+                            return validationDbTestResultsWithNoErrors;
                         }
                         var filteredResults = [];
-                        angular.forEach(validationDbTestResults, function(
+                        angular.forEach(validationDbTestResultsWithNoErrors, function(
                                 validationDbTestResult) {
                             if (validationDbTestResult.result === true
                                     && 'success'.includes(filterResult
diff --git a/ui/ui-docker-assembly.xml b/ui/ui-docker-assembly.xml
new file mode 100644 (file)
index 0000000..9031f76
--- /dev/null
@@ -0,0 +1,10 @@
+<assembly>
+    <id>ui-docker</id>
+    <fileSets>
+        <fileSet>
+            <directory>.</directory>
+            <outputDirectory>.</outputDirectory>
+            <fileMode>0644</fileMode>
+        </fileSet>
+    </fileSets>
+</assembly>
\ No newline at end of file