-
Notifications
You must be signed in to change notification settings - Fork 345
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
Cloudinit coverage #6123
base: master
Are you sure you want to change the base?
Cloudinit coverage #6123
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6123 +/- ##
==========================================
+ Coverage 68.92% 68.95% +0.02%
==========================================
Files 203 203
Lines 21999 22001 +2
==========================================
+ Hits 15163 15170 +7
+ Misses 6836 6831 -5 ☔ View full report in Codecov by Sentry. |
f268ad6
to
1d9dc9f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @richtja, it's great to see this utility coverage increasing and the same time marking its time to be migrated to autils.
I have a few questions and points that you can answer/address.
Thanks!
def test_phone_home_set_up(self): | ||
sock = socket.socket() | ||
sock.bind((self.ADDRESS, 0)) | ||
port = sock.getsockname()[1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIUC, the purpose of the previous these first 3 lines is to obtain an unused port. Once the next line (sock.close()
) runs, anyone else can grab that port. Is there a reson for not allowing the PhoneHomeServer
to get a port of its own, and then once it's up and running, use the port it actually acquired?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is for obtaining an unused port. The reason I can't get it from PhoneHomeServer
is that this test tests PhoneHomeServer.set_up_and_wait_for_phone_home
which is a class method which doesn't support access to the PhoneHomeServer instance. But maybe I am missing something here.
The username can be only str. Let's update the tests to respect that. Signed-off-by: Jan Richter <[email protected]>
1d9dc9f
to
d8c5e52
Compare
Signed-off-by: Jan Richter <[email protected]>
Since python 3.3 headers are stored to an internal buffer and end_headers() needs to be called explicitly. This can lead to ConnectionError. Reference: https://docs.python.org/3/library/http.server.html#http.server.BaseHTTPRequestHandler.send_response Signed-off-by: Jan Richter <[email protected]>
close server Signed-off-by: Jan Richter <[email protected]>
d8c5e52
to
5436765
Compare
Hi @clebergnu, I updated this PR, based on our discussion. Please take a look. I have kept the unused port obtain since I don't have a better solution, but If you have some idea, I don't mind updating it. |
This is a set of tests for
avocado.utils.cloudinit
utility, with fixes found on the way, to prepare it for migration to Autils and increase its coverage.