Merge lp:~checkbox-dev/checkbox/checkbox-charm into lp:checkbox

Proposed by Ashley Lai
Status: Rejected
Rejected by: Sylvain Pineau
Proposed branch: lp:~checkbox-dev/checkbox/checkbox-charm
Merge into: lp:checkbox
Diff against target: 207 lines (+156/-0) (has conflicts)
10 files modified
README.md (+27/-0)
config.yaml (+18/-0)
copyright (+17/-0)
hooks/config-changed (+26/-0)
hooks/install (+14/-0)
hooks/iperf-service-relation-changed (+31/-0)
hooks/start (+4/-0)
hooks/stop (+7/-0)
metadata.yaml (+11/-0)
revision (+1/-0)
Conflict adding file README.md.  Moved existing file to README.md.moved.
To merge this branch: bzr merge lp:~checkbox-dev/checkbox/checkbox-charm
Reviewer Review Type Date Requested Status
Daniel Manrique (community) Needs Fixing
Review via email: mp+234881@code.launchpad.net

Description of the change

Checkbox charm merged from lp:~alai/charms/trusty/checkbox/trunk.

To post a comment you must log in.
Revision history for this message
Daniel Manrique (roadmr) wrote :

Hello! OK, I see there are some merge conflicts here. You mentioned you wanted this to live in lp:~checkbox-dev/checkbox/checkbox-charm. If that's the case, you can try to simply bzr push lp:~checkbox-dev/checkbox/checkbox-charm.

If instead you want this to be part of lp:checkbox, you'd have to redo your merge request and I would suggest putting the charm in support/charm.

Let me know if there are any questions on how to do any of this.

Thanks for contributing this charm!

review: Needs Fixing
Revision history for this message
Jeff Lane  (bladernr) wrote :

The idea (the one I suggested at least) was to have a separate project
part of checkbox, hence, hosting it at checkbox/checkbox-charm the
same way we host things like the packaging and legacy branches.

OR, do you think there's a better way? The desired end-goal is to get
this into Launchpad in a Certification space so both our teams (and
anyone else) can try it, file bugs and so forth. Open to suggestions.

On Tue, Sep 16, 2014 at 4:00 PM, Daniel Manrique
<email address hidden> wrote:
> Review: Needs Fixing
>
> Hello! OK, I see there are some merge conflicts here. You mentioned you wanted this to live in lp:~checkbox-dev/checkbox/checkbox-charm. If that's the case, you can try to simply bzr push lp:~checkbox-dev/checkbox/checkbox-charm.
>
> If instead you want this to be part of lp:checkbox, you'd have to redo your merge request and I would suggest putting the charm in support/charm.
>
> Let me know if there are any questions on how to do any of this.
>
> Thanks for contributing this charm!
> --
> https://code.launchpad.net/~checkbox-dev/checkbox/checkbox-charm/+merge/234881
> Your team Checkbox Developers is subscribed to branch lp:~checkbox-dev/checkbox/checkbox-charm.

--
"Entropy isn't what it used to be."

Jeff Lane - Server Certification Team Lead, Tools Developer, Warrior
Poet, Lover of Pie
Phone: 919-442-8649
Ubuntu Ham: W4KDH Freenode IRC: bladernr or bladernr_
gpg: 1024D/3A14B2DD 8C88 B076 0DD7 B404 1417 C466 4ABD 3635 3A14 B2DD

5. By Ashley Lai

Update README

Revision history for this message
Ashley Lai (alai) wrote :

The idea is to have this charm lives in lp:~checkbox-dev/checkbox/checkbox-charm. I did bzr push lp:~checkbox-dev/checkbox/checkbox-charm and then proposed a merge. Please let me know the right way to do it and I can redo.

Thanks.

Revision history for this message
Daniel Manrique (roadmr) wrote :

OK, the way it is, it already lives in lp:~checkbox-dev/checkbox/checkbox-charm, and people can download it and contribute to it. As-is, it can't be merged into lp:checkbox because, as you saw, it would add files at the top level of lp:checkbox itself (essentially you'd be fusing the two projects, which doesn't look like something we want to do).

Reading Jeff's expectations, I guess the best thing to do would be to create a launchpad project for the charm (for comparison with checkbox-legacy which is here: https://launchpad.net/checkbox-legacy/). Then it can have bugs filed against it, and contributions can merge against (inventing here) lp:checkbox-charm, instead of fumbling with sub-branches of checkbox. To bring it into the checkbox family we can simply add it to the all-encompassing checkbox project (https://launchpad.net/checkbox-project).

Let me know if this makes sense, if not we can always try to find another option. A problem here is that I'm not up to speed on juju charm best practices as far as using launchpad to track them and the stuff they deploy, I guess you know more about this than I do.

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

How about lp:checkbox-charm? We can still make that a part of
lp:checkbox-project but you could have your own merge requests and
bugs

On Tue, Sep 16, 2014 at 10:35 PM, Daniel Manrique
<email address hidden> wrote:
> OK, the way it is, it already lives in lp:~checkbox-dev/checkbox/checkbox-charm, and people can download it and contribute to it. As-is, it can't be merged into lp:checkbox because, as you saw, it would add files at the top level of lp:checkbox itself (essentially you'd be fusing the two projects, which doesn't look like something we want to do).
>
> Reading Jeff's expectations, I guess the best thing to do would be to create a launchpad project for the charm (for comparison with checkbox-legacy which is here: https://launchpad.net/checkbox-legacy/). Then it can have bugs filed against it, and contributions can merge against (inventing here) lp:checkbox-charm, instead of fumbling with sub-branches of checkbox. To bring it into the checkbox family we can simply add it to the all-encompassing checkbox project (https://launchpad.net/checkbox-project).
>
> Let me know if this makes sense, if not we can always try to find another option. A problem here is that I'm not up to speed on juju charm best practices as far as using launchpad to track them and the stuff they deploy, I guess you know more about this than I do.
> --
> https://code.launchpad.net/~checkbox-dev/checkbox/checkbox-charm/+merge/234881
> Your team Checkbox Developers is subscribed to branch lp:~checkbox-dev/checkbox/checkbox-charm.

Unmerged revisions

5. By Ashley Lai

Update README

4. By Ashley Lai

Add fixes from review comments

3. By Ashley Lai

Remove default option to run test

2. By Ashley Lai

Add more config and iperf

1. By Ashley Lai

Initial checkbox charm

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'README.md'
2--- README.md 1970-01-01 00:00:00 +0000
3+++ README.md 2014-09-16 20:11:39 +0000
4@@ -0,0 +1,27 @@
5+# Overview
6+Checkbox is a hardware test tool that can be used to certify servers, desktops and laptops. This charm will install the checkbox test tool If the whitelist and secure ID is specified it will run the certification test and submit the results.
7+
8+# Installation
9+To deploy this charm you will need at the minimum: a cloud environment, working juju installation and a successful bootstrap. Once bootstrapped, deploy the checkbox and iperf charm.
10+ juju deploy cs:~alai/checkbox
11+ juju deploy cs:~alai/iperf
12+
13+# Configuration
14+This charm provides configuration options for the following:
15+ secure_id - secure ID to submit the results (no default value)
16+ whitelist - whitelist to test (no default value)
17+ output_path - path for output file submission.xml and the log (default value is /tmp)
18+ iperf_target - IP address for the iperf target if not using the iperf charm
19+
20+Example to set the option:
21+ juju set checkbox output_path=/home/ubuntu
22+
23+The secure_id can be configured if you wish to submit the results.
24+
25+juju add-relation iperf checkbox
26+
27+# Contact Information
28+Ashley Lai <ashley.lai@canonical.com>
29+
30+# Cerfification
31+- [Canonical certification](https://certification.canonical.com/)
32
33=== renamed file 'README.md' => 'README.md.moved'
34=== added file 'config.yaml'
35--- config.yaml 1970-01-01 00:00:00 +0000
36+++ config.yaml 2014-09-16 20:11:39 +0000
37@@ -0,0 +1,18 @@
38+options:
39+ secure_id:
40+ type: string
41+ default: ""
42+ description: secure ID to submit the certification results
43+ whitelist:
44+ type: string
45+ default: ""
46+ description: path to whitelist
47+ output_path:
48+ type: string
49+ default: /tmp
50+ description: path of output file submission.xml and the log
51+ iperf_target:
52+ type: string
53+ default: ""
54+ description: IP address for the iperf target if not using the iperf charm
55+
56
57=== added file 'copyright'
58--- copyright 1970-01-01 00:00:00 +0000
59+++ copyright 2014-09-16 20:11:39 +0000
60@@ -0,0 +1,17 @@
61+Format: http://dep.debian.net/deps/dep5/
62+
63+Files: *
64+Copyright: Copyright 2014, Canonical Ltd., All Rights Reserved.
65+License: GPL-3
66+ This program is free software: you can redistribute it and/or modify
67+ it under the terms of the GNU General Public License as published by
68+ the Free Software Foundation, either version 3 of the License, or
69+ (at your option) any later version.
70+ .
71+ This program is distributed in the hope that it will be useful,
72+ but WITHOUT ANY WARRANTY; without even the implied warranty of
73+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
74+ GNU General Public License for more details.
75+ .
76+ You should have received a copy of the GNU General Public License
77+ along with this program. If not, see <http://www.gnu.org/licenses/>.
78
79=== added directory 'hooks'
80=== added file 'hooks/config-changed'
81--- hooks/config-changed 1970-01-01 00:00:00 +0000
82+++ hooks/config-changed 2014-09-16 20:11:39 +0000
83@@ -0,0 +1,26 @@
84+#!/bin/bash
85+
86+set -ex # If any command fails, stop execution of the hook with that error
87+
88+CONFIG_FILE="/etc/xdg/canonical-certification.conf"
89+
90+SECURE_ID=`config-get secure_id`
91+RESULT_PATH=`config-get output_path`
92+IPERF_TARGET=`config-get iperf_target`
93+
94+if [ "$IPERF_TARGET" != "" ]; then
95+ sed -i '$ d' $CONFIG_FILE
96+ echo "TEST_TARGET_IPERF = $IPERF_TARGET" >> $CONFIG_FILE
97+fi
98+
99+# Comment the submit feature for now as it will submit everytime
100+# "juju set" is ran. Will need to look into juju action.
101+# Work around for bug 1370145.
102+# /etc/sysctl.d/10-ipv6-privacy.conf contains funny apostrophe on line 3.
103+# export LANG as in /etc/default/locale
104+#export LANG="en_US.UTF-8"
105+
106+#if [ -f ${RESULT_PATH}/submission.xml ] && [ "$SECURE_ID" != "" ]; then
107+# echo "Submitting results. Check ${RESULT_PATH}/certification-submit.log for status"
108+# canonical-certification-submit --url https://certification.canonical.com/submissions/submit/ ${SECURE_ID} ${RESULT_PATH}/submission.xml 2>&1 | tee ${RESULT_PATH}/certification-submit.log
109+#fi
110
111=== added file 'hooks/install'
112--- hooks/install 1970-01-01 00:00:00 +0000
113+++ hooks/install 2014-09-16 20:11:39 +0000
114@@ -0,0 +1,14 @@
115+#!/bin/bash
116+# Here do anything needed to install the service
117+# i.e. apt-get install -y foo or bzr branch http://myserver/mycode /srv/webroot
118+# Make sure this hook exits cleanly and is idempotent, common problems here are
119+# failing to account for a debconf question on a dependency, or trying to pull
120+# from github without installing git first.
121+
122+set -e # If any command fails, stop execution of the hook with that error
123+
124+add-apt-repository ppa:hardware-certification/public
125+apt-get update
126+echo "Installing checkbox packages..."
127+apt-get install -y canonical-certification-server canonical-certification-submit plainbox
128+echo "Finished checkbox installation"
129
130=== added file 'hooks/iperf-service-relation-changed'
131--- hooks/iperf-service-relation-changed 1970-01-01 00:00:00 +0000
132+++ hooks/iperf-service-relation-changed 2014-09-16 20:11:39 +0000
133@@ -0,0 +1,31 @@
134+#!/bin/bash
135+
136+set -ex # If any command fails, stop execution of the hook with that error
137+
138+CONFIG_FILE="/etc/xdg/canonical-certification.conf"
139+HOST=$(relation-get private-address)
140+
141+SECURE_ID=`config-get secure_id`
142+WHITELIST=`config-get whitelist`
143+RESULT_PATH=`config-get output_path`
144+
145+echo "Configure checkbox"
146+
147+sed -i '$ d' $CONFIG_FILE
148+
149+echo "TEST_TARGET_IPERF = $HOST" >> $CONFIG_FILE
150+
151+if [ "$WHITELIST" != "" ]; then
152+ if [ "$SECURE_ID" != "" ]; then
153+ echo "Certification test is running. The results will be submitted after the test is completed. Check ${RESULT_PATH}/certification.log for status."
154+ echo "Whitelist: ${WHITELIST}"
155+ echo "Secure ID: ${SECURE_ID}"
156+ plainbox run -w ${WHITELIST} -f xml -o ${RESULT_PATH}/submission.xml -t certification --transport-options=secure_id=${SECURE_ID} --transport-where=https://certification.canonical.com/submissions/submit/ 2>&1 | tee ${RESULT_PATH}/certification.log
157+ echo "Certification test completed"
158+ else
159+ echo "Certification test is running. Check ${RESULT_PATH}/certification.log for status."
160+ echo "Whitelist: ${WHITELIST}"
161+ plainbox run -w ${WHITELIST} -f xml -o ${RESULT_PATH}/submission.xml | tee ${RESULT_PATH}/certification.log
162+ echo "Certification test completed"
163+ fi
164+fi
165
166=== added file 'hooks/start'
167--- hooks/start 1970-01-01 00:00:00 +0000
168+++ hooks/start 2014-09-16 20:11:39 +0000
169@@ -0,0 +1,4 @@
170+#!/bin/bash
171+# Here put anything that is needed to start the service.
172+# Note that currently this is run directly after install
173+# i.e. 'service apache2 start'
174
175=== added file 'hooks/stop'
176--- hooks/stop 1970-01-01 00:00:00 +0000
177+++ hooks/stop 2014-09-16 20:11:39 +0000
178@@ -0,0 +1,7 @@
179+#!/bin/bash
180+# This will be run when the service is being torn down, allowing you to disable
181+# it in various ways..
182+# For example, if your web app uses a text file to signal to the load balancer
183+# that it is live... you could remove it and sleep for a bit to allow the load
184+# balancer to stop sending traffic.
185+# rm /srv/webroot/server-live.txt && sleep 30
186
187=== added file 'metadata.yaml'
188--- metadata.yaml 1970-01-01 00:00:00 +0000
189+++ metadata.yaml 2014-09-16 20:11:39 +0000
190@@ -0,0 +1,11 @@
191+name: checkbox
192+summary: Hardware testing tool
193+maintainer: Ashley Lai <ashley.lai@canonical.com>
194+description: |
195+ Checkbox is a hardware testing tool useful for certifying servers,
196+ desktops and laptops.
197+categories:
198+ - miscellaneous
199+requires:
200+ iperf-service:
201+ interface: iperf
202
203=== added file 'revision'
204--- revision 1970-01-01 00:00:00 +0000
205+++ revision 2014-09-16 20:11:39 +0000
206@@ -0,0 +1,1 @@
207+3

Subscribers

People subscribed via source and target branches