Skip to content

Commit

Permalink
Merge pull request #165 from yast/dhcpcd-test-iz-ded
Browse files Browse the repository at this point in the history
Use wickedd-dhcp{6,4} for DHCP test (bnc#866617)
  • Loading branch information
mvidner committed Mar 4, 2014
2 parents 9bc9230 + 96ecb29 commit 180aabb
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
7 changes: 7 additions & 0 deletions package/yast2-network.changes
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Tue Mar 4 16:24:22 UTC 2014 - mvidner@suse.com

- Use wickedd-dhcp{6,4} instead of (dropped) dhcpcd-test when
setting up DHCP interfaces (bnc#866617)
- 3.1.30

-------------------------------------------------------------------
Fri Feb 28 15:30:41 UTC 2014 - jreidinger@suse.com

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-network.spec
Expand Up @@ -17,7 +17,7 @@


Name: yast2-network
Version: 3.1.29
Version: 3.1.30
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
7 changes: 6 additions & 1 deletion src/clients/inst_setup_dhcp.rb
Expand Up @@ -6,6 +6,7 @@ module SetupDHCPClient
include Yast

BASH_PATH = Path.new(".target.bash")
WICKED_BIN_DIR = "/usr/lib/wicked/bin"

def self.network_cards
LanItems.Read
Expand Down Expand Up @@ -36,8 +37,12 @@ def self.setup_dhcp card
LanItems.Commit
end

def self.get_lease_ipvx?(v, card)
SCR.Execute(BASH_PATH, "#{WICKED_BIN_DIR}/wickedd-dhcp#{v} --test '#{card}' | grep ^IPADDR") == 0
end

def self.get_lease?(card)
SCR.Execute(BASH_PATH, "dhcpcd-test '#{card}'") == 0
get_lease_ipvx?(6, card) || get_lease_ipvx?(4, card)
end

def self.start_dhcp(card)
Expand Down
6 changes: 0 additions & 6 deletions testsuite/tests/Network_YaPI.out
Expand Up @@ -11,7 +11,6 @@ Read .target.string "/etc/HOSTNAME" "laptop.suse.cz"
Read .target.size "/etc/sysconfig/network/routes" 27
Read .routes [$["destination":"default", "gateway":"10.20.30.40"]]
Execute .target.bash "rpm -q --whatprovides SuSEfirewall2" 0
Read .target.stat "/usr/lib/systemd/system/SuSEfirewall2.service" $["exists":true]
Execute .target.bash "/bin/systemctl is-enabled SuSEfirewall2.service" 0
Dir .network.section: ["eth0", "eth1", "eth2", "eth3", "eth4", "eth5", "eth5.23"]
Dir .network.value."eth0": ["BOOTPROTO", "STARTMODE"]
Expand Down Expand Up @@ -269,13 +268,10 @@ Read .target.string "/sys/class/net/eth0/type" "laptop.suse.cz"
Write .network.value."eth0".BOOTPROTO "dhcp4" true
Write .network.value."eth0".STARTMODE "auto" true
Write .network nil true
Read .target.stat "/usr/lib/systemd/system/network.service" $["exists":true]
Execute .target.bash_output "/bin/systemctl restart network.service" $["TERM":"raw"] $["exit":0, "stdout":"laptop.suse.cz"]
Read .target.size "/etc/sysconfig/network/routes" 27
Read .routes [$["destination":"default", "gateway":"10.20.30.40"]]
Read .target.stat "/usr/lib/systemd/system/SuSEfirewall2.service" $["exists":true]
Execute .target.bash "/bin/systemctl is-enabled SuSEfirewall2.service" 0
Read .target.stat "/usr/lib/systemd/system/SuSEfirewall2.service" $["exists":true]
Execute .target.bash "/bin/systemctl is-enabled SuSEfirewall2.service" 0
Execute .target.bash "echo 0 > /proc/sys/net/ipv4/ip_forward" 0
Execute .target.bash "echo 0 > /proc/sys/net/ipv6/conf/all/forwarding" 0
Expand Down Expand Up @@ -346,7 +342,6 @@ Write .network.value."eth3".BOOTPROTO "static" true
Write .network.value."eth3".IPADDR "1.2.3.7/24" true
Write .network.value."eth3".STARTMODE "auto" true
Write .network nil true
Read .target.stat "/usr/lib/systemd/system/network.service" $["exists":true]
Execute .target.bash_output "/bin/systemctl restart network.service" $["TERM":"raw"] $["exit":0, "stdout":"laptop.suse.cz"]
Dir .network.section: ["eth0", "eth1", "eth2", "eth3", "eth4", "eth5", "eth5.23"]
Dir .network.value."eth0": ["BOOTPROTO", "STARTMODE"]
Expand Down Expand Up @@ -413,5 +408,4 @@ Write .network.value."eth5.23".IPADDR "1.2.3.8/24" true
Write .network.value."eth5.23".STARTMODE "auto" true
Write .network.value."eth5.23".VLAN_ID "42" true
Write .network nil true
Read .target.stat "/usr/lib/systemd/system/network.service" $["exists":true]
Execute .target.bash_output "/bin/systemctl restart network.service" $["TERM":"raw"] $["exit":0, "stdout":"laptop.suse.cz"]
1 change: 0 additions & 1 deletion testsuite/tests/YaPI_bond.out
Expand Up @@ -17,5 +17,4 @@ Write .network.value."bond0".BOOTPROTO "static" true
Write .network.value."bond0".IPADDR "4.3.2.1/24" true
Write .network.value."bond0".STARTMODE "auto" true
Write .network nil true
Read .target.stat "/usr/lib/systemd/system/network.service" nil
Execute .target.bash_output "/bin/systemctl restart network.service" $["TERM":"raw"] $["exit":0, "stdout":"laptop.suse.cz"]

0 comments on commit 180aabb

Please sign in to comment.