Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/buildomat/jobs/build-and-test-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,11 @@ ptime -m cargo +'nightly-2022-09-27' build --locked --all-targets --verbose
# NOTE: We're using using the same RUSTFLAGS and RUSTDOCFLAGS as above to avoid
# having to rebuild here.
#
# We also don't use `--workspace` here because we're not prepared to run tests
# from end-to-end-tests.
#
banner test
ptime -m cargo +'nightly-2022-09-27' test --workspace --locked --verbose \
ptime -m cargo +'nightly-2022-09-27' test --locked --verbose \
--no-fail-fast

#
Expand Down
5 changes: 4 additions & 1 deletion .github/buildomat/jobs/build-and-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,11 @@ ptime -m cargo +'nightly-2022-09-27' build --locked --all-targets --verbose
# NOTE: We're using using the same RUSTFLAGS and RUSTDOCFLAGS as above to avoid
# having to rebuild here.
#
# We also don't use `--workspace` here because we're not prepared to run tests
# from end-to-end-tests.
#
banner test
ptime -m cargo +'nightly-2022-09-27' test --workspace --locked --verbose \
ptime -m cargo +'nightly-2022-09-27' test --locked --verbose \
--no-fail-fast

#
Expand Down
33 changes: 33 additions & 0 deletions .github/buildomat/jobs/build-end-to-end-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash
#:
#: name = "helios / build-end-to-end-tests"
#: variety = "basic"
#: target = "helios-latest"
#: rust_toolchain = "nightly-2022-04-27"
#: output_rules = [
#: "=/work/*.gz",
#: ]
#:

set -o errexit
set -o pipefail
set -o xtrace

cargo --version
rustc --version

ptime -m ./tools/install_builder_prerequisites.sh -yp

#
# Reduce debuginfo just to line tables.
#
export CARGO_PROFILE_DEV_DEBUG=1
export CARGO_PROFILE_TEST_DEBUG=1

ptime -m cargo build -p end-to-end-tests --tests --bin bootstrap \
--message-format json-render-diagnostics >/tmp/output.end-to-end.json

for p in target/debug/bootstrap $(/opt/ooce/bin/jq -r 'select(.profile.test) | .executable' /tmp/output.end-to-end.json); do
# shellcheck disable=SC2094
ptime -m gzip < "$p" > /work/"$(basename "$p").gz"
done
62 changes: 39 additions & 23 deletions .github/buildomat/jobs/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
#: [dependencies.package]
#: job = "helios / package"
#:
#: [dependencies.build-end-to-end-tests]
#: job = "helios / build-end-to-end-tests"
#:

set -o errexit
set -o pipefail
Expand Down Expand Up @@ -106,8 +109,29 @@ pfexec chown build:build /opt/oxide/work
cd /opt/oxide/work

ptime -m tar xvzf /input/package/work/package.tar.gz
mkdir tests
for p in /input/build-end-to-end-tests/work/*.gz; do
ptime -m gunzip < "$p" > "tests/$(basename "${p%.gz}")"
chmod a+x "tests/$(basename "${p%.gz}")"
done

ptime -m pfexec ./tools/create_virtual_hardware.sh

#
# Image-related tests use images served by catacomb. The lab network is
# IPv4-only; the propolis zones are IPv6-only. These steps set up tcpproxy
# configured to proxy to catacomb via port 54321 in the global zone.
#
pfexec mkdir -p /usr/oxide
pfexec rm -f /usr/oxide/tcpproxy
pfexec curl -sSfL -o /usr/oxide/tcpproxy \
http://catacomb.eng.oxide.computer:12346/tcpproxy
pfexec chmod +x /usr/oxide/tcpproxy
pfexec rm -f /var/svc/manifest/site/tcpproxy.xml
pfexec curl -sSfL -o /var/svc/manifest/site/tcpproxy.xml \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just include tcpproxy.xml in the omicron repo so that we don't run the risk of a change made to the remote copy breaking CI with no in-repo changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the moment I'm avoiding this because I'd rather have the tcpproxy binary and its service manifest in sync in the same place. (But I'm making a note to eventually build tcpproxy in CI perhaps?)

http://catacomb.eng.oxide.computer:12346/tcpproxy.xml
pfexec svccfg import /var/svc/manifest/site/tcpproxy.xml

#
# XXX Right now, the Nexus external API is available on a specific IPv4 address
# on a canned subnet. We need to create an address in the global zone such
Expand All @@ -118,6 +142,17 @@ ptime -m pfexec ./tools/create_virtual_hardware.sh
#
pfexec ipadm create-addr -T static -a 192.168.1.199/24 igb0/sidehatch

#
# Modify config-rss.toml in the sled-agent zone to use our system's IP and MAC
# address for upstream connectivity.
#
tar xf out/omicron-sled-agent.tar pkg/config-rss.toml
sed -e '/\[gateway\]/,/\[request\]/ s/^.*address =.*$/address = "192.168.1.199"/' \
-e "s/^mac =.*$/mac = \"$(dladm show-phys -m -p -o ADDRESS | head -n 1)\"/" \
-i pkg/config-rss.toml
tar rf out/omicron-sled-agent.tar pkg/config-rss.toml
rm -rf pkg

#
# This OMICRON_NO_UNINSTALL hack here is so that there is no implicit uninstall
# before the install. This doesn't work right now because, above, we made
Expand All @@ -129,27 +164,8 @@ pfexec ipadm create-addr -T static -a 192.168.1.199/24 igb0/sidehatch
OMICRON_NO_UNINSTALL=1 \
ptime -m pfexec ./target/release/omicron-package install

# Wait up to 5 minutes for RSS to say it's done
for _i in {1..30}; do
sleep 10
grep "Finished setting up services" "$(svcs -L sled-agent)" && break
done

set +o xtrace

start=$SECONDS
while :; do
if (( SECONDS - start > 60 )); then
printf 'FAILURE: NEXUS DID NOT BECOME AVAILABLE\n' >&2
exit 1
fi

if curl --max-time 1 --fail-with-body -i http://192.168.1.20/spoof_login; then
printf 'ok; nexus became available!\n'
break
fi
./tests/bootstrap
rm ./tests/bootstrap
for test_bin in tests/*; do
./"$test_bin"
done

#
# XXX add tests here!
#
3 changes: 1 addition & 2 deletions .github/buildomat/jobs/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@ ptime -m ./tools/create_self_signed_cert.sh -yp

ptime -m cargo run --locked --release --bin omicron-package -- package

# TODO: write tests and add the resulting test bin here
files=(
out/*.tar{,.gz}
package-manifest.toml
smf/sled-agent/config.toml
target/release/omicron-package
tools/{create,destroy}_virtual_hardware.sh
tools/create_virtual_hardware.sh
)
ptime -m tar cvzf /work/package.tar.gz "${files[@]}"
Loading