aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/test-unit/test-unit.c
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2019-12-03 15:02:57 +0100
committerJosé Bollo <jose.bollo@iot.bzh>2019-12-03 18:37:21 +0100
commit6008a3ec4d1c0ed5df338b7c5f0775585ab51cfb (patch)
tree1ac16f60d411822d149a77379faec0bdd8851d0d /src/tests/test-unit/test-unit.c
parent50ab763bc31cb9e32bcb7e08e1f2be502fc50a5f (diff)
Enforce numeric application IDs
This change allows to index applications numerically. This can be used for various purposes. One of it is to compute the HTTP port. Bug-AGL: SPEC-2968 Change-Id: I74531781f3a39d5d4b09eeb907f57f36822e38f0 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/tests/test-unit/test-unit.c')
-rw-r--r--src/tests/test-unit/test-unit.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/tests/test-unit/test-unit.c b/src/tests/test-unit/test-unit.c
index 590907d..a879a12 100644
--- a/src/tests/test-unit/test-unit.c
+++ b/src/tests/test-unit/test-unit.c
@@ -65,9 +65,9 @@ puts(json_object_to_json_string_ext(desc->desc, JSON_C_TO_STRING_PRETTY));
return 0;
}
-static int port()
+static int new_afid()
{
- static int r = 10000;
+ static int r = 1;
return r++;
}
@@ -79,7 +79,8 @@ int main(int ac, char **av)
conf.installdir = "INSTALL-DIR";
conf.icondir = "ICONS-DIR";
- conf.port = port;
+ conf.new_afid = new_afid;
+ conf.base_http_ports = 20000;
rc = unit_generator_open_template(*++av);
if (rc < 0)
error("can't read template %s: %m",*av);