-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
functional: add new tests TestUnit{Submit,Load,Start}Replace #20
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
All right. Jenkins job fails, because one of the new tests occasionally fails after running |
91fc9da
to
9afffeb
Compare
I fixed bugs in the functional tests. Used |
9afffeb
to
b1a716c
Compare
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
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
Close in favor of coreos#1509 |
This PR depends on #18.
/cc @tixxdz