-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Labels
Milestone
Description
This seems like a recent regression (in rc95 maybe).
Test case:
func TestUnitExistsIgnored(t *testing.T) {
if !IsRunningSystemd() {
t.Skip("Test requires systemd.")
}
if os.Geteuid() != 0 {
t.Skip("Test requires root.")
}
podConfig := &configs.Cgroup{
Parent: "system.slice",
Name: "system-runc_test_exists.slice",
}
pm := newManager(podConfig)
defer pm.Destroy() //nolint:errcheck
// create twice to make sure "UnitExists" error is ignored.
for i := 0; i < 2; i++ {
if err := pm.Apply(-1); err != nil {
t.Fatal(err)
}
}
}fails on my system with:
[kir@kir-rhat systemd]$ sudo ./systemd.test -test.v -test.run Exis
=== RUN TestUnitExistsIgnored
systemd_test.go:192: error while starting unit "system-runc_test_exists.slice" with properties [{Name:Description Value:"libcontainer container system-runc_test_exists.slice"} {Name:Wants Value:["system.slice"]} {Name:MemoryAccounting Value:true} {Name:CPUAccounting Value:true} {Name:IOAccounting Value:true} {Name:TasksAccounting Value:true} {Name:DefaultDependencies Value:false}]: Unit system-runc_test_exists.slice already exists.
--- FAIL: TestUnitExistsIgnored (0.04s)
FAILReactions are currently unavailable