6ddc2836be593afecfad42ee47b5ae87616894e3
[validation.git] / tests / os / vuls / vuls.robot
1 ##############################################################################
2 # Copyright (c) 2019 AT&T Intellectual Property.                             #
3 # Copyright (c) 2019 Nokia.                                                  #
4 #                                                                            #
5 # Licensed under the Apache License, Version 2.0 (the "License");            #
6 # you maynot use this file except in compliance with the License.            #
7 #                                                                            #
8 # You may obtain a copy of the License at                                    #
9 #       http://www.apache.org/licenses/LICENSE-2.0                           #
10 #                                                                            #
11 # Unless required by applicable law or agreed to in writing, software        #
12 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT  #
13 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.           #
14 # See the License for the specific language governing permissions and        #
15 # limitations under the License.                                             #
16 ##############################################################################
17
18 *** Settings ***
19 Library           SSHLibrary
20 Library           OperatingSystem
21 Library           BuiltIn
22 Library           Process
23
24 *** Variables ***
25 ${LOG_PATH}       /opt/akraino/validation/tests/os/vuls
26
27 *** Test Cases ***
28 Run Vuls test
29     Set Environment Variable  GOROOT  /root/go
30     Set Environment Variable  GOPATH  /root/go/src
31     Set Environment Variable  PATH  /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/go/bin:/root/go/src/bin
32     Set Environment Variable  LC_ALL  en_US.UTF-8
33     Set Environment Variable  LANG  en_US.UTF-8
34
35     ${rc} =  Run And Return Rc  install -D /opt/akraino/validation/tests/os/vuls/config /root/.ssh/
36     Should Be Equal As Integers  ${rc}  0
37
38     ${rc} =  Run And Return Rc  sed -i 's/HOST/${HOST}/g' config.toml
39     Should Be Equal As Integers  ${rc}  0
40
41     ${rc} =  Run And Return Rc  sed -i 's/USERNAME/${USERNAME}/g' config.toml
42     Should Be Equal As Integers  ${rc}  0
43
44     ${rc} =  Run And Return Rc  tar xvzf db.tar.gz -C /opt/akraino/validation/tests/os/vuls/
45     Should Be Equal As Integers  ${rc}  0
46  
47     ${rc} =  Run And Return Rc  vuls scan -config config.toml -ssh-config
48     Should Be Equal As Integers  ${rc}  0
49
50     ${rc}  ${output} =  Run And Return Rc And Output  vuls report
51     Should Be Equal As Integers  ${rc}  0
52     Append To File  ${LOG_PATH}/vuls.log  ${output}${\n}