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

functional: support testing multiple units #1552

Closed

Conversation

dongsupark
Copy link
Contributor

Make TestUnit{Submit,Load,Start}() capable of testing multiple units. After launching multiple units for activation, they become deactivated via correspondent commands: "submit" and "destroy", "load" and "unload", "start" and "stop" are coupled respectively. These are based on a common function doMultipleUnitsCmd() to be used by different tests.

This PR depends on #1544.

Dongsu Park added 9 commits April 14, 2016 12:09
In addition to the existing UnitState, define UnitFileState to parse
output of fleetctl list-unit-files, as well as its parse function
ParseUnitFileStates(). The existing ParseUnitStates() parses Name,
State, and Machine, including specific handling of machine strings.
In contrast, ParseUnitFileStates() simply parses 3 fields: Name,
DesiredState, and State.
…Files

WaitForNUnits() runs fleetctl list-units to get a map of []UnitState
(unit, active, machine). This operation should be called after fleetctl
load or start.

WaitForNUnitFiles() runs fleetctl list-unit-files to get a map of
[]UnitFileState (unit, desiredstate, state). This operation should be
called after fleetctl submit.
A new functional test TestUnitCat simply tests if "fleetctl cat" works.
TestUnitStatus simply checks if "fleetctl status hello.service" works.
Improve TestUnitSubmit() like the following:
* use list-unit-files instead of list-units, to correctly verify
  submitted units.
* check that the output of list-unit-files contains the correct
  unit name, with help of a new helper cluster.WaitForNUnitFiles.
  That way the whole functional test could become less racy.
A new test TestUnitLoad verifies that "fleetctl {load,unload}"
correctly works: load -> list-units -> unload -> list-units -> load
Make testUnitSubmit() capable of testing submission of multiple units.
It processes multiple units with different names, and verify that they
are submitted. After redestroying all submitted units, it checks for
every unit being completely removed, making use of cluster operations.
These are implemented in doMultipleUnitsCmd() to be used for further
tests like TestUnitLoad or TestUnitStart.
Make TestUnitLoad depend on doMulitpleUnitsCmd() to reuse common
code parts. Also make the test load & unload multiple units.
Rename TestUnitRestart to TestUnitStart for consistency with other ones.
Make TestUnitStart depend on doMulitpleUnitsCmd() to reuse common
code parts. Also make the test start & stop multiple units.
@dongsupark
Copy link
Contributor Author

Oops, a wrong branch name. Closed #1552 in favor of #1553.

@dongsupark dongsupark closed this Apr 15, 2016
@dongsupark dongsupark deleted the fleetctl-multiple-units-fxtests branch April 15, 2016 12:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant