code: func assertSystemdActiveState(unitName string) error {
  	fetchSystemdActiveState := func() error {
  		us, err := cAPI.UnitState(unitName)
  		if err != nil {
  			return fmt.Errorf("Error getting unit state of %s: %v", unitName, err)
  		}
  
  		// Get systemd state and check the state is active & loaded.
  		if us.SystemdActiveState != "active" || us.SystemdLoadState != "loaded" {
  			return fmt.Errorf("Failed to find an active unit %s", unitName)
  		}
  		return nil
  	}
  
  	timeout, err := waitForState(fetchSystemdActiveState)
  	if err != nil {
  		return fmt.Errorf("Failed to find an active unit %s within %v, err: %v",
  			unitName, timeout, err)
  	}
  
  	return nil
  }
docs: // assertSystemdActiveState determines if a given systemd unit is actually
  // in the active state, making use of cAPI.
  // It repeatedly checks up to defaultSleepTimeout. If ActiveState of the given
  // unit is active and LoadState of the given unit is loaded.
  // If it cannot get the expected states within the period, return error.