Skip to content
This repository was archived by the owner on Aug 15, 2022. It is now read-only.

klient/machine: add tests to machine group ssh handler - #10386

Merged
ppknap merged 3 commits into
masterfrom
machine_ssh_tests
Feb 1, 2017
Merged

klient/machine: add tests to machine group ssh handler#10386
ppknap merged 3 commits into
masterfrom
machine_ssh_tests

Conversation

@ppknap

@ppknap ppknap commented Jan 23, 2017

Copy link
Copy Markdown
Contributor

This PR contains missing tests for machine SSH handler.

Depends on: #10383

Code coverage: 57.6% of statements

How Has This Been Tested?

Unit tests.

Screenshots (if appropriate):

none

Types of changes

  • New feature (non-breaking change which adds functionality)

},
},
}
if _, err := g.Create(createReq); err != nil {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

first to note: i didnt follow the whole flow. Would creating this with fake host twice cause problems? ie db unique index issues etc

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this a fake IP?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I made it up :)

@ppknap
ppknap force-pushed the machine_ssh_tests branch from 00367e6 to 97e6d70 Compare January 29, 2017 22:59
@codecov-io

codecov-io commented Jan 29, 2017

Copy link
Copy Markdown

Codecov Report

Merging #10386 into master will increase coverage by -0.05%.

@@            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      436

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c23b5f4...af10398. Read the comment docs.

@ppknap
ppknap merged commit e463cd2 into master Feb 1, 2017
@rjeczalik
rjeczalik deleted the machine_ssh_tests branch February 1, 2017 14:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants