"""
import subprocess
+from pathlib import Path
import click
import yaml
"""
show_stopper = testcase.get('show_stopper', False)
what = testcase.get('what')
- variables = "variables.yaml"
- results = "results/"+testcase.get('layer')+"/"+what
- test_path = "tests/"+testcase.get('layer')+"/"+what
- args = ["robot", "-V", variables, "-d", results, test_path]
+ mypath = Path(__file__).absolute()
+ results_path = mypath.parents[2].joinpath("results/"+testcase.get('layer')+"/"+what)
+ test_path = mypath.parents[1].joinpath("tests/"+testcase.get('layer')+"/"+what)
+
+ # add to the variables file the path to where to sotre the logs
+ 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))
+
+ # run the test
+ args = ["robot", "-V", str(variables_file), "-d", str(results_path), str(test_path)]
print('Executing testcase {}'.format(testcase['name']))
print(' show_stopper {}'.format(show_stopper))
"""Takes blueprint name and optional layer. Validates inputs and derives
yaml location from blueprint name. Invokes validate on blue print.
"""
- yaml_loc = 'bluval/bluval-{}.yaml'.format(blueprint)
+ mypath = Path(__file__).absolute()
+ yaml_loc = mypath.parents[0].joinpath('bluval-{}.yaml'.format(blueprint))
if layer is not None:
layer = layer.lower()
validate_blueprint(yaml_loc, layer)
# Install dependencies
COPY pip-requirements.txt /wheels/requirements/pip-requirements.txt
+
RUN apk --no-cache add --update \
openssl \
python3 \
make WHAT=test/e2e/e2e.test ARCH=$HOST_ARCH
RUN go get -u -v github.com/heptio/sonobuoy
RUN git clone https://gerrit.akraino.org/r/validation /opt/akraino/validation/repo
+RUN cat /opt/akraino/validation/repo/bluval/requirements.txt >> \
+ /wheels/requirements/pip-requirements.txt
WORKDIR /wheels
RUN pip3 install wheel
rm -rf /root/.cache/pip/*
# Set the default command for running the tests
-CMD /usr/local/bin/robot --loglevel DEBUG \
- --outputdir /opt/akraino/validation/results/conformance \
- /opt/akraino/validation/repo/conformance/conformance.robot
+CMD python3 /opt/akraino/validation/repo/bluval/bluval.py base -l k8s
#${USERNAME} localadmin
#${SYSINFO} PowerEdge R740xd
#${BIOS_REVISION} 1.3
-${LOG} /opt/akraino/validation/bios_version/print_bios.txt
+${LOG} ${LOG_PATH}${/}${SUITE_NAME.replace(' ','_')}.log
*** Test Cases ***
Get HW Details
Test Teardown Cleanup Sonobuoy
*** Variables ***
-${RESULT_PATH} /opt/akraino/validation/results/conformance/
-${REPO_PATH} /opt/akraino/validation/repo/conformance/
-${LOG} ${RESULT_PATH}${/}conformance.log
+${LOG} ${LOG_PATH}${/}${SUITE_NAME.replace(' ','_')}.log
*** Test Cases ***
Run Sonobuoy Conformance Test
# Start the test
- Run kubectl apply -f ${REPO_PATH}${/}sonobuoy.yaml
+ Run kubectl apply -f ${CURDIR}${/}sonobuoy.yaml
Sleep 5s
${rc} ${output}= Run And Return Rc And Output
... kubectl describe pod/sonobuoy -n heptio-sonobuoy
# Get the result and store the sonobuoy logs
${rc} ${output}= Run And Return Rc And Output
- ... results=$(sonobuoy retrieve ${RESULT_PATH}) && sonobuoy e2e $results
+ ... results=$(sonobuoy retrieve ${LOG_PATH}) && sonobuoy e2e $results
Append To File ${LOG} ${output}${\n}
Should Contain ${output} failed tests: 0
Cleanup Sonobuoy
${rc} ${output}= Run And Return Rc And Output
- ... kubectl delete -f ${REPO_PATH}${/}sonobuoy.yaml
+ ... kubectl delete -f ${CURDIR}${/}sonobuoy.yaml
Append To File ${LOG} ${output}${\n}
Sleep 3s
Should Contain ${output} service "sonobuoy-master" deleted
*** Variables ***
${HOST} localhost
${USERNAME} localadmin
-${LOG} /opt/akraino/validation/ha/print_calico_coredns_haproxy.txt
+${LOG} ${LOG_PATH}${/}${SUITE_NAME.replace(' ','_')}.log
${HOST} localhost
${USERNAME} localadmin
${NODENAME} aknode109
-${LOG} /opt/akraino/validation/ha/print_etcd_api_ctl-manager_sch.txt
+${LOG} ${LOG_PATH}${/}${SUITE_NAME.replace(' ','_')}.log
## kubernetes-etcd
*** Variables ***
${HOST} localhost
${USERNAME} localadmin
-${LOG} /opt/akraino/validation/ha/print_docker_kubelet.txt
+${LOG} ${LOG_PATH}${/}${SUITE_NAME.replace(' ','_')}.log
## Container Runtime
${HOST} localhost
${USERNAME} ipmi_admin_username
${PASSWORD} ipmi_admin_password
-${LOG} /opt/akraino/validation/ha/print_ha.txt
+${LOG} ${LOG_PATH}${/}${SUITE_NAME.replace(' ','_')}.log
*** Test Cases ***
Power Status of Host