netopeer2 package update
v2 cover netopeer2 package update
This series contains the netopeer2 package update with the corresponding
dependencies: libyang, libnetconf2, sysrepo.
This series must be applied together due to API breaking changes.
Also minimal tests for sysrepo and netopeer2 are included in the series.
Heiko Thiery (6):
package/libyang: bump to version 3.4.2 package/libnetconf2: bump to version 3.5.1 package/sysrepo: bump to version 2.11.7 package/netopeer2: bump to version 2.2.31 support/testing/tests/package/test_sysrepo.py: add new test support/testing/tests/package/test_netopeer2.py: add new test
DEVELOPERS | 2 +
package/libnetconf2/Config.in | 1 +
package/libnetconf2/libnetconf2.hash | 2 +-
package/libnetconf2/libnetconf2.mk | 26 ++++--------
package/libyang/libyang.hash | 4 +-
package/libyang/libyang.mk | 2 +-
package/netopeer2/Config.in | 20 +++++++++-
.../{S52netopeer2 => S52netopeer2-server} | 2 +-
package/netopeer2/netopeer2.hash | 2 +-
package/netopeer2/netopeer2.mk | 12 ++++--
package/sysrepo/Config.in | 21 ++++++++++
package/sysrepo/S51sysrepo-plugind | 3 +-
package/sysrepo/sysrepo.hash | 2 +-
package/sysrepo/sysrepo.mk | 5 ++-
.../testing/tests/package/test_netopeer2.py | 40 +++++++++++++++++++
support/testing/tests/package/test_sysrepo.py | 25 ++++++++++++
16 files changed, 136 insertions(+), 33 deletions(-)
rename package/netopeer2/{S52netopeer2 => S52netopeer2-server} (92%)
create mode 100644 support/testing/tests/package/test_netopeer2.py
create mode 100644 support/testing/tests/package/test_sysrepo.pySignature · 6 lines
2.39.2 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v2 1/6 package/libyang: bump to version 3.4.2
The LICENSE hash has to be updated due to copyright year change.
--- package/libyang/libyang.hash | 4 ++-- package/libyang/libyang.mk | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
package/libyang/libyang.hash +2 -2
@@ -1,3 +1,3 @@ # Locally calculated -sha256 77a0aaaeb3df720aeb70d6896e32e2c2be099d48df73e3cfb52567051af3e44b libyang-2.1.148.tar.gz -sha256 0b7ec43747d211a1e49c53588b0822062947bab6bdcc95238578beab34cba5bb LICENSE +sha256 2767902aeffc55c55767f4ecfe5371c422174794edd8aa2b02028d5fe3f8b82c libyang-3.4.2.tar.gz +sha256 f4fbaa09c8b2faa6a873a38181ff860e2ff90808320f71deb369f03ddfb920da LICENSE
package/libyang/libyang.mk +1 -1
@@ -4,7 +4,7 @@ # ################################################################################ -LIBYANG_VERSION = 2.1.148 +LIBYANG_VERSION = 3.4.2 LIBYANG_SITE = $(call github,CESNET,libyang,v$(LIBYANG_VERSION)) LIBYANG_LICENSE = BSD-3-Clause LIBYANG_LICENSE_FILES = LICENSE
Signature · 6 lines
2.39.2 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v2 2/6 package/libnetconf2: bump to version 3.5.1
In reply to Heiko ThierySince version 3.x the cmake configuration options for ENABLE_TLS and ENABLE_SSH are refactored and are replaced by ENABLE_SSH_TLS.
The ENABLE_SSH_TLS option can only be selected when BR2_PACKAGE_LIBSSH_SERVER and BR2_PACKAGE_LIBCURL are available.
In addition, the dependency on openssl is now necessary.
---
v2: (after review comments from Thomas Pettazoni)
- reworded the commit message
- added selection of openssol package in Config.in
- fixed inconsistency in dependency to openssl
package/libnetconf2/Config.in | 1 + package/libnetconf2/libnetconf2.hash | 2 +- package/libnetconf2/libnetconf2.mk | 26 +++++++------------------- 3 files changed, 9 insertions(+), 20 deletions(-)
package/libnetconf2/Config.in +1 -0
@@ -6,6 +6,7 @@ config BR2_PACKAGE_LIBNETCONF2 depends on BR2_USE_MMU select BR2_PACKAGE_LIBXCRYPT if BR2_TOOLCHAIN_USES_GLIBC select BR2_PACKAGE_LIBYANG + select BR2_PACKAGE_OPENSSL help libnetconf2 is a NETCONF library in C intended for building NETCONF clients and servers.
package/libnetconf2/libnetconf2.hash +1 -1
@@ -1,3 +1,3 @@ # Locally calculated -sha256 72e9a6461fadbd22f0cf0d23ba68d62b297c8f564f7f2bee069748fb67fc3a24 libnetconf2-2.1.28.tar.gz +sha256 0d49e796798015e35a08bfbd53a3dd4004cb9a26d4b1dd1f90940a427d483bbb libnetconf2-3.5.1.tar.gz sha256 bd962ab457c8a8cb8faaaa36c11484680f3c9a47dbc336507817ae8935384064 LICENSE
package/libnetconf2/libnetconf2.mk +7 -19
@@ -4,41 +4,29 @@ # ################################################################################ -LIBNETCONF2_VERSION = 2.1.28 +LIBNETCONF2_VERSION = 3.5.1 LIBNETCONF2_SITE = $(call github,CESNET,libnetconf2,v$(LIBNETCONF2_VERSION)) LIBNETCONF2_INSTALL_STAGING = YES LIBNETCONF2_LICENSE = BSD-3-Clause LIBNETCONF2_LICENSE_FILES = LICENSE -LIBNETCONF2_DEPENDENCIES = libyang +LIBNETCONF2_DEPENDENCIES = libyang libxcrypt openssl HOST_LIBNETCONF2_DEPENDENCIES = host-libyang LIBNETCONF2_CONF_OPTS = \ -DENABLE_TESTS=OFF \ -DENABLE_VALGRIND_TESTS=OFF -ifeq ($(BR2_PACKAGE_LIBSSH_SERVER), y) -LIBNETCONF2_CONF_OPTS += -DENABLE_SSH=ON -LIBNETCONF2_DEPENDENCIES += libssh +ifeq ($(BR2_PACKAGE_LIBSSH_SERVER)$(BR2_PACKAGE_LIBCURL),yy) +LIBNETCONF2_CONF_OPTS += -DENABLE_SSH_TLS=ON +LIBNETCONF2_DEPENDENCIES += libssh libcurl else -LIBNETCONF2_CONF_OPTS += -DENABLE_SSH=OFF -endif - -ifeq ($(BR2_PACKAGE_LIBOPENSSL), y) -LIBNETCONF2_CONF_OPTS += -DENABLE_TLS=ON -LIBNETCONF2_DEPENDENCIES += openssl -else -LIBNETCONF2_CONF_OPTS += -DENABLE_TLS=OFF -endif - -ifeq ($(BR2_PACKAGE_LIBXCRYPT),y) -LIBNETCONF2_DEPENDENCIES += libxcrypt +LIBNETCONF2_CONF_OPTS += -DENABLE_SSH_TLS=OFF endif HOST_LIBNETCONF2_CONF_OPTS = \ -DENABLE_TESTS=OFF \ -DENABLE_VALGRIND_TESTS=OFF \ - -DENABLE_SSH=OFF \ - -DENABLE_TLS=OFF + -DENABLE_TLS_SSH=OFF $(eval $(cmake-package)) $(eval $(host-cmake-package))
Signature · 6 lines
2.39.2 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v2 3/6 package/sysrepo: bump to version 2.11.7
In reply to Heiko ThieryAdd new config options to enable/disable binary tools/daemon. By default this options are enabled.
Also some sysv init script shellcheck warnings are fixed.
--- package/sysrepo/Config.in | 21 +++++++++++++++++++++ package/sysrepo/S51sysrepo-plugind | 3 ++- package/sysrepo/sysrepo.hash | 2 +- package/sysrepo/sysrepo.mk | 5 ++++- 4 files changed, 28 insertions(+), 3 deletions(-)
package/sysrepo/Config.in +21 -0
@@ -16,6 +16,27 @@ config BR2_PACKAGE_SYSREPO if BR2_PACKAGE_SYSREPO +config BR2_PACKAGE_SYSREPO_SYSREPOCFG + bool "enable sysrepocfg" + default y + help + Enable sysrepocfg. + Build binary tool sysrepocfg + +config BR2_PACKAGE_SYSREPO_SYSREPOCTL + bool "enable sysrepoctl" + default y + help + Enable sysrepoctl. + Build binary tool sysrepoctl + +config BR2_PACKAGE_SYSREPO_PLUGIND + bool "enable sysrepo-plugind" + default y + help + Enable sysrepo-plugind. + Build binary daemon sysrepo-plugind + config BR2_PACKAGE_SYSREPO_EXAMPLES bool "enable examples" help
package/sysrepo/S51sysrepo-plugind +2 -1
@@ -10,6 +10,7 @@ SYSREPO_PLUGIND_ARGS="" start() { printf 'Starting %s: ' "$DAEMON" + # shellcheck disable=SC2086 # we need the word splitting start-stop-daemon -S -q -x "$EXECUTABLE" \ -- $SYSREPO_PLUGIND_ARGS status=$?
@@ -45,7 +46,7 @@ reload() { } case "$1" in - start|stop|restart|reload) + start|stop|restart|reload) "$1";; *) echo "Usage: $0 {start|stop|restart|reload}"
package/sysrepo/sysrepo.hash +1 -1
@@ -1,3 +1,3 @@ # Locally calculated -sha256 467efed8d0f62c26a0d200602b911096eb2d67858e620937ab68f96b316fa9b7 sysrepo-2.2.150.tar.gz +sha256 45a98a71827dd1428e2c6b7dedea47558cdfbc491042bbdbc0c52e607ab8266e sysrepo-2.11.7.tar.gz sha256 88f1b7e5c64d2c113e07105aa9c0fb80639b40287565be1c2afd0949df83d826 LICENSE
package/sysrepo/sysrepo.mk +4 -1
@@ -4,7 +4,7 @@ # ################################################################################ -SYSREPO_VERSION = 2.2.150 +SYSREPO_VERSION = 2.11.7 SYSREPO_SITE = $(call github,sysrepo,sysrepo,v$(SYSREPO_VERSION)) SYSREPO_INSTALL_STAGING = YES SYSREPO_LICENSE = BSD-3-Clause
@@ -18,6 +18,9 @@ endif SYSREPO_CONF_OPTS = \ -DBUILD_EXAMPLES=$(if $(BR2_PACKAGE_SYSREPO_EXAMPLES),ON,OFF) \ + -DENABLE_SYSREPOCFG=$(if $(BR2_PACKAGE_SYSREPO_SYSREPOCFG),ON,OFF) \ + -DENABLE_SYSREPOCTL=$(if $(BR2_PACKAGE_SYSREPO_SYSREPOCTL),ON,OFF) \ + -DENABLE_SYSREPO_PLUGIND=$(if $(BR2_PACKAGE_SYSREPO_PLUGIND),ON,OFF) \ -DENABLE_TESTS=OFF \ -DENABLE_VALGRIND_TESTS=OFF \ -DREPO_PATH=/etc/sysrepo
Signature · 6 lines
2.39.2 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v2 4/6 package/netopeer2: bump to version 2.2.31
In reply to Heiko ThieryAdd select for BR2_PACKAGE_LIBCURL since this is a requirement for libnetconf2 to add TLS_SSH support.
Package configuration option to set ssh authorized keys format and option to enable/disable calling syrepo setup script. The utils/check-package script complained about the init script, so this is fixed in advance.
---
package/netopeer2/Config.in | 20 +++++++++++++++++--
.../{S52netopeer2 => S52netopeer2-server} | 2 +-
package/netopeer2/netopeer2.hash | 2 +-
package/netopeer2/netopeer2.mk | 12 ++++++++---
4 files changed, 29 insertions(+), 7 deletions(-)
rename package/netopeer2/{S52netopeer2 => S52netopeer2-server} (92%)package/netopeer2/Config.in +18 -2
@@ -14,9 +14,10 @@ config BR2_PACKAGE_NETOPEER2 depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # sysrepo select BR2_PACKAGE_LIBNETCONF2 select BR2_PACKAGE_LIBSSH - select BR2_PACKAGE_LIBSSH_SERVER # For libnetconf2 to have SSH + select BR2_PACKAGE_LIBSSH_SERVER # For libnetconf2 to have SSH/TLS support + select BR2_PACKAGE_LIBCURL # For libnetconf2 to have SSH/TLS support + select BR2_PACKAGE_OPENSSL # For libnetconf2 to have SSH/TLS support select BR2_PACKAGE_LIBYANG - select BR2_PACKAGE_OPENSSL # For libnetconf2 to have TLS select BR2_PACKAGE_SYSREPO help Netopeer2 is a set of tools implementing network configuration
@@ -33,4 +34,19 @@ config BR2_PACKAGE_NETOPEER2_CLI help Enable netopeer2 CLI. +config BR2_PACKAGE_NETOPEER2_SSH_AUTHORIZED_KEYS_FORMAT + string "ssh authorized keys format" + help + Enable netopeer2 CLI. + sshd-like pattern (with '%h', '%u', '%U') for determining + path to users SSH authorized_keys file + +config BR2_PACKAGE_NETOPEER2_SYSREPO_SETUP + bool "sysrepo modules setup" + default y + help + Install sysrepo modules + Install required modules with their default configuration + into sysrepo using a script + endif
package/netopeer2/S52netopeer2-server renamed from package/netopeer2/S52netopeer2 +1 -1
@@ -7,7 +7,7 @@ NETOPEER2_SERVER_ARGS="" start() { printf 'Starting %s: ' "$DAEMON" - + # shellcheck disable=SC2086 # we need the word splitting start-stop-daemon -S -q -p $PIDFILE -x "/usr/sbin/$DAEMON" \ -- $NETOPEER2_SERVER_ARGS status=$?
package/netopeer2/netopeer2.hash +1 -1
@@ -1,3 +1,3 @@ # Locally calculated -sha256 2b1daac037f18c303e0c0dc3318ba30196459472e4c59f2f8547ee74d4cdf31d netopeer2-2.1.49.tar.gz +sha256 99c4827626852f9d4028330a79efa0b291580aceb0bfd8ae9aaf4ecea66ccc3b netopeer2-2.2.31.tar.gz sha256 b46f161fbdcf127d3ef22602e15958c3092fe3294f71a2dc8cdf8f6689cba95b LICENSE
package/netopeer2/netopeer2.mk +9 -3
@@ -4,7 +4,7 @@ # ################################################################################ -NETOPEER2_VERSION = 2.1.49 +NETOPEER2_VERSION = 2.2.31 NETOPEER2_SITE = $(call github,CESNET,Netopeer2,v$(NETOPEER2_VERSION)) NETOPEER2_DL_SUBDIR = netopeer2 NETOPEER2_LICENSE = BSD-3-Clause
@@ -17,8 +17,14 @@ endif NETOPEER2_CONF_OPTS = \ -DBUILD_CLI=$(if $(BR2_PACKAGE_NETOPEER2_CLI),ON,OFF) \ + -DSYSREPO_SETUP=$(if $(BR2_PACKAGE_NETOPEER2_SYSREPO_SETUP),ON,OFF) \ -DENABLE_TESTS=OFF +ifneq ($(call qstrip,$(BR2_PACKAGE_NETOPEER2_SSH_AUTHORIZED_KEYS_FORMAT)),) +NETOPEER2_CONF_OPTS += \ + -DSSH_AUTHORIZED_KEYS_FORMAT=$(call qstrip,$(BR2_PACKAGE_NETOPEER2_SSH_AUTHORIZED_KEYS_FORMAT)) +endif + # Set a build specific SYSREPO_SHM_PREFIX to ensure we can safely delete the # files. This also ensures that concurrent parallel builds will not be # affected mutualy.
@@ -29,8 +35,8 @@ NETOPEER2_MAKE_ENV = \ SYSREPO_SHM_PREFIX=$(NETOPEER2_SYSREPO_SHM_PREFIX) define NETOPEER2_INSTALL_INIT_SYSV - $(INSTALL) -m 755 -D package/netopeer2/S52netopeer2 \ - $(TARGET_DIR)/etc/init.d/S52netopeer2 + $(INSTALL) -m 755 -D package/netopeer2/S52netopeer2-server \ + $(TARGET_DIR)/etc/init.d/S52netopeer2-server endef # The host sysrepo used to install the netopeer2 modules will leave
Signature · 6 lines
2.39.2 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH v2 4/6] package/netopeer2: bump to version 2.2.31
Hello Heiko,
(Thanks for the v2 with all those improvements!)
package/netopeer2/Config.in config BR2_PACKAGE_NETOPEER2 · line 19
Quoted 12 lines · On Mon, 30 Dec 2024 11:35:36 +0100 Heiko Thiery <[email protected]> wrote:
package/netopeer2/Config.in +3
-1@@ -14,9 +14,10 @@ config BR2_PACKAGE_NETOPEER2 depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # sysrepo select BR2_PACKAGE_LIBNETCONF2 select BR2_PACKAGE_LIBSSH - select BR2_PACKAGE_LIBSSH_SERVER # For libnetconf2 to have SSH + select BR2_PACKAGE_LIBSSH_SERVER # For libnetconf2 to have SSH/TLS support + select BR2_PACKAGE_LIBCURL # For libnetconf2 to have SSH/TLS support + select BR2_PACKAGE_OPENSSL # For libnetconf2 to have SSH/TLS support
This is not needed, and the comment is not true: libnetconf2 now requires openssl unconditionally, so this select is not needed.
package/netopeer2/Config.in config BR2_PACKAGE_NETOPEER2_CLI · line 40
Quoted 13 lines
package/netopeer2/Config.in +4
-1select BR2_PACKAGE_LIBYANG - select BR2_PACKAGE_OPENSSL # For libnetconf2 to have TLS select BR2_PACKAGE_SYSREPO help Netopeer2 is a set of tools implementing network configuration@@ -33,4 +34,19 @@ config BR2_PACKAGE_NETOPEER2_CLI help Enable netopeer2 CLI. +config BR2_PACKAGE_NETOPEER2_SSH_AUTHORIZED_KEYS_FORMAT + string "ssh authorized keys format" + help + Enable netopeer2 CLI.
Hu, how is this option related to enabling the CLI ?
package/netopeer2/Config.in config BR2_PACKAGE_NETOPEER2_CLI · line 44
Quoted 4 lines
package/netopeer2/Config.in +4
-0+ifneq ($(call qstrip,$(BR2_PACKAGE_NETOPEER2_SSH_AUTHORIZED_KEYS_FORMAT)),) +NETOPEER2_CONF_OPTS += \ + -DSSH_AUTHORIZED_KEYS_FORMAT=$(call qstrip,$(BR2_PACKAGE_NETOPEER2_SSH_AUTHORIZED_KEYS_FORMAT)) +endif
Perhaps:
NETOPEER2_SSH_AUTHORIZED_KEYS_FORMAT = $(call qstrip,$(BR2_PACKAGE_NETOPEER2_SSH_AUTHORIZED_KEYS_FORMAT)) ifneq ($(NETOPEER2_SSH_AUTHORIZED_KEYS_FORMAT),)
NETOPEER2_CONF_OPTS += \ -DSSH_AUTHORIZED_KEYS_FORMAT="$(NETOPEER2_SSH_AUTHORIZED_KEYS_FORMAT)"
endif
Thanks!
Thomas
Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training https://bootlin.com _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v2 5/6 support/testing/tests/package/test_sysrepo.py: add new test
In reply to Heiko Thiery--- DEVELOPERS | 1 + support/testing/tests/package/test_sysrepo.py | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 support/testing/tests/package/test_sysrepo.py
DEVELOPERS +1 -0
@@ -1389,6 +1389,7 @@ F: package/rauc/ F: package/sysrepo/ F: support/testing/tests/package/sample_python_yamllint.py F: support/testing/tests/package/test_python_yamllint.py +F: support/testing/tests/package/test_sysrepo.py N: Hervé Codina <[email protected]> F: package/alchemy/
support/testing/tests/package/test_sysrepo.py new file +25 -0
@@ -0,0 +1,25 @@ +import os + +import infra.basetest + + +class TestSysrepo(infra.basetest.BRTest): + config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ + """ + BR2_TARGET_ROOTFS_CPIO=y + BR2_PACKAGE_SYSREPO=y + """ + + def test_run(self): + cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio") + self.emulator.boot(arch="armv5", + kernel="builtin", + options=["-initrd", cpio_file]) + self.emulator.login() + + self.assertRunOk("sysrepoctl -h") + self.assertRunOk("sysrepoctl -l") + + self.assertRunOk("sysrepocfg -h") + self.assertRunOk('sysrepocfg -X -d operational -x "/sysrepo-monitoring:sysrepo-state"') + self.assertRunOk('sysrepocfg -X -d operational -x "/sysrepo-monitoring:sysrepo-state" -f json')
Signature · 6 lines
2.39.2 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v2 6/6 support/testing/tests/package/test_netopeer2.py: add new test
In reply to Heiko Thiery--- DEVELOPERS | 1 + .../testing/tests/package/test_netopeer2.py | 40 +++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 support/testing/tests/package/test_netopeer2.py
DEVELOPERS +1 -0
@@ -1389,6 +1389,7 @@ F: package/rauc/ F: package/sysrepo/ F: support/testing/tests/package/sample_python_yamllint.py F: support/testing/tests/package/test_python_yamllint.py +F: support/testing/tests/package/test_netopeer2.py F: support/testing/tests/package/test_sysrepo.py N: Hervé Codina <[email protected]>
support/testing/tests/package/test_netopeer2.py new file +40 -0
@@ -0,0 +1,40 @@ +import os +import time + +import infra.basetest + + +class TestNetopeer2(infra.basetest.BRTest): + config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ + """ + BR2_TARGET_ROOTFS_CPIO=y + BR2_PACKAGE_NETOPEER2=y + BR2_PACKAGE_NETOPEER2_CLI=y + """ + + def run_netopeer_cli_cmd(self, cmds): + cmd = "netopeer2-cli <<EOF\n" + cmd += "\n".join(cmds) + cmd += "\nEOF" + self.assertRunOk(cmd) + + def test_run(self): + cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio") + self.emulator.boot(arch="armv5", + kernel="builtin", + options=["-initrd", cpio_file]) + self.emulator.login() + + # The daemon takes some time to startup + time.sleep(2) + + # Check if the Daemon is running + self.assertRunOk("ls /var/run/netopeer2-server.pid") + self.assertRunOk("ps aux | grep [n]etopeer2-server") + + # Run CLI + help_command = [ + "help", + "quit", + ] + self.run_netopeer_cli_cmd(help_command)
Signature · 6 lines
2.39.2 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot