diff options
author | Julia Kartseva <hex@fb.com> | 2021-06-15 04:14:14 +0200 |
---|---|---|
committer | Julia Kartseva <hex@fb.com> | 2021-06-30 09:36:33 +0200 |
commit | 5587ce7f6ca83b5ae08ad2a73a2b96392b261e9a (patch) | |
tree | f1d03b4d7331c83f3fbbb462cf8aa466bf2e8fb3 /src/test | |
parent | shared: add parser for SocketBind{Allow|Deny}= (diff) | |
download | systemd-5587ce7f6ca83b5ae08ad2a73a2b96392b261e9a.tar.xz systemd-5587ce7f6ca83b5ae08ad2a73a2b96392b261e9a.zip |
fragment: add ip protocol to SocketBind{Allow|Deny}=
Add ip protocol token to SocketBind{Allow|Deny}= property parser.
Use parse_socket_bind_item helper.
Replace int32_t with int in cgroup item for socket-bind as it was
requested in [0].
Update tests.
[0] https://github.com/systemd/systemd/pull/19942#discussion_r652150024
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/test-socket-bind.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/test/test-socket-bind.c b/src/test/test-socket-bind.c index 996aeebbcc..989172eee3 100644 --- a/src/test/test-socket-bind.c +++ b/src/test/test-socket-bind.c @@ -146,6 +146,11 @@ int main(int argc, char *argv[]) { assert_se(test_socket_bind(m, "socket_bind_test.service", netcat_path, "6666", STRV_MAKE("6667", "6668", ""), STRV_MAKE("any")) >= 0); assert_se(test_socket_bind(m, "socket_bind_test.service", netcat_path, "7777", STRV_MAKE_EMPTY, STRV_MAKE_EMPTY) >= 0); assert_se(test_socket_bind(m, "socket_bind_test.service", netcat_path, "8888", STRV_MAKE("any"), STRV_MAKE("any")) >= 0); + assert_se(test_socket_bind(m, "socket_bind_test.service", netcat_path, "8888", STRV_MAKE("ipv6:tcp:8888-8889"), STRV_MAKE("any")) >= 0); + assert_se(test_socket_bind(m, "socket_bind_test.service", netcat_path, "10000", STRV_MAKE("ipv6:udp:9999-10000"), STRV_MAKE("any")) >= 0); + assert_se(test_socket_bind(m, "socket_bind_test.service", netcat_path, "6666", STRV_MAKE("ipv4:tcp:6666"), STRV_MAKE("any")) >= 0); + assert_se(test_socket_bind(m, "socket_bind_test.service", netcat_path, "6666", STRV_MAKE("ipv4:udp:6666"), STRV_MAKE("any")) >= 0); + assert_se(test_socket_bind(m, "socket_bind_test.service", netcat_path, "6666", STRV_MAKE("tcp:6666"), STRV_MAKE("any")) >= 0); return 0; } |