Skip to content

Commit

Permalink
mantle/kola/tests/ignition: add systemd instantiated timer test
Browse files Browse the repository at this point in the history
Related to coreos/ignition#1064
This change will ensire to cover that test case in CI
  • Loading branch information
sohankunkerkar committed Sep 22, 2020
1 parent 890db64 commit fffa52c
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions mantle/kola/tests/ignition/units.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,32 @@ import (

func init() {
register.RegisterTest(&register.Test{
Name: "coreos.ignition.instantiated.enable-service",
Name: "coreos.ignition.instantiated.enable-unit",
Run: enableSystemdInstantiatedService,
ClusterSize: 1,
Tags: []string{"ignition"},
UserDataV3: conf.Ignition(`{
"ignition": {"version": "3.0.0"},
"systemd": {
"units": [{
"name": "echo@.service",
"contents": "[Unit]\nDescription=f\n[Service]\nType=oneshot\nExecStart=/bin/echo %i\nRemainAfterExit=yes\n[Install]\nWantedBy=multi-user.target\n"
},
"name": "echo@.service",
"contents": "[Unit]\nDescription=f\n[Service]\nType=oneshot\nExecStart=/bin/echo %i\nRemainAfterExit=yes\n[Install]\nWantedBy=multi-user.target\n"
},
{
"name": "echo@.timer"
"contents": "[Unit]\nDescription=echo timer template\n[Timer]\nOnUnitInactiveSec=10s\n[Install]\nWantedBy=timers.target",
},
{
"enabled": true,
"name": "echo@bar.service"
},
{
"enabled": true,
"name": "echo@foo.service"
},
{
"enabled": true,
"name": "echo@foo.timer"
}]
}
}`),
Expand All @@ -59,4 +67,6 @@ func enableSystemdInstantiatedService(c cluster.TestCluster) {
c.MustSSH(m, "systemctl -q is-active echo@bar.service")
c.MustSSH(m, "systemctl -q is-enabled echo@foo.service")
c.MustSSH(m, "systemctl -q is-enabled echo@bar.service")
c.MustSSH(m, "systemctl -q is-active echo@foo.timer")
c.MustSSH(m, "systemctl -q is-active echo@foo.timer")
}

0 comments on commit fffa52c

Please sign in to comment.