Skip to content
Open
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
15 changes: 15 additions & 0 deletions bosh-stemcell/spec/bosh/stemcell/stage_collection_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,21 @@ module Bosh::Stemcell
expect(stage_collection.build_stemcell_image_stages).to eq(build_stemcell_image_stages)
expect(stage_collection.package_stemcell_stages("files")).to eq(package_stemcell_stages)
end

it "does not include the rosetta stage" do
expect(stage_collection.build_stemcell_image_stages).to_not include(:base_ubuntu_warden_rosetta)
end

context "with the rosetta variant" do
let(:operating_system) { OperatingSystem.for("ubuntu", "resolute-rosetta") }

# The stage has to run before bosh_clean/bosh_harden, which is why its
# position rather than its mere presence is asserted.
it "inserts the rosetta stage directly after base_warden" do
stages = stage_collection.build_stemcell_image_stages
expect(stages[stages.index(:base_warden) + 1]).to eq(:base_ubuntu_warden_rosetta)
end
end
end
end
end
Expand Down
16 changes: 14 additions & 2 deletions bosh-stemcell/spec/stemcells/rosetta_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,12 @@
end

# The architecture check above would still pass if the binary could not
# actually run, so exercise a real round-trip.
# actually run, so exercise a real round-trip — but only on a host whose
# kernel can run arm64. An x86-64 CI worker has no arm64 handler and every
# exec fails with "Exec format error"; there the exec path is covered
# instead by the manual build on Apple Silicon
# (docs/ci-warden-rosetta-build.md). Every other assertion in this file is
# static and runs everywhere.
describe command(
"set -e; " \
"rm -rf /tmp/tar-spec; mkdir -p /tmp/tar-spec/src /tmp/tar-spec/out; " \
Expand All @@ -80,7 +85,14 @@
"grep -q payload /tmp/tar-spec/out/src/probe; " \
"rm -rf /tmp/tar-spec"
) do
it("extracts an archive it just created") { expect(subject.exit_status).to eq(0) }
it "extracts an archive it just created" do
if command("/lib/ld-linux-aarch64.so.1 --help").exit_status != 0
skip("this build host cannot execute arm64 binaries; the tar " \
"round-trip is the only check skipped, all static assertions ran")
end

expect(subject.exit_status).to eq(0)
end
end
end

Expand Down
Loading
Loading