diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-12-19 17:13:48 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-12-19 20:57:27 +0100 |
commit | f9ef25a483ed976dd4248c5ddf1f3c052f3ebcba (patch) | |
tree | 61dc241d53f7e6e53f18504af621b777eef7e7ab /src/test/test-unit-name.c | |
parent | shared/install: split out alias verification function (diff) | |
download | systemd-f9ef25a483ed976dd4248c5ddf1f3c052f3ebcba.tar.xz systemd-f9ef25a483ed976dd4248c5ddf1f3c052f3ebcba.zip |
basic/unit-name: make sure UnitNameFlags is signed
Without that, a check like unit_name_to_instance(...) < 0 would not
have the expected effect.
Diffstat (limited to 'src/test/test-unit-name.c')
-rw-r--r-- | src/test/test-unit-name.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/test/test-unit-name.c b/src/test/test-unit-name.c index 5d18711a5e..6e294c72d6 100644 --- a/src/test/test-unit-name.c +++ b/src/test/test-unit-name.c @@ -78,6 +78,10 @@ static void test_unit_name_is_valid(void) { test_unit_name_is_valid_one("foo@%%i.service", UNIT_NAME_INSTANCE, false); test_unit_name_is_valid_one("foo@%%i%f.service", UNIT_NAME_INSTANCE, false); test_unit_name_is_valid_one("foo@%F.service", UNIT_NAME_INSTANCE, false); + + test_unit_name_is_valid_one("foo.target.wants/plain.service", UNIT_NAME_ANY, false); + test_unit_name_is_valid_one("foo.target.conf/foo.conf", UNIT_NAME_ANY, false); + test_unit_name_is_valid_one("foo.target.requires/plain.socket", UNIT_NAME_ANY, false); } static void test_unit_name_replace_instance_one(const char *pattern, const char *repl, const char *expected, int ret) { |