Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
functional: check systemd state of the started units
Browse files Browse the repository at this point in the history
To cover the case of a new change for making sure that started units
have active systemd states, CheckListUnits should also check the systemd
unit state, after having started each unit.
  • Loading branch information
Dongsu Park committed May 9, 2016
1 parent de07f4a commit 6efb318
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions functional/unit_action_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,18 @@ func checkListUnits(cl platform.Cluster, m platform.Member, cmd string, ufs []st
if lenLists != nu || !found {
return fmt.Errorf("Expected %s to be unit file", ufs[i])
}

if cmd == "start" {
// Check expected systemd state after starting units
stdout, _ := cl.MemberCommand(m, "systemctl", "show", "--property=ActiveState", ufs[i])
if strings.TrimSpace(stdout) != "ActiveState=active" {
return fmt.Errorf("Fleet unit not reported as active: %s", stdout)
}
stdout, _ = cl.MemberCommand(m, "systemctl", "show", "--property=Result", ufs[i])
if strings.TrimSpace(stdout) != "Result=success" {
return fmt.Errorf("Result for fleet unit not reported as success: %s", stdout)
}
}
}
return err
}
Expand Down

0 comments on commit 6efb318

Please sign in to comment.