Skip to content

Commit

Permalink
remove the systemd unit and call the script through systemd-run
Browse files Browse the repository at this point in the history
  • Loading branch information
jbtrystram committed Jan 15, 2025
1 parent a4c18e3 commit 631a0b7
Showing 1 changed file with 5 additions and 19 deletions.
24 changes: 5 additions & 19 deletions mantle/kola/tests/ostree/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,19 +173,7 @@ storage:
sleep 0.5; \
done; \
done) &
done
systemd:
units:
- name: write-to-nfs.service
enabled: false
contents: |
[Unit]
ConditionFirstBoot=true
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/local/bin/nfs-random-write.sh
Restart=on-failure`)
done`)
opts := platform.MachineOptions{
MinMemory: 2048,
}
Expand Down Expand Up @@ -225,9 +213,10 @@ systemd:
func doSyncTest(c cluster.TestCluster, client platform.Machine) {
c.RunCmdSync(client, "sudo touch /var/tmp/data3/test")
// Continue write
_, err := c.SSH(client, `sudo systemctl enable --now write-to-nfs.service`)
//_, err := c.SSH(client, `sudo systemctl enable --now write-to-nfs.service`)
_, err := c.SSH(client, "sudo systemd-run sh -c '/usr/local/bin/nfs-random-write.sh'")
if err != nil {
c.Fatalf("failed to start service: %v", err)
c.Fatalf("failed to start write-to-nfs: %v", err)
}

// Create a stage deploy using kargs while writing
Expand All @@ -241,10 +230,7 @@ func doSyncTest(c cluster.TestCluster, client platform.Machine) {
c.Log("Set link down and rebooting.")
// Skip the error check as it is expected
cmd := fmt.Sprintf("sudo systemd-run sh -c 'ip link set %s down && sleep 5 && systemctl reboot'", netdevice)
_, err = c.SSH(client, cmd)
if err != nil {
c.Fatalf("failed to set down link and reboot: %v", err)
}
_, _ = c.SSH(client, cmd)

err = util.Retry(8, 10*time.Second, func() error {
// Look for the kernel argument test=1
Expand Down

0 comments on commit 631a0b7

Please sign in to comment.