Merge lp:~bladernr/maas-cert-server/mcs-add-ocp-curtin-userdata into lp:~hardware-certification/maas-cert-server/trunk

Proposed by Jeff Lane 
Status: Merged
Approved by: Jeff Lane 
Approved revision: 30
Merged at revision: 30
Proposed branch: lp:~bladernr/maas-cert-server/mcs-add-ocp-curtin-userdata
Merge into: lp:~hardware-certification/maas-cert-server/trunk
Diff against target: 157 lines (+128/-2)
3 files modified
debian/changelog (+7/-0)
preseed/curtin_userdata_ocp (+119/-0)
usr/sbin/maniacs-setup (+2/-2)
To merge this branch: bzr merge lp:~bladernr/maas-cert-server/mcs-add-ocp-curtin-userdata
Reviewer Review Type Date Requested Status
Jeff Lane  Approve
Review via email: mp+266964@code.launchpad.net

Description of the change

Added OCP Curtin Userdata file and modified maniacs_setup to install cert curtin_userdata by default

To post a comment you must log in.
Revision history for this message
Jeff Lane  (bladernr) wrote :

self approve

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2015-07-30 23:08:57 +0000
3+++ debian/changelog 2015-08-04 20:34:43 +0000
4@@ -1,3 +1,10 @@
5+maas-cert-server (0.2.4-1ppa1) trusty; urgency=medium
6+
7+ * Added curtin_userdata_ocp to deploy OCP test suite to SUTs
8+ * modified maniacs_setup accordingly to still install the cert curtin file
9+
10+ -- Jeff Lane <jeff@ubuntu.com> Tue, 04 Aug 2015 16:21:12 -0400
11+
12 maas-cert-server (0.2.4-0ppa1) trusty; urgency=medium
13
14 * This time I think I've got it; fix to make PDFs build.
15
16=== renamed file 'preseed/curtin_userdata' => 'preseed/curtin_userdata_cert'
17=== added file 'preseed/curtin_userdata_ocp'
18--- preseed/curtin_userdata_ocp 1970-01-01 00:00:00 +0000
19+++ preseed/curtin_userdata_ocp 2015-08-04 20:34:43 +0000
20@@ -0,0 +1,119 @@
21+# Get maas version
22+{{py:
23+from subprocess import check_output
24+maas_version = ""
25+cache_output = check_output(['apt-cache', 'policy', 'maas'])
26+for line in cache_output.splitlines():
27+ line = line.strip()
28+ if ':' in line and line.split(':')[0] == 'Installed':
29+ maas_version = line.split(':')[1].strip()
30+ break
31+}}
32+#cloud-config
33+debconf_selections:
34+ maas: |
35+ {{for line in str(curtin_preseed).splitlines()}}
36+ {{line}}
37+ {{endfor}}
38+{{if third_party_drivers and driver}}
39+early_commands:
40+ {{py: key_string = ''.join(['\\x%x' % x for x in map(ord, driver['key_binary'])])}}
41+ driver_00_get_key: /bin/echo -en '{{key_string}}' > /tmp/maas-{{driver['package']}}.gpg
42+ driver_01_add_key: ["apt-key", "add", "/tmp/maas-{{driver['package']}}.gpg"]
43+ driver_02_add: ["add-apt-repository", "-y", "deb {{driver['repository']}} {{node.get_distro_series()}} main"]
44+ driver_03_update_install: ["sh", "-c", "apt-get update --quiet && apt-get --assume-yes install {{driver['package']}}"]
45+ driver_04_load: ["sh", "-c", "depmod && modprobe {{driver['module']}}"]
46+{{endif}}
47+
48+anchor_bucket:
49+ - &sudoers |
50+ #!/bin/sh
51+ echo "Setting up sudoers...";
52+ echo "ubuntu ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/maas ; chmod 0440 /etc/sudoers.d/maas;
53+ echo "Done.";
54+
55+ - &installcert
56+ #!/bin/sh
57+ echo "Installing OCP certfication tools...";
58+ echo " Add cert source list...";
59+ echo deb http://ppa.launchpad.net/hardware-certification/public/ubuntu trusty main >> /etc/apt/sources.list.d/certification.list;
60+ echo deb http://ppa.launchpad.net/firmware-testing-team/ppa-fwts-stable/ubuntu trusty main >> /etc/apt/sources.list.d/certification.list;
61+ echo deb http://ppa.launchpad.net/opencompute-developers/ocp-certification-tools-ppa/ubuntu trusty main >> /etc/apt/sources.list.d/certification.list;
62+ echo " Getting GPG Keys...";
63+ apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 1FEADE10;
64+ apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 DA685A11;
65+ echo " Running apt-get update...";
66+ apt-get update;
67+ echo " Installing pre-dependencies...";
68+ apt-get install -y debconf-utils git;
69+ echo " Setting up and install mysql-server...";
70+ echo mysql-server mysql-server/root_password password insecure | debconf-set-selections;
71+ echo mysql-server mysql-server/root_password_again password insecure | debconf-set-selections;
72+ apt-get install -y mysql-server;
73+ echo " Installing OCP Checkbox...";
74+ git clone https://github.com/opencomputeproject/ocp_ci_server_certification_test_cases.git /opt/ocp-certification;
75+ cd /opt/ocp-certification;
76+ ./install.sh;
77+ sleep 60;
78+ echo "Done.";
79+
80+ - &iperf
81+ #!/bin/sh
82+ echo "Setting up iperf...";
83+ maas_ip=$(/sbin/ip route | awk '/default/ { print $3 }');
84+ sed -i 's/ your-iperf-server.example.com/'"$maas_ip"'/g' /etc/checkbox.d/network.cfg;
85+ echo "Done.";
86+
87+ - &networkinterfaces |
88+ #!/bin/sh
89+ echo "Setting all network interfaces to auto...";
90+ echo $(ls -l /etc/network/interfaces);
91+ /bin/sed -i '/^[ \t]*auto lo.*/! { s/auto.*/auto/ }' /etc/network/interfaces;
92+ for i in `ls /sys/class/net|sort |grep -v lo`;do /bin/sed -i "/^[ \t]*auto lo.*/! { /^auto/ s/$/ $i/ }" /etc/network/interfaces ;done;
93+ echo "Done.";
94+
95+ - &setubuntupass |
96+ #!/bin/sh
97+ echo "Setting ubuntu password..."
98+ echo "#cloud-config\nsystem_info:\n default_user:\n lock_passwd: False\n plain_text_passwd: 'ubuntu'" > /etc/cloud/cloud.cfg.d/ubuntu-user-defaults.cfg
99+ echo "Done.";
100+
101+late_commands:
102+ maas: [wget, '--no-proxy', '{{node_disable_pxe_url|escape.shell}}', '--post-data', '{{node_disable_pxe_data|escape.shell}}', '-O', '/dev/null']
103+{{if third_party_drivers and driver}}
104+ driver_00_key_get: curtin in-target -- sh -c "/bin/echo -en '{{key_string}}' > /tmp/maas-{{driver['package']}}.gpg"
105+ driver_02_key_add: ["curtin", "in-target", "--", "apt-key", "add", "/tmp/maas-{{driver['package']}}.gpg"]
106+ driver_03_add: ["curtin", "in-target", "--", "add-apt-repository", "-y", "deb {{driver['repository']}} {{node.get_distro_series()}} main"]
107+ driver_04_update_install: ["curtin", "in-target", "--", "apt-get", "update", "--quiet"]
108+ driver_05_install: ["curtin", "in-target", "--", "apt-get", "-y", "install", "{{driver['package']}}"]
109+ driver_06_depmod: ["curtin", "in-target", "--", "depmod"]
110+ driver_07_update_initramfs: ["curtin", "in-target", "--", "update-initramfs", "-u"]
111+{{endif}}
112+ # inject maas version into /etc/installed-with-maas and install cert tools
113+ set_maas_version: ["curtin", "in-target", "--", "sh", "-c", "/bin/echo {{maas_version}} > /etc/installed-by-maas"]
114+ # Install certification suite
115+ zv_cert_install: ['curtin', 'in-target', '--', 'sh', '-c', *sudoers ]
116+ zw_cert_install: ['curtin', 'in-target', '--', 'sh', '-c', *installcert ]
117+ zx_cert_install: ['curtin', 'in-target', '--', 'sh', '-c', *iperf ]
118+ zy_cert_install: ['curtin', 'in-target', '--', 'sh', '-c', *networkinterfaces]
119+ zz_cert_install: ['curtin', 'in-target', '--', 'sh', '-c', *setubuntupass]
120+
121+
122+power_state:
123+ mode: reboot
124+
125+{{if node.split_arch()[0] in {'i386', 'amd64'} }}
126+apt_mirrors:
127+ ubuntu_archive: http://{{main_archive_hostname}}/{{main_archive_directory}}
128+ ubuntu_security: http://{{main_archive_hostname}}/{{main_archive_directory}}
129+{{else}}
130+apt_mirrors:
131+ ubuntu_archive: http://{{ports_archive_hostname}}/{{ports_archive_directory}}
132+ ubuntu_security: http://{{ports_archive_hostname}}/{{ports_archive_directory}}
133+{{endif}}
134+
135+{{if http_proxy }}
136+apt_proxy: {{http_proxy}}
137+{{else}}
138+apt_proxy: http://{{server_host}}:8000/
139+{{endif}}
140
141=== modified file 'usr/sbin/maniacs-setup'
142--- usr/sbin/maniacs-setup 2015-07-17 19:42:06 +0000
143+++ usr/sbin/maniacs-setup 2015-08-04 20:34:43 +0000
144@@ -534,11 +534,11 @@
145 if [ ! -f /etc/maas/preseeds/curtin_userdata-orig ] ; then
146 cp /etc/maas/preseeds/curtin_userdata /etc/maas/preseeds/curtin_userdata-orig
147 fi
148- cp /usr/share/maas-cert-server/preseed/curtin_userdata /etc/maas/preseeds/curtin_userdata
149+ cp /usr/share/maas-cert-server/preseed/curtin_userdata_cert /etc/maas/preseeds/curtin_userdata
150 if [ ! -f /etc/maas/preseeds/curtin_userdata_custom-orig ] ; then
151 cp /etc/maas/preseeds/curtin_userdata_custom /etc/maas/preseeds/curtin_userdata_custom-orig
152 fi
153- cp /usr/share/maas-cert-server/preseed/curtin_userdata /etc/maas/preseeds/curtin_userdata_custom
154+ cp /usr/share/maas-cert-server/preseed/curtin_userdata_cert /etc/maas/preseeds/curtin_userdata_custom
155 if [ $MIRRORED -eq 1 ] ; then
156 sed -i s/ppa.launchpad.net/$INTERNAL_IP/g /etc/maas/preseeds/generic
157 sed -i s/ppa.launchpad.net/$INTERNAL_IP/g /etc/maas/preseeds/curtin_userdata

Subscribers

People subscribed via source and target branches

to status/vote changes: