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

Sets DHCLIENT_SET_HOSTNAME based on linuxrc or from the control file (bsc#1054933) #564

Merged
merged 6 commits into from
Sep 27, 2017

Conversation

teclator
Copy link
Contributor

@teclator teclator commented Sep 25, 2017

Basically, it sets the DHCLIENT_SET_HOSTNAME in /etc/sysconfig/network/dhcp based on linuxrc cmdline sethostname option if provided or obtains the default from the control file if not.

https://github.com/yast/skelcd-control-SLES/blob/master/control/control.SLES.xml#L21

Screenshot after inst_setup_dhcp client (just after wellcome screen)

screenshot_testing_2017-09-25_11 08 43

Screenshot after manual installation without special linuxrc cmdline options

screenshot_testing_2017-09-25_11 39 50

CaaSP 2.0 Manual Network config

manualconfig

screenshot

Notes and tricks

The libvirt network config used for the host:

      <host mac='dc:e4:cc:27:94:c2' name='teclator.suse.com' ip='192.168.122.60'/>

The tests have been done with a modified CaaSP iso with last linuxrc modification and also modified with a DUD containing this code.

mksusecd --initrd initrd --create /home/knut/isos/SUSE-CaaS-Platform-2.0-DVD-x86_64-Linuxrc.iso /home/knut/isos/SUSE-CaaS-Platform-2.0-DVD-x86_64-Build0071-Media1.iso
mksusecd --initrd network.dud --create /home/knut/isos/SUSE-CaaS-Platform-2.0-DVD-x86_64-dud.iso /home/knut/isos/SUSE-CaaS-Platform-2.0-DVD-x86_64-Linuxrc.iso

Replace widget instead of just the Items to show the complete interface name

fit_selector

@coveralls
Copy link

Coverage Status

Coverage increased (+0.05%) to 30.048% when pulling 672c8ff on teclator:dhcp_hostname into 42addbd on yast:SLE-12-SP3.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 30.097% when pulling 85791cd on teclator:dhcp_hostname into 42addbd on yast:SLE-12-SP3.

@teclator teclator changed the title [WIP] Load dhcp_set_hostname default from the control file (bsc#1054933) Load dhcp_set_hostname default from the control file (bsc#1054933) Sep 26, 2017
@teclator teclator changed the title Load dhcp_set_hostname default from the control file (bsc#1054933) Sets DHCLIENT_SET_HOSTNAME based on linuxrc or from the control file (bsc#1054933) Sep 26, 2017
@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 30.097% when pulling fc2df1b on teclator:dhcp_hostname into 42addbd on yast:SLE-12-SP3.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 30.097% when pulling 3d58a33 on teclator:dhcp_hostname into 42addbd on yast:SLE-12-SP3.

@@ -1,4 +1,14 @@
-------------------------------------------------------------------
Tue Sep 26 12:44:47 UTC 2017 - knut.anderssen@suse.com

- Preloads the global DHCLIENT_SET_HOSTNAME option based on linuxrc
Copy link
Contributor

Choose a reason for hiding this comment

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

"Preload" (same verbe tense than "Do not override").

@@ -5,8 +5,15 @@ class SetupDhcp
include Singleton
include Logger

def initialize
Yast.import "Linuxrc"
Copy link
Contributor

Choose a reason for hiding this comment

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

I usually move Yast.import to the same place than require calls.

@@ -17,5 +24,39 @@ def main
# warning: possibly useless use of a literal in void context
:next
end

# Check if set of DHCLIENT_SET_HOSTNAME in /etc/sysconfig/network/dhcp has
# been disable by linuxrc cmdline
Copy link
Contributor

Choose a reason for hiding this comment

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

NP: @return [Boolean]

before do
allow(Yast::NetworkInterfaces).to receive(:adapt_old_config!)
end
let(:subject) { Yast::SetupDhcp.instance }
Copy link
Contributor

Choose a reason for hiding this comment

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

Please, use subject instead of let(:subject)

end

describe "set_dhcp_hostname?" do
let(:set_hostname) { "1" }
Copy link
Contributor

Choose a reason for hiding this comment

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

NP: you could move this to context where it applies, to make it clearer.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.09%) to 30.09% when pulling 7e3af6f on teclator:dhcp_hostname into 42addbd on yast:SLE-12-SP3.

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.

None yet

3 participants