Merge ~bladernr/plainbox-provider-certification-server:1738805-clear-up-url-expectations into plainbox-provider-certification-server:master

Proposed by Jeff Lane 
Status: Merged
Approved by: Sylvain Pineau
Approved revision: f5d8ba40cdb1d9b7cca011d0430ef30ca60e3f6c
Merged at revision: 8639658e0f2b95ff8d8217709b65ea9a211a4dc4
Proposed branch: ~bladernr/plainbox-provider-certification-server:1738805-clear-up-url-expectations
Merge into: plainbox-provider-certification-server:master
Diff against target: 94 lines (+16/-11)
2 files modified
configs/canonical-certification.conf (+14/-1)
tools/canonical-certification-precheck (+2/-10)
Reviewer Review Type Date Requested Status
Sylvain Pineau (community) Approve
Review via email: mp+335329@code.launchpad.net

Description of the change

Made the text about LXD images and URLs more explanatory.
Removed unnecessary return statements in precheck that were preventing second half of the LXD check from running in some cases.

Tested locally.

To post a comment you must log in.
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

Looks good, +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/configs/canonical-certification.conf b/configs/canonical-certification.conf
2index a696c05..49a4ea7 100644
3--- a/configs/canonical-certification.conf
4+++ b/configs/canonical-certification.conf
5@@ -49,6 +49,18 @@ welcome_text = Welcome to System Certification!
6 # LXD containers.
7 # LXD_TEMPLATES is the tarball that contains the LXD templates and YAML
8 # necessary for defining containers
9+#
10+# Note: You must provide a full URL to the files for LXD even if they're stored
11+# locally. The following examples demonstrate proper URLs for this section:
12+# - http://someotherserver.net/imagedir/ubuntu/lxd-rootfs-filename.tar.xz
13+# - This will tell the script to download the file mycloudimg.img from the
14+# remote server.
15+# - file:///local/path/to/lxd-templates-filename.tar.xz
16+# - This will tell the script to look at the path specified on the local
17+# filesystem for a copy of the cloud image to use.
18+# UNCOMMENT BOTH OF THE FOLLOWING 2 LINES nad set the proper URLs as necessary
19+# OR leave them commented out and the LXD test will obtain the needed images
20+# from linuxcontiners.org.
21 #LXD_ROOTFS = http://server_url/path/to/lxd-rootfs-filename.tar.xz
22 #LXD_TEMPLATE = http://server_url/path/to/lxd-templates-filename.tar.xz
23
24@@ -56,5 +68,6 @@ welcome_text = Welcome to System Certification!
25 #
26 # TEST_TARGET_IPERF is the IP/Hostname of the iperf server for network testing.
27 #
28-# UNCOMMENT THE FOLLOWING LINE and set the proper parameters as necessary:
29+# UNCOMMENT THE FOLLOWING LINE and set the IP/Hostname of your iperf target
30+# system as necessary:
31 #TEST_TARGET_IPERF = your-iperf-server.example.com
32diff --git a/tools/canonical-certification-precheck b/tools/canonical-certification-precheck
33index 0e802eb..408270f 100755
34--- a/tools/canonical-certification-precheck
35+++ b/tools/canonical-certification-precheck
36@@ -389,8 +389,8 @@ if grep "^LXD_TEMPLATE =" /etc/xdg/canonical-certification.conf >/dev/null; then
37 echo -e " $templateurl is a valid url.\n Continuing to use this template file"
38 pass
39 else
40- echo -e " NOTE: For the following, you must provide a valid URL beginning with http://,"
41- echo -e " https://, or file://"
42+ echo -e " NOTE: For the following, YOU MUST PROVIDE A VALID URL beginning with http://,"
43+ echo -e " https://, or file://. A filesystem PATH is NOT valid here:"
44 echo -e " $templateurl is not a valid url.\n Would you like to reconfigure it now? [Y/n]"
45 read -s -N1 a
46 if [[ $a == "Y" || $a == "y" || -z $a ]]; then
47@@ -400,11 +400,9 @@ if grep "^LXD_TEMPLATE =" /etc/xdg/canonical-certification.conf >/dev/null; then
48 if curl --output /dev/null --silent --head -fail "$templateurl"; then
49 echo -e " $templateurl is a valid url.\n Continuing to use this template file"
50 pass
51- return 0
52 else
53 echo -e " We cannot get the LXD template image from $templateurl.\n Marking as failed"
54 fail
55- return 0
56 fi
57 else
58 echo -e " Leaving configuration but commenting out."
59@@ -433,11 +431,9 @@ else
60 if curl --output /dev/null --silent --head -fail "$templateurl"; then
61 echo -e " $templateurl is a valid url.\n Continuing to use this template file"
62 pass
63- return 0
64 else
65 echo -e " We cannot get the LXD template image from $templateurl.\n Marking as failed"
66 fail
67- return 0
68 fi
69 else
70 echo -e " Leaving configuration but commenting out."
71@@ -467,11 +463,9 @@ if grep "^LXD_ROOTFS =" /etc/xdg/canonical-certification.conf >/dev/null; then
72 if curl --output /dev/null --silent --head -fail "$rootfsurl"; then
73 echo -e " $rootfsurl is a valid url.\n Continuing to use this rootfs file"
74 pass
75- return 0
76 else
77 echo -e " We cannot get the rootfs file from $rootfsurl.\n Marking as failed"
78 fail
79- return 0
80 fi
81 else
82 echo -e " Leaving configuration but commenting out."
83@@ -501,11 +495,9 @@ else
84 if curl --output /dev/null --silent --head -fail "$rootfsurl"; then
85 echo -e " $rootfsurl is a valid url.\n Continuing to use this rootfs file"
86 pass
87- return 0
88 else
89 echo -e " We cannot get the rootfs image from $rootfsurl.\n Marking as failed"
90 fail
91- return 0
92 fi
93 else
94 echo -e " Leaving configuration but commenting out."

Subscribers

People subscribed via source and target branches