diff --git a/test/units/testsuite-56-testbloat.service b/test/units/testsuite-56-testbloat.service new file mode 100644 index 0000000000..40cf5a9f36 --- /dev/null +++ b/test/units/testsuite-56-testbloat.service @@ -0,0 +1,9 @@ +[Unit] +Description=Create a lot of memory pressure + +[Service] +# A very small memory.high will cause the script (trying to use a lot of memory) +# to throttle and be put under heavy pressure +MemoryHigh=2M +Slice=testsuite-56-workload.slice +ExecStart=/usr/lib/systemd/tests/testdata/units/testsuite-56-slowgrowth.sh diff --git a/test/units/testsuite-56-testchill.service b/test/units/testsuite-56-testchill.service new file mode 100644 index 0000000000..6cae3d852a --- /dev/null +++ b/test/units/testsuite-56-testchill.service @@ -0,0 +1,6 @@ +[Unit] +Description=No memory pressure + +[Service] +Slice=testsuite-56-workload.slice +ExecStart=sleep infinity diff --git a/test/units/testsuite-56-workload.slice b/test/units/testsuite-56-workload.slice new file mode 100644 index 0000000000..3d542ec2ba --- /dev/null +++ b/test/units/testsuite-56-workload.slice @@ -0,0 +1,10 @@ +[Unit] +Description=Test slice for memory pressure kills + +[Slice] +CPUAccounting=true +MemoryAccounting=true +IOAccounting=true +TasksAccounting=true +ManagedOOMMemoryPressure=kill +ManagedOOMMemoryPressureLimitPercent=50% diff --git a/test/units/testsuite-56.sh b/test/units/testsuite-56.sh index 5be6658972..37d62d943c 100755 --- a/test/units/testsuite-56.sh +++ b/test/units/testsuite-56.sh @@ -14,54 +14,26 @@ if [[ "$cgroup_type" != *"cgroup2"* ]] && [[ "$cgroup_type" != *"0x63677270"* ]] fi [[ -e /skipped ]] && exit 0 || true -cat > /etc/systemd/system/testworkload.slice < /etc/systemd/system/testbloat.service < /etc/systemd/system/testchill.service <