From e78f5a762565fe67b2637b560fdc829a9d71ccd0 Mon Sep 17 00:00:00 2001 From: garciadeblas Date: Wed, 17 May 2023 17:53:37 +0200 Subject: [PATCH] Update tests and NBI Dockerfile to patch pyangbing and install libmagic1 Change-Id: If262e372ce26b04df5ac54961336620f27897933 Signed-off-by: garciadeblas --- docker/NBI/Dockerfile | 3 +++ docker/NBI/pyangbind.patch | 46 ++++++++++++++++++++++++++++++++++++ docker/tests/Dockerfile | 6 ++++- docker/tests/pyangbind.patch | 46 ++++++++++++++++++++++++++++++++++++ 4 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 docker/NBI/pyangbind.patch create mode 100644 docker/tests/pyangbind.patch diff --git a/docker/NBI/Dockerfile b/docker/NBI/Dockerfile index 51f273f8..d09ee050 100644 --- a/docker/NBI/Dockerfile +++ b/docker/NBI/Dockerfile @@ -53,6 +53,9 @@ RUN pip3 install \ -r /usr/lib/python3/dist-packages/osm_im/requirements.txt \ -r /usr/lib/python3/dist-packages/osm_nbi/requirements.txt +COPY pyangbind.patch ./ +RUN patch /usr/local/lib/python3.10/dist-packages/pyangbind/lib/yangtypes.py < ./pyangbind.patch + ####################################################################################### FROM ubuntu:22.04 as FINAL diff --git a/docker/NBI/pyangbind.patch b/docker/NBI/pyangbind.patch new file mode 100644 index 00000000..30772996 --- /dev/null +++ b/docker/NBI/pyangbind.patch @@ -0,0 +1,46 @@ +####################################################################################### +# Copyright ETSI Contributors and Others. +# +# 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. +####################################################################################### + +*** .tox/cover/lib/python3.10/site-packages/pyangbind/lib/yangtypes.py 2023-05-10 06:50:57.876027148 -0400 +--- .tox/cover/lib/python3.10/site-packages/pyangbind/lib/yangtypes.py 2023-05-10 06:51:11.772022417 -0400 +*************** limitations under the License. +*** 22,27 **** +--- 22,28 ---- + from __future__ import unicode_literals + + import collections ++ from six.moves import collections_abc + import copy + import uuid + from decimal import Decimal +*************** def TypedListType(*args, **kwargs): +*** 372,378 **** + if not isinstance(allowed_type, list): + allowed_type = [allowed_type] + +! class TypedList(collections.MutableSequence): + _pybind_generated_by = "TypedListType" + _list = list() + +--- 373,379 ---- + if not isinstance(allowed_type, list): + allowed_type = [allowed_type] + +! class TypedList(collections_abc.MutableSequence): + _pybind_generated_by = "TypedListType" + _list = list() + diff --git a/docker/tests/Dockerfile b/docker/tests/Dockerfile index bafe66f5..2c824bc3 100644 --- a/docker/tests/Dockerfile +++ b/docker/tests/Dockerfile @@ -42,7 +42,8 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \ iputils-ping=3:* \ jq=1.6* \ libcurl4-openssl-dev=7.81.* \ - libssl-dev=3.0.* + libssl-dev=3.0.* \ + libmagic1=1:5.* ARG OSM_TESTS_URL ARG PYTHON3_OSM_IM_URL @@ -66,6 +67,9 @@ RUN mv /usr/share/osm-tests/robot-systest /robot-systest RUN mv /usr/share/osm-tests/conformance-tests/ /robot-systest/ RUN mv /usr/share/osm-tests/charm.sh /usr/sbin/charm +COPY pyangbind.patch /robot-systest +RUN patch /usr/local/lib/python3.10/dist-packages/pyangbind/lib/yangtypes.py < /robot-systest/pyangbind.patch + ARG CACHE_DATE=not_a_date RUN git clone \ https://osm.etsi.org/gitlab/vnf-onboarding/osm-packages.git \ diff --git a/docker/tests/pyangbind.patch b/docker/tests/pyangbind.patch new file mode 100644 index 00000000..30772996 --- /dev/null +++ b/docker/tests/pyangbind.patch @@ -0,0 +1,46 @@ +####################################################################################### +# Copyright ETSI Contributors and Others. +# +# 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. +####################################################################################### + +*** .tox/cover/lib/python3.10/site-packages/pyangbind/lib/yangtypes.py 2023-05-10 06:50:57.876027148 -0400 +--- .tox/cover/lib/python3.10/site-packages/pyangbind/lib/yangtypes.py 2023-05-10 06:51:11.772022417 -0400 +*************** limitations under the License. +*** 22,27 **** +--- 22,28 ---- + from __future__ import unicode_literals + + import collections ++ from six.moves import collections_abc + import copy + import uuid + from decimal import Decimal +*************** def TypedListType(*args, **kwargs): +*** 372,378 **** + if not isinstance(allowed_type, list): + allowed_type = [allowed_type] + +! class TypedList(collections.MutableSequence): + _pybind_generated_by = "TypedListType" + _list = list() + +--- 373,379 ---- + if not isinstance(allowed_type, list): + allowed_type = [allowed_type] + +! class TypedList(collections_abc.MutableSequence): + _pybind_generated_by = "TypedListType" + _list = list() + -- 2.25.1