diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d3213ad7..2c7274a7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -40,7 +40,6 @@ run_tools_test: allow_failure: false script: - "./gitlab-ci/pipeline_setup.sh" - - "./gitlab-ci/install-unified-dependencies.sh" - "./gitlab-ci/setup.sh ms" - "./gitlab-ci/tools-test.sh" - "./gitlab-ci/generate_supported_dm.sh" diff --git a/gitlab-ci/generate_supported_dm.sh b/gitlab-ci/generate_supported_dm.sh index e0856b3f..d70b0366 100755 --- a/gitlab-ci/generate_supported_dm.sh +++ b/gitlab-ci/generate_supported_dm.sh @@ -16,6 +16,8 @@ if [ -n "${CI_SERVER_HOST}" ]; then fi install_cmph +install_libeasy +install_libethernet # Make sure that all plugins are removed [ ! -d "${BBFDM_PLUGIN_DIR}" ] && mkdir -p "${BBFDM_PLUGIN_DIR}" diff --git a/gitlab-ci/install-dependencies.sh b/gitlab-ci/install-dependencies.sh index 44a65fc7..69c0369b 100755 --- a/gitlab-ci/install-dependencies.sh +++ b/gitlab-ci/install-dependencies.sh @@ -38,4 +38,6 @@ else #install Network Data Model as a micro-service echo "Installing Network Data Model (netmngr) as a micro-service" install_netmngr_as_micro_service + + install_ethmngr_as_micro_service fi diff --git a/gitlab-ci/install-unified-dependencies.sh b/gitlab-ci/install-unified-dependencies.sh deleted file mode 100755 index ad41e0be..00000000 --- a/gitlab-ci/install-unified-dependencies.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - -echo "install unified daemon dependencies" - -source ./gitlab-ci/shared.sh - -dst=$(pwd) - -# libeasy for ethmngr -cd /opt/dev -rm -fr libeasy -mkdir -p /usr/include/easy -git clone -b devel https://dev.iopsys.eu/iopsys/libeasy.git -cd libeasy -make -cp -a libeasy*.so* /usr/lib -cp -a *.h /usr/include/easy/ - -# libethernet for ethmngr -cd /opt/dev -rm -fr libethernet -git clone -b devel https://dev.iopsys.eu/iopsys/libethernet.git -cd libethernet -make PLATFORM=TEST -cp ethernet.h /usr/include -cp -a libethernet*.so* /usr/lib -sudo ldconfig - -cd ${dst} -pwd diff --git a/gitlab-ci/micro_service.conf b/gitlab-ci/micro_service.conf index 5b410136..9d6bfede 100644 --- a/gitlab-ci/micro_service.conf +++ b/gitlab-ci/micro_service.conf @@ -1,4 +1,4 @@ -[program:sysmng] +[program:sysmngr] priority=5 command=/bin/bash -c "/usr/bin/valgrind --xml=yes --xml-file=/tmp/memory-sysmngr-report.xml --leak-check=full --show-reachable=yes --show-leak-kinds=all --errors-for-leak-kinds=all --error-exitcode=1 --track-origins=yes --leak-resolution=high --show-error-list=yes --child-silent-after-fork=yes /usr/sbin/sysmngr" @@ -9,3 +9,7 @@ command=/bin/bash -c "/usr/bin/valgrind --xml=yes --xml-file=/tmp/memory-netmngr [program:wifidmd] priority=7 command=/bin/bash -c "/usr/bin/valgrind --xml=yes --xml-file=/tmp/memory-wifidmd-report.xml --leak-check=full --show-reachable=yes --show-leak-kinds=all --errors-for-leak-kinds=all --error-exitcode=1 --track-origins=yes --leak-resolution=high --show-error-list=yes --child-silent-after-fork=yes /usr/sbin/dm-service -m wifidmd" + +[program:ethmngr] +priority=10 +command=/bin/bash -c "/usr/bin/valgrind --xml=yes --xml-file=/tmp/memory-ethmngr-report.xml --leak-check=full --show-reachable=yes --show-leak-kinds=all --errors-for-leak-kinds=all --error-exitcode=1 --track-origins=yes --leak-resolution=high --show-error-list=yes --child-silent-after-fork=yes /usr/sbin/ethmngr" diff --git a/gitlab-ci/shared.sh b/gitlab-ci/shared.sh index 8cfc337b..899fa8b4 100755 --- a/gitlab-ci/shared.sh +++ b/gitlab-ci/shared.sh @@ -134,13 +134,55 @@ function install_wifidmd_as_micro_service() generate_input_schema_with_output_name "wifidmd" "WiFi" > /etc/bbfdm/services/wifidmd.json } +function install_libeasy() +{ + [ -d "/opt/dev/libeasy" ] && return 0 + + exec_cmd git clone https://dev.iopsys.eu/iopsys/libeasy.git /opt/dev/libeasy + ( + + cd /opt/dev/libeasy + exec_cmd make + mkdir -p /usr/include/easy + cp -a libeasy*.so* /usr/lib + cp -a *.h /usr/include/easy/ + ) +} + +function install_libethernet() +{ + [ -d "/opt/dev/libethernet" ] && return 0 + + exec_cmd git clone https://dev.iopsys.eu/iopsys/libethernet.git /opt/dev/libethernet + ( + cd /opt/dev/libethernet + make PLATFORM=TEST + cp ethernet.h /usr/include + cp -a libethernet*.so* /usr/lib + sudo ldconfig + ) +} + +function install_ethmngr_as_micro_service() +{ + [ -d "/opt/dev/ethmngr" ] && return 0 + + install_libeasy + install_libethernet + + exec_cmd git clone https://dev.iopsys.eu/hal/ethmngr.git /opt/dev/ethmngr + exec_cmd make -C /opt/dev/ethmngr + exec_cmd cp /opt/dev/ethmngr/ethmngr /usr/sbin/ethmngr +} + function install_netmngr_as_micro_service() { [ -d "/opt/dev/netmngr" ] && return 0 exec_cmd git clone https://dev.iopsys.eu/network/netmngr.git /opt/dev/netmngr - exec_cmd make -C /opt/dev/netmngr/src/ clean && make -C /opt/dev/netmngr/src/ CFLAGS="-D'BBF_VENDOR_PREFIX=\"X_IOPSYS_EU_\"'" + exec_cmd make -C /opt/dev/netmngr/src/ clean + exec_cmd make -C /opt/dev/netmngr/src/ NETMNGR_GRE_OBJ=y NETMNGR_IP_OBJ=y NETMNGR_ROUTING_OBJ=y NETMNGR_PPP_OBJ=y NETMNGR_ROUTER_ADVERTISEMENT_OBJ=y NETMNGR_IPV6RD_OBJ=y exec_cmd cp -f /opt/dev/netmngr/src/libnetmngr.so /usr/share/bbfdm/micro_services/netmngr.so exec_cmd cp -f /opt/dev/netmngr/src/libinterface_stack.so /usr/share/bbfdm/plugins exec_cmd mkdir -p /usr/share/bbfdm/micro_services/netmngr @@ -211,7 +253,7 @@ function generate_report() function install_cmph() { - [ -d "/opt/dev/cmph" ] && rm -rf /opt/dev/cmph + [ -d "/opt/dev/cmph" ] && return 0 exec_cmd git clone https://git.code.sf.net/p/cmph/git /opt/dev/cmph ( @@ -222,3 +264,4 @@ function install_cmph() exec_cmd sudo make install ) } + diff --git a/test/files/etc/bbfdm/services/ethmngr.json b/test/files/etc/bbfdm/services/ethmngr.json new file mode 100644 index 00000000..1fe7f828 --- /dev/null +++ b/test/files/etc/bbfdm/services/ethmngr.json @@ -0,0 +1,16 @@ +{ + "daemon": { + "enable": "1", + "service_name": "ethmngr", + "unified_daemon": true, + "services": [ + { + "parent_dm": "Device.", + "object": "Ethernet" + } + ], + "config": { + "loglevel": "3" + } + } +} diff --git a/test/files/tmp/rmonstats_eth0.data b/test/files/tmp/rmonstats_eth0.data deleted file mode 100644 index e0222fe9..00000000 --- a/test/files/tmp/rmonstats_eth0.data +++ /dev/null @@ -1,31 +0,0 @@ -{ - "ifname": "eth0", - "tx_priority_q": -1, - "tx_bytes": 0, - "tx_packets": 0, - "tx_broadcast_packets": 0, - "tx_multicast_packets": 0, - "tx_crc_error_packets": 0, - "tx_undersize_packets": 0, - "tx_oversize_packets": 0, - "tx_packets_64bytes": 0, - "tx_packets_65to127bytes": 0, - "tx_packets_128to255bytes": 0, - "tx_packets_256to511bytes": 0, - "tx_packets_512to1023bytes": 0, - "tx_packets_1024to1518bytes": 0, - "rx_bytes": 0, - "rx_packets": 0, - "rx_broadcast_packets": 0, - "rx_multicast_packets": 0, - "rx_crc_error_packets": 0, - "rx_undersize_packets": 0, - "rx_oversize_packets": 0, - "rx_packets_64bytes": 0, - "rx_packets_65to127bytes": 0, - "rx_packets_128to255bytes": 0, - "rx_packets_256to511bytes": 0, - "rx_packets_512to1023bytes": 0, - "rx_packets_1024to1518bytes": 0 -} - diff --git a/test/files/tmp/rmonstats_eth1.data b/test/files/tmp/rmonstats_eth1.data deleted file mode 100644 index 7f62405a..00000000 --- a/test/files/tmp/rmonstats_eth1.data +++ /dev/null @@ -1,31 +0,0 @@ -{ - "ifname": "eth1", - "tx_priority_q": -1, - "tx_bytes": 0, - "tx_packets": 0, - "tx_broadcast_packets": 0, - "tx_multicast_packets": 0, - "tx_crc_error_packets": 0, - "tx_undersize_packets": 0, - "tx_oversize_packets": 0, - "tx_packets_64bytes": 0, - "tx_packets_65to127bytes": 0, - "tx_packets_128to255bytes": 0, - "tx_packets_256to511bytes": 0, - "tx_packets_512to1023bytes": 0, - "tx_packets_1024to1518bytes": 0, - "rx_bytes": 0, - "rx_packets": 0, - "rx_broadcast_packets": 0, - "rx_multicast_packets": 0, - "rx_crc_error_packets": 0, - "rx_undersize_packets": 0, - "rx_oversize_packets": 0, - "rx_packets_64bytes": 0, - "rx_packets_65to127bytes": 0, - "rx_packets_128to255bytes": 0, - "rx_packets_256to511bytes": 0, - "rx_packets_512to1023bytes": 0, - "rx_packets_1024to1518bytes": 0 -} - diff --git a/test/files/tmp/rmonstats_eth2.data b/test/files/tmp/rmonstats_eth2.data deleted file mode 100644 index d69be128..00000000 --- a/test/files/tmp/rmonstats_eth2.data +++ /dev/null @@ -1,31 +0,0 @@ -{ - "ifname": "eth2", - "tx_priority_q": -1, - "tx_bytes": 338808, - "tx_packets": 2268, - "tx_broadcast_packets": 377, - "tx_multicast_packets": 1104, - "tx_crc_error_packets": 0, - "tx_undersize_packets": 0, - "tx_oversize_packets": 0, - "tx_packets_64bytes": 666, - "tx_packets_65to127bytes": 1291, - "tx_packets_128to255bytes": 196, - "tx_packets_256to511bytes": 16, - "tx_packets_512to1023bytes": 16, - "tx_packets_1024to1518bytes": 83, - "rx_bytes": 245770, - "rx_packets": 2410, - "rx_broadcast_packets": 0, - "rx_multicast_packets": 797, - "rx_crc_error_packets": 0, - "rx_undersize_packets": 0, - "rx_oversize_packets": 0, - "rx_packets_64bytes": 392, - "rx_packets_65to127bytes": 1724, - "rx_packets_128to255bytes": 289, - "rx_packets_256to511bytes": 1, - "rx_packets_512to1023bytes": 1, - "rx_packets_1024to1518bytes": 3 -} - diff --git a/test/files/tmp/rmonstats_eth3.data b/test/files/tmp/rmonstats_eth3.data deleted file mode 100644 index d60d0cb1..00000000 --- a/test/files/tmp/rmonstats_eth3.data +++ /dev/null @@ -1,31 +0,0 @@ -{ - "ifname": "eth3", - "tx_priority_q": -1, - "tx_bytes": 0, - "tx_packets": 0, - "tx_broadcast_packets": 0, - "tx_multicast_packets": 0, - "tx_crc_error_packets": 0, - "tx_undersize_packets": 0, - "tx_oversize_packets": 0, - "tx_packets_64bytes": 0, - "tx_packets_65to127bytes": 0, - "tx_packets_128to255bytes": 0, - "tx_packets_256to511bytes": 0, - "tx_packets_512to1023bytes": 0, - "tx_packets_1024to1518bytes": 0, - "rx_bytes": 0, - "rx_packets": 0, - "rx_broadcast_packets": 0, - "rx_multicast_packets": 0, - "rx_crc_error_packets": 0, - "rx_undersize_packets": 0, - "rx_oversize_packets": 0, - "rx_packets_64bytes": 0, - "rx_packets_65to127bytes": 0, - "rx_packets_128to255bytes": 0, - "rx_packets_256to511bytes": 0, - "rx_packets_512to1023bytes": 0, - "rx_packets_1024to1518bytes": 0 -} - diff --git a/test/files/tmp/rmonstats_eth4.data b/test/files/tmp/rmonstats_eth4.data deleted file mode 100644 index 90b97b64..00000000 --- a/test/files/tmp/rmonstats_eth4.data +++ /dev/null @@ -1,31 +0,0 @@ -{ - "ifname": "eth4", - "tx_priority_q": -1, - "tx_bytes": 0, - "tx_packets": 0, - "tx_broadcast_packets": 0, - "tx_multicast_packets": 0, - "tx_crc_error_packets": 0, - "tx_undersize_packets": 0, - "tx_oversize_packets": 0, - "tx_packets_64bytes": 0, - "tx_packets_65to127bytes": 0, - "tx_packets_128to255bytes": 0, - "tx_packets_256to511bytes": 0, - "tx_packets_512to1023bytes": 0, - "tx_packets_1024to1518bytes": 0, - "rx_bytes": 0, - "rx_packets": 0, - "rx_broadcast_packets": 0, - "rx_multicast_packets": 0, - "rx_crc_error_packets": 0, - "rx_undersize_packets": 0, - "rx_oversize_packets": 0, - "rx_packets_64bytes": 0, - "rx_packets_65to127bytes": 0, - "rx_packets_128to255bytes": 0, - "rx_packets_256to511bytes": 0, - "rx_packets_512to1023bytes": 0, - "rx_packets_1024to1518bytes": 0 -} - diff --git a/test/files/usr/libexec/rpcd/ethernet b/test/files/usr/libexec/rpcd/ethernet deleted file mode 100755 index bf78d405..00000000 --- a/test/files/usr/libexec/rpcd/ethernet +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh - -. /usr/share/libubox/jshn.sh - -case "$1" in - list) - echo '{ "rmonstats" : {"ifname":"str"} }' - ;; - call) - case "$2" in - rmonstats) - read input; - json_load "$input" - json_get_var ifname ifname - if [ "$ifname" = "eth1" ]; then - cat /tmp/rmonstats_eth1.data 2>/dev/null - elif [ "$ifname" = "eth2" ]; then - cat /tmp/rmonstats_eth2.data 2>/dev/null - elif [ "$ifname" = "eth3" ]; then - cat /tmp/rmonstats_eth3.data 2>/dev/null - elif [ "$ifname" = "eth4" ]; then - cat /tmp/rmonstats_eth4.data 2>/dev/null - else - cat /tmp/rmonstats_eth0.data 2>/dev/null - fi - ;; - esac - ;; -esac - diff --git a/tools/tools_input.json b/tools/tools_input.json index 3f621b5d..a44226af 100644 --- a/tools/tools_input.json +++ b/tools/tools_input.json @@ -427,7 +427,7 @@ "src/ppp.c", "src/routeradvertisement.c", "src/routing.c", - "src/ipv6rd.c" + "src/ipv6rd.c", "src/common.c" ] },