summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-11-12 11:49:40 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-11-12 11:52:22 +0100
commit642f41a4ecccf234abe92b7e3a4a14fd8707b2c1 (patch)
treeffa699b41206962d6d95ebf6c5a49abe7cc1f5f4 /src/test
parentc86ebcf3894cc831b19fe1ea5f2abef3c6662829 (diff)
downloadsystemd-642f41a4ecccf234abe92b7e3a4a14fd8707b2c1.tar.gz
systemd-642f41a4ecccf234abe92b7e3a4a14fd8707b2c1.tar.bz2
systemd-642f41a4ecccf234abe92b7e3a4a14fd8707b2c1.zip
test-unit-name: check that unexpanded specifiers not valid unit name make
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test-unit-name.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/test/test-unit-name.c b/src/test/test-unit-name.c
index 24436cab0b..986fcbb1af 100644
--- a/src/test/test-unit-name.c
+++ b/src/test/test-unit-name.c
@@ -73,6 +73,12 @@ static void test_unit_name_is_valid(void) {
test_unit_name_is_valid_one("user@1000.slice", UNIT_NAME_ANY, true);
test_unit_name_is_valid_one("user@1000.slice", UNIT_NAME_INSTANCE, true);
test_unit_name_is_valid_one("user@1000.slice", UNIT_NAME_TEMPLATE, false);
+
+ test_unit_name_is_valid_one("foo@%i.service", UNIT_NAME_ANY, false);
+ test_unit_name_is_valid_one("foo@%i.service", UNIT_NAME_INSTANCE, false);
+ 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);
}
static void test_unit_name_replace_instance_one(const char *pattern, const char *repl, const char *expected, int ret) {