1
0
mirror of https://github.com/containers/netavark.git synced 2026-02-05 15:45:47 +01:00

10 Commits

Author SHA1 Message Date
Paul Holzinger
1df9198441 bump to v2.0.0-dev
This means we are ready to merge breaking changes such as the iptables
removal.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-11-12 14:13:33 +01:00
Ricardo Branco
3902d992a0 test/001-basic: Make commit test optional
Some distros like openSUSE & Debian don't build netavark from git,
so the commit information won't be available.

Make this test conditional when NETAVARK_UPSTREAM is set.

Signed-off-by: Ricardo Branco <rbranco@suse.de>
2025-03-07 18:19:00 +01:00
Paul Holzinger
d49f979ff2 use OsString/Path over String for file paths
Rust String type has a pretty well documented difference to most string
types in many other languages. A rust string must be valid utf-8.
However linux itself does not care about the char encoding in paths, it
is simply a non zero byte array. This means that technically netavark
will not accept all valid paths. While it unlikely that anyone is using
non utf-8 paths in the real world it is still a non great to deny that.

Rust actually offers the OsString/OsStr types that do not enforce the
utf-8 requirement. And there is also PathBuf/Path types that futher
abstract file paths. So to fix this just use these types instead.

See the added test which checks for it, without this patch we would see
a `error: invalid UTF-8 was detected in one or more arguments` message.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-11-17 14:40:45 +01:00
Paul Holzinger
3aac0a07bf NetworkOptions::load(): do not open /dev/stdin
There is no need to open /dev/stdin, we should just read directly from
fd 0 without having to call open().

Also convert the error inside the function to prevent duplication.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-10-20 13:10:12 +02:00
Matthew Heon
6434e9f982 Rename make_chain to wrap for Go consistency
Also, start fixing tests - there are a lot of error string
comparisons that no longer work due to the strings changing.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2022-05-11 11:26:40 -04:00
Paul Holzinger
e536ce7bb0 test: use regex to validate version
Use a regex in the tests to validate the version.
It will cover all 1... versions.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-02-24 16:45:14 +01:00
Brent Baude
4d8538abb5 bumping to v1.0.1-dev
Signed-off-by: Brent Baude <bbaude@redhat.com>
2022-02-16 13:53:57 -06:00
Matthew Heon
13170e72cb Bump to v1.0.0-dev
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2022-01-27 14:57:59 -05:00
Paul Holzinger
ef9a0359af add version command
Add version command to get the version, commit sha, build time and the
rust target triple.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-01-26 20:40:28 +01:00
Paul Holzinger
1ffe6bd1d0 Add netavark integration tests
Add bats tests for netavark. The test run netavark in completely
separate network namespaces to not leak any information on the host. The
test runs with the iptables driver but also with the firewalld driver
see test/020-firewalld.bats. This is important to cover all firewall
driver code paths.

You can run the tests with `sudo bats test/` or `podman unshare
--rootless-netns bats test/`. Note that the `--rootless-netns` flag is
called `--rootless-cni` for podman < v4.0.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-12-06 18:17:34 +01:00