Merge ~troyanov/maas:remove-maas-test-enlistment-script into maas:master

Proposed by Anton Troyanov
Status: Merged
Approved by: Anton Troyanov
Approved revision: 5b94c02f8f8f5da521e5bd9dd17d0f2a548d3acb
Merge reported by: MAAS Lander
Merged at revision: not available
Proposed branch: ~troyanov/maas:remove-maas-test-enlistment-script
Merge into: maas:master
Diff against target: 102 lines (+0/-85)
2 files modified
debian/maas-rack-controller.install (+0/-3)
dev/null (+0/-82)
Reviewer Review Type Date Requested Status
MAAS Lander Approve
Alberto Donato (community) Approve
Review via email: mp+440380@code.launchpad.net

Commit message

chore: remove maas-test-enlistment script

Description of the change

This script doesn't seem to be used anywhere.

To post a comment you must log in.
Revision history for this message
Alberto Donato (ack) wrote :

+1

review: Approve
Revision history for this message
MAAS Lander (maas-lander) wrote :

UNIT TESTS
-b remove-maas-test-enlistment-script lp:~troyanov/maas/+git/maas into -b master lp:~maas-committers/maas

STATUS: SUCCESS
COMMIT: 5b94c02f8f8f5da521e5bd9dd17d0f2a548d3acb

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/maas-rack-controller.install b/debian/maas-rack-controller.install
2index d3c6b4f..2ec2e87 100644
3--- a/debian/maas-rack-controller.install
4+++ b/debian/maas-rack-controller.install
5@@ -1,9 +1,6 @@
6 # Install maas-dhcp-helper
7 package-files/usr/sbin/maas-dhcp-helper usr/sbin
8
9-# Install test scripts
10-package-files/usr/lib/maas/maas-test-enlistment usr/lib/maas
11-
12 # Install all other stuff
13 debian/extras/99-maas-sudoers etc/sudoers.d
14 usr/bin/maas-rack usr/sbin
15diff --git a/package-files/usr/lib/maas/maas-test-enlistment b/package-files/usr/lib/maas/maas-test-enlistment
16deleted file mode 100755
17index e965e93..0000000
18--- a/package-files/usr/lib/maas/maas-test-enlistment
19+++ /dev/null
20@@ -1,82 +0,0 @@
21-#!/bin/bash -e
22-
23-# Copyright 2017 Canonical Ltd. This software is licensed under the
24-# GNU Affero General Public License version 3 (see the file LICENSE).
25-
26-# This script tests enlistment by requesting boot loader configuration from
27-# MAAS, then parsing it to look for cloud-config and metadata server URLs.
28-# This allows the user to sanity-check that enlisting nodes will be able
29-# to reach the MAAS server. In addition, validates that required boot loader
30-# binaries exist, and prints their sha256 sums.
31-
32-TMPDIR="$(mktemp -d)"
33-
34-function cleanup() {
35- rm -rf "$TMPDIR"
36-}
37-
38-trap cleanup EXIT
39-
40-server=${1:-localhost}
41-
42-PXE_CFG_URL="tftp://$server/pxelinux.cfg/default-amd64-generic"
43-curl -s "$PXE_CFG_URL" > "$TMPDIR/pxe-config"
44-
45-echo ""
46-echo "===== BEGIN PXE CONFIG ====="
47-cat "$TMPDIR/pxe-config"
48-echo "===== END PXE CONFIG ====="
49-
50-GRUB_CFG_URL="tftp://$server/grub/grub.cfg-default-amd64-generic"
51-curl -s "$GRUB_CFG_URL" > "$TMPDIR/grub-config"
52-echo ""
53-echo "===== BEGIN GRUB CONFIG ====="
54-cat "$TMPDIR/grub-config"
55-echo "===== END GRUB CONFIG ====="
56-
57-CONFIG_URL=$(cat "$TMPDIR/pxe-config" \
58- | grep ' APPEND.*cloud-config-url' \
59- | tr ' ' '\n' \
60- | grep cloud-config-url \
61- | cut -f2- -d=)
62-echo ""
63-echo "Found cloud-config-url: $CONFIG_URL"
64-curl -s "$CONFIG_URL" > "$TMPDIR/enlist-config"
65-
66-echo ""
67-echo "===== BEGIN ENLISTMENT CLOUD-CONFIG ====="
68-cat "$TMPDIR/enlist-config"
69-echo "===== END ENLISTMENT CLOUD-CONFIG ====="
70-
71-METADATA_URL=$(cat "$TMPDIR/enlist-config" \
72- | grep 'metadata_url: ' \
73- | awk '{ print $2 }')
74-echo ""
75-echo "Found metadata URL: $METADATA_URL"
76-
77-
78-LOADERS="
79- tftp://$server/pxelinux.0
80- tftp://$server/chain.c32
81- tftp://$server/ifcpu64.c32
82- tftp://$server/ldlinux.c32
83- tftp://$server/libcom32.c32
84- tftp://$server/libutil.c32
85- tftp://$server/bootx64.efi
86- tftp://$server/grubx64.efi
87- tftp://$server/grubaa64.efi
88- tftp://$server/bootppc64.bin
89-"
90-
91-set -o pipefail
92-echo ""
93-echo "===== BEGIN BOOT LOADER SHA256 SUMS ====="
94-for loader in $LOADERS; do
95- loader_sha256=$(curl -sqf "$loader" | sha256sum | awk '{ print $1 }' || touch $TMPDIR/not-found)
96- if [ -f $TMPDIR/not-found ]; then
97- loader_sha256="[WARNING: file not found]"
98- rm $TMPDIR/not-found
99- fi
100- printf "%40s\n%10s%s\n\n" "$loader" "" "$loader_sha256"
101-done
102-echo "===== END BOOT LOADER SHA256 SUMS ====="

Subscribers

People subscribed via source and target branches