summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRonny Chevalier <chevalier.ronny@gmail.com>2015-10-30 17:46:32 +0100
committerRonny Chevalier <chevalier.ronny@gmail.com>2015-10-31 15:07:19 +0100
commita622675862ca59cae4662bff21a0c795e0108c65 (patch)
treedd078d151cc14d24de35d9bd6af9e57068238b66
parentc388dfea5a9de5771283fbf0f5ebc5a45c895b79 (diff)
test-execute: add tests for IOSchedulingClass
-rw-r--r--Makefile.am4
-rw-r--r--src/test/test-execute.c8
-rw-r--r--test/exec-ioschedulingclass-best-effort.service7
-rw-r--r--test/exec-ioschedulingclass-idle.service7
-rw-r--r--test/exec-ioschedulingclass-none.service7
-rw-r--r--test/exec-ioschedulingclass-realtime.service7
6 files changed, 40 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index e2e3bca340..3d211deefc 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1570,6 +1570,10 @@ EXTRA_DIST += \
test/exec-environmentfile.service \
test/exec-oomscoreadjust-positive.service \
test/exec-oomscoreadjust-negative.service \
+ test/exec-ioschedulingclass-best-effort.service \
+ test/exec-ioschedulingclass-idle.service \
+ test/exec-ioschedulingclass-none.service \
+ test/exec-ioschedulingclass-realtime.service \
test/bus-policy/hello.conf \
test/bus-policy/methods.conf \
test/bus-policy/ownerships.conf \
diff --git a/src/test/test-execute.c b/src/test/test-execute.c
index d708878a4d..158626f715 100644
--- a/src/test/test-execute.c
+++ b/src/test/test-execute.c
@@ -216,6 +216,13 @@ static void test_exec_oomscoreadjust(Manager *m) {
test(m, "exec-oomscoreadjust-negative.service", 0, CLD_EXITED);
}
+static void test_exec_ioschedulingclass(Manager *m) {
+ test(m, "exec-ioschedulingclass-none.service", 0, CLD_EXITED);
+ test(m, "exec-ioschedulingclass-idle.service", 0, CLD_EXITED);
+ test(m, "exec-ioschedulingclass-realtime.service", 0, CLD_EXITED);
+ test(m, "exec-ioschedulingclass-best-effort.service", 0, CLD_EXITED);
+}
+
int main(int argc, char *argv[]) {
test_function_t tests[] = {
test_exec_workingdirectory,
@@ -234,6 +241,7 @@ int main(int argc, char *argv[]) {
test_exec_runtimedirectory,
test_exec_capabilityboundingset,
test_exec_oomscoreadjust,
+ test_exec_ioschedulingclass,
NULL,
};
test_function_t *test = NULL;
diff --git a/test/exec-ioschedulingclass-best-effort.service b/test/exec-ioschedulingclass-best-effort.service
new file mode 100644
index 0000000000..56e2718505
--- /dev/null
+++ b/test/exec-ioschedulingclass-best-effort.service
@@ -0,0 +1,7 @@
+[Unit]
+Description=Test for IOSchedulingClass=best-effort
+
+[Service]
+ExecStart=/bin/bash -c 'c=$(ionice); echo $c; [[ "$c" == best-effort* ]]'
+Type=oneshot
+IOSchedulingClass=best-effort
diff --git a/test/exec-ioschedulingclass-idle.service b/test/exec-ioschedulingclass-idle.service
new file mode 100644
index 0000000000..b45795cab7
--- /dev/null
+++ b/test/exec-ioschedulingclass-idle.service
@@ -0,0 +1,7 @@
+[Unit]
+Description=Test for IOSchedulingClass=idle
+
+[Service]
+ExecStart=/bin/bash -c 'c=$(ionice); echo $c; [[ "$c" == idle* ]]'
+Type=oneshot
+IOSchedulingClass=idle
diff --git a/test/exec-ioschedulingclass-none.service b/test/exec-ioschedulingclass-none.service
new file mode 100644
index 0000000000..36b546ca01
--- /dev/null
+++ b/test/exec-ioschedulingclass-none.service
@@ -0,0 +1,7 @@
+[Unit]
+Description=Test for IOSchedulingClass=none
+
+[Service]
+ExecStart=/bin/bash -c 'c=$(ionice); echo $c; [[ "$c" == none* ]]'
+Type=oneshot
+IOSchedulingClass=none
diff --git a/test/exec-ioschedulingclass-realtime.service b/test/exec-ioschedulingclass-realtime.service
new file mode 100644
index 0000000000..74936d8079
--- /dev/null
+++ b/test/exec-ioschedulingclass-realtime.service
@@ -0,0 +1,7 @@
+[Unit]
+Description=Test for IOSchedulingClass=realtime
+
+[Service]
+ExecStart=/bin/bash -c 'c=$(ionice); echo $c; [[ "$c" == realtime* ]]'
+Type=oneshot
+IOSchedulingClass=realtime