Commit e8b50328 authored by Waleed Akbar's avatar Waleed Akbar
Browse files

Update GNMI test scripts and configurations; add topology files for integration testing

parent 21f57be2
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -25,6 +25,5 @@ cd $PROJECTDIR/src
RCFILE=$PROJECTDIR/coverage/.coveragerc

python3 -m pytest --log-level=info --log-cli-level=info --verbose \
    telemetry/backend/tests/gnmi_oc/test_GnmiOpenConfigCollector.py
    # telemetry/backend/tests/gnmi_openconfig/test_gnmi_openconfig_collector.py
# /home/cttc/waleed/tfs-ctrl/src/
 No newline at end of file
    telemetry/backend/tests/gnmi_oc/test_complete_GnmiOCcollector.py # this is integration test
    # telemetry/backend/tests/gnmi_oc/test_GnmiOpenConfigCollector.py # this is unit test
+22 −22
Original line number Diff line number Diff line
@@ -22,17 +22,17 @@ RUN apt-get --yes --quiet --quiet update && \
# Download, build and install libyang. Note that APT package is outdated
# - Ref: https://github.com/CESNET/libyang
# - Ref: https://github.com/CESNET/libyang-python/
RUN mkdir -p /var/libyang
RUN git clone https://github.com/CESNET/libyang.git /var/libyang
WORKDIR /var/libyang
RUN git fetch
RUN git checkout v2.1.148
RUN mkdir -p /var/libyang/build
WORKDIR /var/libyang/build
RUN cmake -D CMAKE_BUILD_TYPE:String="Release" ..
RUN make
RUN make install
RUN ldconfig
# RUN mkdir -p /var/libyang
# RUN git clone https://github.com/CESNET/libyang.git /var/libyang
# WORKDIR /var/libyang
# RUN git fetch
# RUN git checkout v2.1.148
# RUN mkdir -p /var/libyang/build
# WORKDIR /var/libyang/build
# RUN cmake -D CMAKE_BUILD_TYPE:String="Release" ..
# RUN make
# RUN make install
# RUN ldconfig

# Set Python to show logs as they occur
ENV PYTHONUNBUFFERED=0
@@ -93,17 +93,17 @@ COPY src/telemetry/__init__.py telemetry/__init__.py
COPY src/telemetry/backend/. telemetry/backend/

# Clone OpenConfig YANG models
RUN mkdir -p /tmp/openconfig
RUN git clone https://github.com/openconfig/public.git /tmp/openconfig
WORKDIR /tmp/openconfig
RUN git fetch
RUN git checkout v4.4.0
RUN rm -rf /var/teraflow/telemetry/backend/collectors/gnmi_openconfig/git
RUN mkdir -p /var/teraflow/telemetry/backend/collectors/gnmi_openconfig/git/openconfig/public
RUN mv /tmp/openconfig/release /var/teraflow/telemetry/backend/collectors/gnmi_openconfig/git/openconfig/public
RUN mv /tmp/openconfig/third_party /var/teraflow/telemetry/backend/collectors/gnmi_openconfig/git/openconfig/public
RUN rm -rf /tmp/openconfig
WORKDIR /var/teraflow
# RUN mkdir -p /tmp/openconfig
# RUN git clone https://github.com/openconfig/public.git /tmp/openconfig
# WORKDIR /tmp/openconfig
# RUN git fetch
# RUN git checkout v4.4.0
# RUN rm -rf /var/teraflow/telemetry/backend/collectors/gnmi_openconfig/git
# RUN mkdir -p /var/teraflow/telemetry/backend/collectors/gnmi_openconfig/git/openconfig/public
# RUN mv /tmp/openconfig/release /var/teraflow/telemetry/backend/collectors/gnmi_openconfig/git/openconfig/public
# RUN mv /tmp/openconfig/third_party /var/teraflow/telemetry/backend/collectors/gnmi_openconfig/git/openconfig/public
# RUN rm -rf /tmp/openconfig
# WORKDIR /var/teraflow

# Start the service
ENTRYPOINT ["python", "-m", "telemetry.backend.service"]
+3 −3
Original line number Diff line number Diff line
@@ -15,9 +15,9 @@
anytree==2.8.0
APScheduler>=3.10.4
confluent-kafka==2.3.*
pyang==2.6.*
git+https://github.com/robshakir/pyangbind.git
libyang==2.8.4
# pyang==2.6.*
# git+https://github.com/robshakir/pyangbind.git
# libyang==2.8.4
kafka-python==2.0.6
numpy==2.0.1
pytz>=2025.2
+1 −1
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ if LOAD_ALL_DEVICE_DRIVERS:
            {
                # Real Packet Router, specifying GNMI Driver => use GnmiDriver
                FilterFieldEnum.DEVICE_TYPE: DeviceTypeEnum.PACKET_ROUTER,
                FilterFieldEnum.DRIVER     : DeviceDriverEnum.DEVICEDRIVER_GNMI,
                FilterFieldEnum.DRIVER     : DeviceDriverEnum.DEVICEDRIVER_GNMI_OPENCONFIG,
            }
        ]))
+1 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ from .Fixtures import context_client, device_client # pylint: disable=unused-imp
LOGGER = logging.getLogger(__name__)
LOGGER.setLevel(logging.DEBUG)

DESCRIPTOR_FILE  = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'topology.json')
DESCRIPTOR_FILE  = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'gnmi_oc/topology.json')
ADMIN_CONTEXT_ID = ContextId(**json_context_id(DEFAULT_CONTEXT_NAME))

def load_topology(
Loading