Merge lp:~antonym/agent-smith/suse-support into lp:agent-smith

Proposed by Antony Messerli
Status: Needs review
Proposed branch: lp:~antonym/agent-smith/suse-support
Merge into: lp:agent-smith
Diff against target: 308 lines (+160/-3)
17 files modified
scripts/Makefile (+1/-1)
scripts/Makefile.am (+1/-1)
scripts/configure_network.sh (+8/-0)
scripts/detect_os.sh (+12/-1)
scripts/network/suse.sh (+67/-0)
scripts/tests/configure_network.sh-tests/r/suse_network_config/etc/sysconfig/network/ifcfg-eth0 (+5/-0)
scripts/tests/configure_network.sh-tests/r/suse_network_config/etc/sysconfig/network/ifcfg-eth0:1 (+5/-0)
scripts/tests/configure_network.sh-tests/r/suse_network_config/etc/sysconfig/network/ifcfg-eth1 (+4/-0)
scripts/tests/configure_network.sh-tests/r/suse_network_config/etc/sysconfig/network/routes (+3/-0)
scripts/tests/configure_network.sh-tests/t/suse_network_config/config (+23/-0)
scripts/tests/configure_network.sh-tests/t/suse_network_config/root/etc/sysconfig/network/ifcfg-eth0 (+5/-0)
scripts/tests/configure_network.sh-tests/t/suse_network_config/root/etc/sysconfig/network/ifcfg-eth0:1 (+5/-0)
scripts/tests/configure_network.sh-tests/t/suse_network_config/root/etc/sysconfig/network/ifcfg-eth1 (+4/-0)
scripts/tests/configure_network.sh-tests/t/suse_network_config/root/etc/sysconfig/network/routes (+3/-0)
scripts/tests/configure_network.sh-tests/t/suse_network_config/run.sh (+10/-0)
scripts/tests/detect_os.sh-tests/r/OpenSuse11.3 (+1/-0)
scripts/tests/detect_os.sh-tests/t/OpenSuse11.3/etc/issue (+3/-0)
To merge this branch: bzr merge lp:~antonym/agent-smith/suse-support
Reviewer Review Type Date Requested Status
Agent Smith devs Pending
Review via email: mp+32793@code.launchpad.net

Description of the change

Added SUSE support to agent.

To post a comment you must log in.

Unmerged revisions

54. By Antony Messerli

Fixed suse test

53. By ant <email address hidden>

OpenSUSE support

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'scripts/Makefile'
--- scripts/Makefile 2010-08-09 13:17:54 +0000
+++ scripts/Makefile 2010-08-16 18:24:44 +0000
@@ -164,7 +164,7 @@
164 update_agent.sh update_fstab_for_rescue.sh164 update_agent.sh update_fstab_for_rescue.sh
165165
166nobase_scripts_SCRIPTS = kms/satellite.sh network/arch.sh network/debian.sh \166nobase_scripts_SCRIPTS = kms/satellite.sh network/arch.sh network/debian.sh \
167 network/gentoo.sh network/redhat.sh167 network/gentoo.sh network/redhat.sh network/suse.sh
168168
169all: all-am169all: all-am
170170
171171
=== modified file 'scripts/Makefile.am'
--- scripts/Makefile.am 2010-08-09 13:17:54 +0000
+++ scripts/Makefile.am 2010-08-16 18:24:44 +0000
@@ -6,7 +6,7 @@
6 update_agent.sh update_fstab_for_rescue.sh6 update_agent.sh update_fstab_for_rescue.sh
77
8nobase_scripts_SCRIPTS = kms/satellite.sh network/arch.sh network/debian.sh \8nobase_scripts_SCRIPTS = kms/satellite.sh network/arch.sh network/debian.sh \
9 network/gentoo.sh network/redhat.sh9 network/gentoo.sh network/redhat.sh network/suse.sh
1010
11check:11check:
12 make -C tests check12 make -C tests check
1313
=== modified file 'scripts/configure_network.sh'
--- scripts/configure_network.sh 2010-07-30 21:50:10 +0000
+++ scripts/configure_network.sh 2010-08-16 18:24:44 +0000
@@ -24,6 +24,7 @@
24. "${AGENTSMITHDIR}/network/gentoo.sh"24. "${AGENTSMITHDIR}/network/gentoo.sh"
25. "${AGENTSMITHDIR}/network/debian.sh"25. "${AGENTSMITHDIR}/network/debian.sh"
26. "${AGENTSMITHDIR}/network/arch.sh"26. "${AGENTSMITHDIR}/network/arch.sh"
27. "${AGENTSMITHDIR}/network/suse.sh"
2728
28function get_interface_bullshit() {29function get_interface_bullshit() {
29 set -a public_addresses30 set -a public_addresses
@@ -130,5 +131,12 @@
130 /etc/rc.d/network restart131 /etc/rc.d/network restart
131 fi132 fi
132 ;;133 ;;
134 ("suse")
135 suse_network_config
136
137 if [ ! $DEBUG ]; then
138 /etc/init.d/network restart
139 fi
140 ;;
133 esac141 esac
134fi142fi
135143
=== modified file 'scripts/detect_os.sh'
--- scripts/detect_os.sh 2010-07-08 22:21:52 +0000
+++ scripts/detect_os.sh 2010-08-16 18:24:44 +0000
@@ -43,6 +43,10 @@
43 then43 then
44 echo gentoo44 echo gentoo
45 exit 045 exit 0
46 elif echo "$distributor" | grep -qi Suse
47 then
48 echo suse
49 exit 0
46 fi50 fi
47}51}
4852
@@ -63,7 +67,7 @@
63if [ -e "${etc_issue}" ]67if [ -e "${etc_issue}" ]
64then68then
65 if grep -qi Ubuntu "${etc_issue}"69 if grep -qi Ubuntu "${etc_issue}"
66 then70 then
67 echo "ubuntu"71 echo "ubuntu"
68 exit 072 exit 0
69 fi73 fi
@@ -92,6 +96,12 @@
92 exit 096 exit 0
93 fi97 fi
9498
99 if grep -qi "Suse" "${etc_issue}"
100 then
101 echo "suse"
102 exit 0
103 fi
104
95 if grep -qi "Arch" "${etc_issue}"105 if grep -qi "Arch" "${etc_issue}"
96 then106 then
97 echo "arch"107 echo "arch"
@@ -141,3 +151,4 @@
141# Shot in the dark151# Shot in the dark
142echo "ubuntu"152echo "ubuntu"
143exit 0153exit 0
154
144155
=== added file 'scripts/network/suse.sh'
--- scripts/network/suse.sh 1970-01-01 00:00:00 +0000
+++ scripts/network/suse.sh 2010-08-16 18:24:44 +0000
@@ -0,0 +1,67 @@
1function suse_network_config() {
2 SUSE_SYSCONFIG_PATH="/etc/sysconfig"
3 SUSE_CONFIG_PATH="/etc/sysconfig/network"
4 SUSE_ROUTES_FILE="routes"
5 TEMP_PUBLIC_INTERFACE="${TEMP}/${SUSE_CONFIG_PATH}/ifcfg-eth0"
6 TEMP_PRIVATE_INTERFACE="${TEMP}/${SUSE_CONFIG_PATH}/ifcfg-eth1"
7
8 if [ ! -d "${TEMP}/${SUSE_CONFIG_PATH}" ]; then
9 mkdir -p ${TEMP}/${SUSE_CONFIG_PATH} ]
10 fi
11
12 cat > ${TEMP}/${SUSE_CONFIG_PATH}/${SUSE_ROUTES_FILE} <<ETC_NETWORK
13default ${gateway} - eth0
14ETC_NETWORK
15
16 # CONFIGURE PUBLIC INTERFACES
17 public_address_count=0
18 public_address_iface=''
19 for address in ${public_addresses[@]}; do
20 parse_multi_key_line $address
21
22 if [ $public_address_count -gt 0 ]; then
23 public_address_iface=":${public_address_count}"
24 fi
25
26 cat > ${TEMP_PUBLIC_INTERFACE}${public_address_iface} <<PUBLIC_INTERFACE
27DEVICE=eth0${public_address_iface}
28BOOTPROTO=static
29IPADDR=${ip}
30NETMASK=${netmask}
31PUBLIC_INTERFACE
32
33 if [ $enabled -eq 1 ]; then
34 echo "ONBOOT=YES" >> ${TEMP_PUBLIC_INTERFACE}${public_address_iface}
35 fi
36
37 unset ip netmask enabled
38 let public_address_count=$public_address_count+1
39 done
40
41 # CONFIGURE PRIVATE INTERFACE AND ROUTES IF EXIST
42 if [ ${#private_addresses[@]} -eq 1 ]; then
43 parse_multi_key_line ${private_addresses[0]}
44
45 cat > ${TEMP_PRIVATE_INTERFACE} <<PRIVATE_INTERFACE
46DEVICE=eth1
47BOOTPROTO=static
48IPADDR=$ip
49NETMASK=$netmask
50PRIVATE_INTERFACE
51
52 #ROUTES
53 for route in ${routes[@]}; do
54 parse_multi_key_line $route
55 cat >> ${TEMP}/${SUSE_CONFIG_PATH}/${SUSE_ROUTES_FILE} <<STATIC_ROUTES
56${route} ${gateway} ${netmask} -
57STATIC_ROUTES
58 unset route netmask gateway
59 done
60 fi
61
62 cp -R "${TEMP}/${SUSE_CONFIG_PATH}" "${ROOT}/${SUSE_SYSCONFIG_PATH}"
63 rm -rf "${TEMP}/etc"
64
65 unset public_address_count public_address_iface
66}
67
068
=== added directory 'scripts/tests/configure_network.sh-tests/r/suse_network_config'
=== added directory 'scripts/tests/configure_network.sh-tests/r/suse_network_config/etc'
=== added directory 'scripts/tests/configure_network.sh-tests/r/suse_network_config/etc/sysconfig'
=== added directory 'scripts/tests/configure_network.sh-tests/r/suse_network_config/etc/sysconfig/network'
=== added file 'scripts/tests/configure_network.sh-tests/r/suse_network_config/etc/sysconfig/network/ifcfg-eth0'
--- scripts/tests/configure_network.sh-tests/r/suse_network_config/etc/sysconfig/network/ifcfg-eth0 1970-01-01 00:00:00 +0000
+++ scripts/tests/configure_network.sh-tests/r/suse_network_config/etc/sysconfig/network/ifcfg-eth0 2010-08-16 18:24:44 +0000
@@ -0,0 +1,5 @@
1DEVICE=eth0
2BOOTPROTO=static
3IPADDR=204.232.195.126
4NETMASK=255.255.255.0
5ONBOOT=YES
06
=== added file 'scripts/tests/configure_network.sh-tests/r/suse_network_config/etc/sysconfig/network/ifcfg-eth0:1'
--- scripts/tests/configure_network.sh-tests/r/suse_network_config/etc/sysconfig/network/ifcfg-eth0:1 1970-01-01 00:00:00 +0000
+++ scripts/tests/configure_network.sh-tests/r/suse_network_config/etc/sysconfig/network/ifcfg-eth0:1 2010-08-16 18:24:44 +0000
@@ -0,0 +1,5 @@
1DEVICE=eth0:1
2BOOTPROTO=static
3IPADDR=204.232.195.126
4NETMASK=255.255.255.0
5ONBOOT=YES
06
=== added file 'scripts/tests/configure_network.sh-tests/r/suse_network_config/etc/sysconfig/network/ifcfg-eth1'
--- scripts/tests/configure_network.sh-tests/r/suse_network_config/etc/sysconfig/network/ifcfg-eth1 1970-01-01 00:00:00 +0000
+++ scripts/tests/configure_network.sh-tests/r/suse_network_config/etc/sysconfig/network/ifcfg-eth1 2010-08-16 18:24:44 +0000
@@ -0,0 +1,4 @@
1DEVICE=eth1
2BOOTPROTO=static
3IPADDR=10.176.29.126
4NETMASK=255.255.224.0
05
=== added file 'scripts/tests/configure_network.sh-tests/r/suse_network_config/etc/sysconfig/network/routes'
--- scripts/tests/configure_network.sh-tests/r/suse_network_config/etc/sysconfig/network/routes 1970-01-01 00:00:00 +0000
+++ scripts/tests/configure_network.sh-tests/r/suse_network_config/etc/sysconfig/network/routes 2010-08-16 18:24:44 +0000
@@ -0,0 +1,3 @@
1default 204.232.195.1 - eth0
210.176.0.0 10.176.0.1 255.248.0.0 -
310.191.192.0 10.176.0.1 255.255.192.0 -
04
=== added directory 'scripts/tests/configure_network.sh-tests/r/suse_network_config/tmp'
=== added file 'scripts/tests/configure_network.sh-tests/r/suse_network_config/tmp/.bzrignore'
=== added directory 'scripts/tests/configure_network.sh-tests/t/suse_network_config'
=== added file 'scripts/tests/configure_network.sh-tests/t/suse_network_config/config'
--- scripts/tests/configure_network.sh-tests/t/suse_network_config/config 1970-01-01 00:00:00 +0000
+++ scripts/tests/configure_network.sh-tests/t/suse_network_config/config 2010-08-16 18:24:44 +0000
@@ -0,0 +1,23 @@
1label:"public"
2ips:0:netmask:"255.255.255.0"
3ips:0:enabled:1
4ips:0:ip:"204.232.195.126"
5ips:1:netmask:"255.255.255.0"
6ips:1:enabled:1
7ips:1:ip:"204.232.195.126"
8mac:"40:40:12:8d:ae:09"
9gateway:"204.232.195.1"
10slice:"964"
11dns:"72.3.128.240"
12dns:"72.3.128.241"
13label:"private"
14ips:0:netmask:"255.255.224.0"
15ips:0:enabled:1
16ips:0:ip:"10.176.29.126"
17routes:0:route:"10.176.0.0"
18routes:0:netmask:"255.248.0.0"
19routes:0:gateway:"10.176.0.1"
20routes:1:route:"10.191.192.0"
21routes:1:netmask:"255.255.192.0"
22routes:1:gateway:"10.176.0.1"
23"mac":"40:40:b2:fe:c7:c4"
024
=== added directory 'scripts/tests/configure_network.sh-tests/t/suse_network_config/root'
=== added directory 'scripts/tests/configure_network.sh-tests/t/suse_network_config/root/etc'
=== added directory 'scripts/tests/configure_network.sh-tests/t/suse_network_config/root/etc/sysconfig'
=== added directory 'scripts/tests/configure_network.sh-tests/t/suse_network_config/root/etc/sysconfig/network'
=== added file 'scripts/tests/configure_network.sh-tests/t/suse_network_config/root/etc/sysconfig/network/ifcfg-eth0'
--- scripts/tests/configure_network.sh-tests/t/suse_network_config/root/etc/sysconfig/network/ifcfg-eth0 1970-01-01 00:00:00 +0000
+++ scripts/tests/configure_network.sh-tests/t/suse_network_config/root/etc/sysconfig/network/ifcfg-eth0 2010-08-16 18:24:44 +0000
@@ -0,0 +1,5 @@
1DEVICE=eth0
2BOOTPROTO=static
3IPADDR=204.232.195.126
4NETMASK=255.255.255.0
5ONBOOT=YES
06
=== added file 'scripts/tests/configure_network.sh-tests/t/suse_network_config/root/etc/sysconfig/network/ifcfg-eth0:1'
--- scripts/tests/configure_network.sh-tests/t/suse_network_config/root/etc/sysconfig/network/ifcfg-eth0:1 1970-01-01 00:00:00 +0000
+++ scripts/tests/configure_network.sh-tests/t/suse_network_config/root/etc/sysconfig/network/ifcfg-eth0:1 2010-08-16 18:24:44 +0000
@@ -0,0 +1,5 @@
1DEVICE=eth0:1
2BOOTPROTO=static
3IPADDR=204.232.195.126
4NETMASK=255.255.255.0
5ONBOOT=YES
06
=== added file 'scripts/tests/configure_network.sh-tests/t/suse_network_config/root/etc/sysconfig/network/ifcfg-eth1'
--- scripts/tests/configure_network.sh-tests/t/suse_network_config/root/etc/sysconfig/network/ifcfg-eth1 1970-01-01 00:00:00 +0000
+++ scripts/tests/configure_network.sh-tests/t/suse_network_config/root/etc/sysconfig/network/ifcfg-eth1 2010-08-16 18:24:44 +0000
@@ -0,0 +1,4 @@
1DEVICE=eth1
2BOOTPROTO=static
3IPADDR=10.176.29.126
4NETMASK=255.255.224.0
05
=== added file 'scripts/tests/configure_network.sh-tests/t/suse_network_config/root/etc/sysconfig/network/routes'
--- scripts/tests/configure_network.sh-tests/t/suse_network_config/root/etc/sysconfig/network/routes 1970-01-01 00:00:00 +0000
+++ scripts/tests/configure_network.sh-tests/t/suse_network_config/root/etc/sysconfig/network/routes 2010-08-16 18:24:44 +0000
@@ -0,0 +1,3 @@
1default 204.232.195.1 - eth0
210.176.0.0 10.176.0.1 255.248.0.0 -
310.191.192.0 10.176.0.1 255.255.192.0 -
04
=== added file 'scripts/tests/configure_network.sh-tests/t/suse_network_config/run.sh'
--- scripts/tests/configure_network.sh-tests/t/suse_network_config/run.sh 1970-01-01 00:00:00 +0000
+++ scripts/tests/configure_network.sh-tests/t/suse_network_config/run.sh 2010-08-16 18:24:44 +0000
@@ -0,0 +1,10 @@
1#!/bin/bash
2
3export DEBUG=true
4export ROOT="${ROOT:-`pwd`}"
5export TEMP="${TEMP:-$ROOT/tmp}"
6
7. $AGENTSMITHDIR/configure_network.sh
8
9get_interface_bullshit
10suse_network_config
011
=== added file 'scripts/tests/detect_os.sh-tests/r/OpenSuse11.3'
--- scripts/tests/detect_os.sh-tests/r/OpenSuse11.3 1970-01-01 00:00:00 +0000
+++ scripts/tests/detect_os.sh-tests/r/OpenSuse11.3 2010-08-16 18:24:44 +0000
@@ -0,0 +1,1 @@
1suse
02
=== added directory 'scripts/tests/detect_os.sh-tests/t/OpenSuse11.3'
=== added directory 'scripts/tests/detect_os.sh-tests/t/OpenSuse11.3/etc'
=== added file 'scripts/tests/detect_os.sh-tests/t/OpenSuse11.3/etc/issue'
--- scripts/tests/detect_os.sh-tests/t/OpenSuse11.3/etc/issue 1970-01-01 00:00:00 +0000
+++ scripts/tests/detect_os.sh-tests/t/OpenSuse11.3/etc/issue 2010-08-16 18:24:44 +0000
@@ -0,0 +1,3 @@
1Welcome to openSUSE 11.3 "Teal" - Kernel \r (\l).
2
3

Subscribers

People subscribed via source and target branches