functional: add new tests TestUnit{Submit,Load,Start}Replace #20
Closed
dongsupark wants to merge 17 commits intomasterfrom
Closed
functional: add new tests TestUnit{Submit,Load,Start}Replace #20dongsupark wants to merge 17 commits intomasterfrom
dongsupark wants to merge 17 commits intomasterfrom
Conversation
Add isLocalUnitDifferent() and use it to check if the local unit differs from the one in the registry. This function handles both old scenario and the new one attended to replace units.
This is only for development purpose and debugging, all this will be later removed or optimised. Signed-off-by: Djalal Harouni <djalal@endocode.com>
Move MatchUnitFile() to unit package we will use it inside fleetd to check for unit hash matching
Check if the new submited unit is a new version of an already submitted unit.
This is a hack, we will have to improve it later.
This is just for debugging and dev purpose
The interface to create units and set the target state is the same, so to differenciate between those two we check if the units have the same name and the content of the passed unit is really there! if not we assume that the caller wants to set the target state and if it's not the case we also catch that by len(su.DesiredState) == 0 check
Author
|
All right. Jenkins job fails, because one of the new tests occasionally fails after running |
91fc9da to
9afffeb
Compare
Author
|
I fixed bugs in the functional tests. Used |
9afffeb to
b1a716c
Compare
Author
|
Did refactoring for the entire patchset. Functional tests are working well too. |
|
@dongsupark ok just let me know when you add those "submit load and start many units" tests, I'll pull them on top. Thank you! |
b1a716c to
5625e22
Compare
added 3 commits
March 16, 2016 16:57
Add new helpers copyFile(), genNewFleetService() & destroyUnitRetrying() to prepare the new functional tests for the replace options. copyFile() is a helper to copy one file to another. genNewFleetService() is a helper to replace a string with a new one. It's necessary for the next functional tests. destroyUnitRetrying() runs "fleetctl <cmd> --replace" repeatedly to ensure the unit is actually removed.
TestUnit{Submit,Load,Start}Replace() tests whether a command "fleetctl
{submit,load,start} --replace hello.service" works respectively.
As most of the test sequences are identical, the common part is split
into replaceUnitCommon().
For commands fleetctl {submit,load,start}, also test loading multiple
units at the same time, and replacing each of them one after another.
0755571 to
905adf5
Compare
Author
|
Close in favor of coreos#1509 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR depends on #18.
/cc @tixxdz