Skip to content

Commit

Permalink
Fix smoke test for orange flavor
Browse files Browse the repository at this point in the history
Signed-off-by: David Cassany <[email protected]>
  • Loading branch information
davidcassany committed Jun 10, 2024
1 parent 97e8baf commit 0b9170d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
7 changes: 7 additions & 0 deletions examples/orange/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,16 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins
patch \
netplan.io \
locales \
kbd \
podman \
xz-utils

# Hack to prevent systemd-firstboot failures while setting keymap, this is known
# Debian issue (T_T) https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=790955
ARG KBD=2.6.4
RUN curl -L https://mirrors.edge.kernel.org/pub/linux/utils/kbd/kbd-${KBD}.tar.xz --output kbd-${KBD}.tar.xz && \
tar xaf kbd-${KBD}.tar.xz && mkdir -p /usr/share/keymaps && cp -Rp kbd-${KBD}/data/keymaps/* /usr/share/keymaps/

# Symlink grub2-editenv
RUN ln -sf /usr/bin/grub-editenv /usr/bin/grub2-editenv

Expand Down
16 changes: 14 additions & 2 deletions tests/smoke/smoke_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package elemental_test
import (
"fmt"
"math/rand"
"strings"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
Expand Down Expand Up @@ -100,10 +101,21 @@ var _ = Describe("Elemental Smoke tests", func() {
})

It("has default localectl configuration from cloud-init", func() {
out, err := s.Command("localectl status")
var isUbuntu bool

out, err := s.Command("source /etc/os-release && echo $NAME")
Expect(err).ToNot(HaveOccurred())
if strings.Contains(out, "Ubuntu") {
isUbuntu = true
}

out, err = s.Command("localectl status")
Expect(err).ToNot(HaveOccurred())
Expect(out).Should(ContainSubstring("LANG=en_US.UTF-8"))
Expect(out).Should(ContainSubstring("VC Keymap: us"))
if !isUbuntu {
// Setting keymap is not supported in Debian via systemd (localectl)
Expect(out).Should(ContainSubstring("VC Keymap: us"))
}
})
})
})

0 comments on commit 0b9170d

Please sign in to comment.