klient/machine: add tests to machine group ssh handler - #10386
Conversation
503372d to
00367e6
Compare
| }, | ||
| }, | ||
| } | ||
| if _, err := g.Create(createReq); err != nil { |
There was a problem hiding this comment.
first to note: i didnt follow the whole flow. Would creating this with fake host twice cause problems? ie db unique index issues etc
There was a problem hiding this comment.
no, machine ID, is a unique index (id field L38). When we call machine list, the list of machines is sent to the klient which then calls g.Create using simillar CreateRequest.
- If called twice and machine address doesn't change, nothing will happen.
- If called twice and machine address change, new address will be added to this machine (this handles machines with dynamic IPs)
This logic is here to have a machine into which we will be SSH-ing in.
| }, | ||
| machine.Addr{ | ||
| Network: "ip", | ||
| Value: "53.23.123.4", |
There was a problem hiding this comment.
yes, I made it up :)
00367e6 to
97e6d70
Compare
Codecov Report
@@ Coverage Diff @@
## master #10386 +/- ##
==========================================
- Coverage 32.45% 32.41% -0.05%
==========================================
Files 105 105
Lines 12106 12106
==========================================
- Hits 3929 3924 -5
- Misses 7741 7746 +5
Partials 436 436Continue to review full report at Codecov.
|
97e6d70 to
af10398
Compare
This PR contains missing tests for machine SSH handler.
Depends on:
#10383Code coverage: 57.6% of statements
How Has This Been Tested?
Unit tests.
Screenshots (if appropriate):
none
Types of changes