Skip to content
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

[qemu] ensure dnsmasq.hosts exists #2099

Merged
merged 4 commits into from
May 18, 2021
Merged

[qemu] ensure dnsmasq.hosts exists #2099

merged 4 commits into from
May 18, 2021

Conversation

surahman
Copy link
Contributor

@surahman surahman commented May 9, 2021

With respect to issue #1118:
Added a check on DNSMasq bootstrapping for dnsmasq.hosts file in the constructor. If absent, an empty file will be created in the data_dir.

Copy link
Contributor

@townsend2010 townsend2010 left a comment

Choose a reason for hiding this comment

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

Hi @surahman!

Thanks for this! I have a couple of inline niggles and I would also like to ask you to add a test under tests/qemu/test_dnsmasq_server.cpp please.

src/platform/backends/qemu/dnsmasq_server.cpp Outdated Show resolved Hide resolved
src/platform/backends/qemu/dnsmasq_server.cpp Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented May 10, 2021

Codecov Report

Merging #2099 (1b61b12) into main (981cf15) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2099   +/-   ##
=======================================
  Coverage   81.48%   81.48%           
=======================================
  Files         184      184           
  Lines        9456     9459    +3     
=======================================
+ Hits         7705     7708    +3     
  Misses       1751     1751           
Impacted Files Coverage Δ
src/platform/backends/qemu/dnsmasq_server.cpp 93.82% <100.00%> (+0.23%) ⬆️

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 981cf15...1b61b12. Read the comment docs.

@Saviq Saviq changed the title Issue #1118 [qemu] ensure dnsmasq.hosts existing May 10, 2021
@Saviq Saviq marked this pull request as draft May 10, 2021 14:12
@Saviq Saviq marked this pull request as ready for review May 10, 2021 14:12
@Saviq
Copy link
Collaborator

Saviq commented May 10, 2021

Will reopen to kick the CLA check.

@Saviq Saviq closed this May 10, 2021
@Saviq Saviq reopened this May 10, 2021
@townsend2010 townsend2010 changed the title [qemu] ensure dnsmasq.hosts existing [qemu] ensure dnsmasq.hosts exists May 10, 2021
@Saviq
Copy link
Collaborator

Saviq commented May 10, 2021

@surahman hey, would you please --reset-author on your commits to include your e-mail address? We need to connect that to your CLA signature.

@surahman
Copy link
Contributor Author

surahman commented May 10, 2021

@Saviq sorry about that, privacy settings on Github were complaining about email address exposure before.

@Saviq
Copy link
Collaborator

Saviq commented May 10, 2021

@surahman the gitignore commit still has the - email. But please remove that commit anyway :)

@surahman
Copy link
Contributor Author

@Saviq I am hoping that has corrected the issue...

@Saviq
Copy link
Collaborator

Saviq commented May 10, 2021

@surahman it did, thanks! Now we just need you to actually go through the process of signing it: :)

https://ubuntu.com/legal/contributors/agreement

@surahman
Copy link
Contributor Author

@Saviq sorry I thought I already had - I just filled it out again.

@Saviq
Copy link
Collaborator

Saviq commented May 10, 2021

@Saviq sorry I thought I already had - I just filled it out again.

Thanks, maybe it didn't go through our legal wheels… Now I know you did, I'll follow up our side.

Thanks a bunch, again, for your help!

@townsend2010
Copy link
Contributor

bors try

bors bot added a commit that referenced this pull request May 17, 2021
@bors
Copy link
Contributor

bors bot commented May 17, 2021

try

Build failed:

@townsend2010
Copy link
Contributor

Ok, all we're missing a simple little test to ensure the dnsmasq.hosts file does indeed exist. I see the codecov reports the line being covered, but I think an explicit test would be beneficial.

@surahman
Copy link
Contributor Author

I have added a quick test. Is there anything I need to do to fix the CI issue?
mkdir: cannot create directory '/etc/systemd/system': File exists

@townsend2010
Copy link
Contributor

Thanks!

Is there anything I need to do to fix the CI issue?

I'll for this CI run to complete and then look at the error, if there is one.

@townsend2010
Copy link
Contributor

Looks like CI passed fine with your added test. I'm not sure where you saw that failure before though.

Copy link
Contributor

@townsend2010 townsend2010 left a comment

Choose a reason for hiding this comment

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

Ok, this looks good. Thanks!

bors merge

bors bot added a commit that referenced this pull request May 17, 2021
2094: [network] Better handle network caching r=luis4a0 a=townsend2010

This better handles trying to get cached network data if the network is unreachable.
Also adds unit testing to URLDownloader.

2099: [qemu] ensure `dnsmasq.hosts` exists r=townsend2010 a=surahman

**_With respect to issue #1118:_**
Added a check on `DNSMasq` bootstrapping for `dnsmasq.hosts` file in the constructor. If absent, an empty file will be created in the `data_dir`.

Co-authored-by: Chris Townsend <christopher.townsend@canonical.com>
Co-authored-by: Saad Ur Rahman <saad.ur.rahman@gmail.com>
@bors
Copy link
Contributor

bors bot commented May 17, 2021

Build failed (retrying...):

bors bot added a commit that referenced this pull request May 17, 2021
2099: [qemu] ensure `dnsmasq.hosts` exists r=townsend2010 a=surahman

**_With respect to issue #1118:_**
Added a check on `DNSMasq` bootstrapping for `dnsmasq.hosts` file in the constructor. If absent, an empty file will be created in the `data_dir`.

2101: Fix eclipsing vms in ctor r=townsend2010 a=ricab

Let exceptions that arise when creating a VM in the daemon constructor through. This avoids erasing instance data that could be recoverable and important for the user, but aborts the daemon since it can't honor its database, which would otherwise be out of sync. More robust approaches for particular causes can always added. Fixes #1658.

Co-authored-by: Saad Ur Rahman <saad.ur.rahman@gmail.com>
Co-authored-by: Ricardo Abreu <ricardo.abreu@canonical.com>
@bors
Copy link
Contributor

bors bot commented May 17, 2021

Build failed (retrying...):

bors bot added a commit that referenced this pull request May 17, 2021
2099: [qemu] ensure `dnsmasq.hosts` exists r=townsend2010 a=surahman

**_With respect to issue #1118:_**
Added a check on `DNSMasq` bootstrapping for `dnsmasq.hosts` file in the constructor. If absent, an empty file will be created in the `data_dir`.

Co-authored-by: Saad Ur Rahman <saad.ur.rahman@gmail.com>
@bors
Copy link
Contributor

bors bot commented May 17, 2021

Build failed:

@Saviq
Copy link
Collaborator

Saviq commented May 17, 2021

Sorry @surahman, we're having some reliability issues with a couple tests in CI…

bors retry

bors bot added a commit that referenced this pull request May 17, 2021
2099: [qemu] ensure `dnsmasq.hosts` exists r=townsend2010 a=surahman

**_With respect to issue #1118:_**
Added a check on `DNSMasq` bootstrapping for `dnsmasq.hosts` file in the constructor. If absent, an empty file will be created in the `data_dir`.

Co-authored-by: Saad Ur Rahman <saad.ur.rahman@gmail.com>
@surahman
Copy link
Contributor Author

@Saviq no worries, it is interesting to see the workflow :)

@bors
Copy link
Contributor

bors bot commented May 17, 2021

Build failed:

@Saviq
Copy link
Collaborator

Saviq commented May 18, 2021

bors retry

bors bot added a commit that referenced this pull request May 18, 2021
2099: [qemu] ensure `dnsmasq.hosts` exists r=townsend2010 a=surahman

**_With respect to issue #1118:_**
Added a check on `DNSMasq` bootstrapping for `dnsmasq.hosts` file in the constructor. If absent, an empty file will be created in the `data_dir`.

2101: Fix eclipsing vms in ctor r=townsend2010 a=ricab

Let exceptions that arise when creating a VM in the daemon constructor through. This avoids erasing instance data that could be recoverable and important for the user, but aborts the daemon since it can't honor its database, which would otherwise be out of sync. More robust approaches for particular causes can always added. Fixes #1658.

Co-authored-by: Saad Ur Rahman <saad.ur.rahman@gmail.com>
Co-authored-by: Ricardo Abreu <ricardo.abreu@canonical.com>
@bors
Copy link
Contributor

bors bot commented May 18, 2021

Build failed (retrying...):

@bors
Copy link
Contributor

bors bot commented May 18, 2021

@bors bors bot merged commit d4458ab into canonical:main May 18, 2021
@Saviq Saviq linked an issue Jun 23, 2021 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

error message during boot about dnsmasq.host
3 participants