diff options
author | Andrej Kozemcak <andrej.kozemcak@pantheon.tech> | 2019-06-03 14:44:09 +0200 |
---|---|---|
committer | Hongjun Ni <hongjun.ni@intel.com> | 2019-06-13 02:33:12 +0000 |
commit | 86af475f838adff5c44bb8eccdfba2d665975451 (patch) | |
tree | 294b7ecf1939755502ca6e9179b10f764b9a440c | |
parent | 866d47a41d198680426c095362d97ed218e4f94f (diff) |
[TEST] - Jenkins dependence
- Update libssl for ubuntu 16.04
- Change ssh password for netopeer
- Handle exception
Change-Id: Ic13d96491a67496cba2b6ef698698b855ee67fd1
Signed-off-by: Andrej Kozemcak <andrej.kozemcak@pantheon.tech>
-rw-r--r-- | Makefile | 9 | ||||
-rw-r--r-- | scripts/Dockerfile | 2 | ||||
-rwxr-xr-x | scripts/run_test.sh | 4 | ||||
-rwxr-xr-x | test/run_test.py | 2 | ||||
-rw-r--r-- | test/topology.py | 18 |
5 files changed, 25 insertions, 10 deletions
@@ -207,6 +207,11 @@ _netopeer2: _test_python: ifeq ($(filter ubuntu debian,$(OS_ID)),$(OS_ID)) @sudo -E apt-get $(APT_ARGS) -y --force-yes install $(DEB_TEST_DEPENDS) +ifeq ($(OS_VERSION_ID), 16.04) + # Need update libssh library, because netopeer ssh communication does not work with old library + @echo "deb http://archive.ubuntu.com/ubuntu/ bionic main restricted" >> /etc/apt/sources.list\ + &&apt-get update && apt-get -y install libssh-4 +endif else ifeq ($(OS_ID),centos) # compiler return me this error and I don't know hot to fix it, yet # Found Doxygen: /usr/bin/doxygen (found version "1.8.5") found components: doxygen dot @@ -269,7 +274,7 @@ ifeq ($(OS_ID),centos) endif endif -install-test-extra: _test_python _ydk +install-test-extra: _clean_dl _libssh _test_python _ydk @cd ../ && rm -rf $(BR)/downloads build-scvpp: @@ -287,7 +292,7 @@ build-plugins: make install @# NEW INSTRUCTIONS TO BUILD-PLUGINS MUST BE DECLARED ON A NEW LINE WITH '@' -test-plugins: +test-plugins: install-models @test/run_test.py --dir ./test/ build-gnmi: diff --git a/scripts/Dockerfile b/scripts/Dockerfile index 61085b5..f45af42 100644 --- a/scripts/Dockerfile +++ b/scripts/Dockerfile @@ -25,4 +25,4 @@ RUN apt-get install -y \ COPY . /root/src/sweetcomb WORKDIR /root/src/sweetcomb -RUN make install-dep && make build-scvpp && make build-plugins
\ No newline at end of file +RUN make install-dep && make build-scvpp && make build-plugins diff --git a/scripts/run_test.sh b/scripts/run_test.sh index 282ecb9..76b1ca1 100755 --- a/scripts/run_test.sh +++ b/scripts/run_test.sh @@ -47,6 +47,10 @@ docker exec -it ${CONTAINER} bash -c " if [ "$?" == 0 ]; then echo "Run tests" docker exec -it ${CONTAINER} bash -c " + useradd user + echo -e \"user\nuser\" | passwd user + " + docker exec -it ${CONTAINER} bash -c " echo -e \"0000\n0000\" | passwd mkdir /var/log/vpp" fi diff --git a/test/run_test.py b/test/run_test.py index b7898fb..870e6c5 100755 --- a/test/run_test.py +++ b/test/run_test.py @@ -83,8 +83,6 @@ if __name__ == '__main__': "(may be specified multiple times)") args = parser.parse_args() - util.import_yang_modules() - ddir = list() if args.dir is None: ddir.append(os.getcwd()) diff --git a/test/topology.py b/test/topology.py index d8fab1c..33ac58e 100644 --- a/test/topology.py +++ b/test/topology.py @@ -24,6 +24,7 @@ from pyroute2 import IPRoute import psutil import time from ydk.providers import NetconfServiceProvider +from ydk.errors import YClientError class Topology: @@ -42,6 +43,9 @@ class Topology: return for process in self.process: + if process is None: + continue + process.terminate() for proc in psutil.process_iter(attrs=['pid', 'name']): @@ -98,8 +102,9 @@ class Topology: def _start_netopeer_server(self): #TODO: Add to log #print("Start netopeer server.") - self.netopeer_server = subprocess.Popen("netopeer2-server", - stdout=subprocess.PIPE) + err = open("/var/log/netopeer2-server", 'wb') + self.netopeer_server = subprocess.Popen(["netopeer2-server", "-d"], + stdout=subprocess.PIPE, stderr=err) self.process.append(self.netopeer_server) def _start_netopeer_cli(self): @@ -117,9 +122,12 @@ class Topology: def _start_netconfclient(self): #print("Start NetconfClient") - self.netconf_client = NetConfClient(address="127.0.0.1", - username="root", password="0000") - self.process.append(self.netconf_client) + try: + self.netconf_client = NetConfClient(address="127.0.0.1", + username="user", password="user") + self.process.append(self.netconf_client) + except RuntimeError as err: + print("NetConfClient failed, {}".format(err)) def get_vpp(self): return self.vpp |