Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SSH missing in images #90

Merged
merged 3 commits into from
Mar 21, 2024
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
29 changes: 15 additions & 14 deletions ci/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,21 @@ TOP_DIR=$(readlink -f "$(dirname "$0")/../")

rm -rf "$TOP_DIR/poky"
mkdir "$TOP_DIR/poky"
wget --no-check-certificate -O "$TOP_DIR/poky/poky-2.6.tar.bz2" "https://downloads.yoctoproject.org/releases/yocto/yocto-2.6/poky-thud-20.0.0.tar.bz2"
echo 'ef3d4305054282938bfe70dc5a08eba8a701a22b49795b1c2d8ed5aed90d0581 *poky/poky-2.6.tar.bz2' | sha256sum -c
wget --no-check-certificate -O "$TOP_DIR/poky/poky-2.6.tar.bz2" "https://downloads.yoctoproject.org/releases/yocto/yocto-2.6.4/poky-thud-20.0.4.tar.bz2"

wget --no-check-certificate -O "$TOP_DIR/poky/poky-3.1.tar.bz2" "http://downloads.yoctoproject.org/releases/yocto/yocto-3.1/poky-dunfell-23.0.0.tar.bz2"
echo 'c1f4a486e5f090dbdf50c15a5d22afa6689bd609604b48d63eb0643ad58eb370 *poky/poky-3.1.tar.bz2' | sha256sum -c
wget --no-check-certificate -O "$TOP_DIR/poky/poky-3.1.tar.bz2" "http://downloads.yoctoproject.org/releases/yocto/yocto-3.1.32/poky-dunfell-23.0.32.tar.bz2"

wget --no-check-certificate -O "$TOP_DIR/poky/poky-4.0.tar.bz2" http://downloads.yoctoproject.org/releases/yocto/yocto-4.0/poky-00cfdde791a0176c134f31e5a09eff725e75b905.tar.bz2
echo '4cedb491b7bf0d015768c61690f30d7d73f4266252d6fba907bba97eac83648c *poky/poky-4.0.tar.bz2' | sha256sum -c
wget --no-check-certificate -O "$TOP_DIR/poky/poky-4.0.tar.bz2" "http://downloads.yoctoproject.org/releases/yocto/yocto-4.0.16/poky-54af8c5e80ebf63707ef4e51cc9d374f716da603.tar.bz2"

mkdir "$TOP_DIR/poky/2.6" "$TOP_DIR/poky/3.1" "$TOP_DIR/poky/4.0"
echo "Extracting..."
tar -xf "$TOP_DIR/poky/poky-2.6.tar.bz2" -C "$TOP_DIR/poky/2.6" --strip-components=1
tar -xf "$TOP_DIR/poky/poky-3.1.tar.bz2" -C "$TOP_DIR/poky/3.1" --strip-components=1
tar -xf "$TOP_DIR/poky/poky-4.0.tar.bz2" -C "$TOP_DIR/poky/4.0" --strip-components=1
ln -s ../../pyrex-init-build-env "$TOP_DIR/poky/2.6/"
ln -s ../../pyrex-init-build-env "$TOP_DIR/poky/3.1/"
ln -s ../../pyrex-init-build-env "$TOP_DIR/poky/4.0/"
sha256sum -c <<HEREDOC
9210c22c1f533c09202219ca89317c1ab06d27ac987cc856ee3a6a2aa41ad476 *poky/poky-2.6.tar.bz2
8a80432093ee79a27ea4984bea89f0ca8a9f7de5da3837d69ed4d5a6410bfad6 *poky/poky-3.1.tar.bz2
a53ec3a661cf56ca40c0fbf1500288c2c20abe94896d66a572bc5ccf5d92e9d6 *poky/poky-4.0.tar.bz2
HEREDOC

for v in "2.6" "3.1" "4.0"; do
mkdir "$TOP_DIR/poky/$v"
echo "Extracting $v..."
tar -xf "$TOP_DIR/poky/poky-$v.tar.bz2" -C "$TOP_DIR/poky/$v" --strip-components=1
ln -s ../../pyrex-init-build-env "$TOP_DIR/poky/$v/"
done
32 changes: 27 additions & 5 deletions ci/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,24 @@ def wrapper(self, *args, **kwargs):
return decorator


def minPokyVer(major, minor):
def ver_str(major, minor):
return "%d.%d" % (major, minor)

def decorator(func):
def wrapper(self, *args, **kwargs):
if self.pokyver < (major, minor):
self.skipTest(
"Test cannot be used with poky version < %s (using %s)"
% (ver_str(major, minor), ver_str(*self.pokyver))
)
return func(self, *args, **kwargs)

return wrapper

return decorator


built_images = set()


Expand Down Expand Up @@ -1052,6 +1070,7 @@ def test_templateconf_rel(self):
)
self.assertEqual(s, test_string)

@minPokyVer(3, 1)
def test_top_dir(self):
# Verify that the TOPDIR reported by bitbake in pyrex is the same as
# the one reported by bitbake outside of pyrex
Expand Down Expand Up @@ -1156,6 +1175,9 @@ def test_bb_env_extra_parse(self):
def test_wine(self):
self.assertPyrexContainerCommand("wine --version")

def test_ssh(self):
self.assertPyrexContainerCommand("ssh -V")


class PyrexImageType_oegarmin(PyrexImageType_oe):
"""
Expand All @@ -1179,28 +1201,28 @@ class PyrexImageType_oetest(PyrexImageType_oe):
TEST_IMAGES = (
("ubuntu-14.04-base", (2, 6)),
("ubuntu-16.04-base", (2, 6)),
("ubuntu-18.04-base", (2, 6)),
("ubuntu-18.04-base", (3, 1)),
("ubuntu-20.04-base", (3, 1)),
("ubuntu-22.04-base", (4, 0)),
("ubuntu-14.04-oe", (2, 6)),
("ubuntu-16.04-oe", (2, 6)),
("ubuntu-18.04-oe", (2, 6)),
("ubuntu-18.04-oe", (3, 1)),
("ubuntu-20.04-oe", (3, 1)),
("ubuntu-22.04-oe", (4, 0)),
("ubuntu-14.04-oegarmin", (2, 6)),
("ubuntu-16.04-oegarmin", (2, 6)),
("ubuntu-18.04-oegarmin", (2, 6)),
("ubuntu-18.04-oegarmin", (3, 1)),
("ubuntu-20.04-oegarmin", (3, 1)),
("ubuntu-22.04-oegarmin", (4, 0)),
("ubuntu-18.04-oetest", (2, 6)),
("ubuntu-18.04-oetest", (3, 1)),
("ubuntu-20.04-oetest", (3, 1)),
)


def add_image_tests():
self = sys.modules[__name__]
for provider in PROVIDERS:
for (image, pokyver) in TEST_IMAGES:
for image, pokyver in TEST_IMAGES:
(_, _, image_type) = image.split("-")

parent = getattr(self, "PyrexImageType_" + image_type)
Expand Down
10 changes: 10 additions & 0 deletions image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,8 @@ RUN set -x && export DEBIAN_FRONTEND=noninteractive && \
python-crypto \
python-six \
python3-six \
# Connectivity
ssh \
# An updated version of Git (from the PPA source above)
# that supports doing Yocto externalsrc recipes against free-
# standing working copies that use Git worktrees.
Expand Down Expand Up @@ -459,6 +461,8 @@ RUN set -x && export DEBIAN_FRONTEND=noninteractive && \
python-crypto \
python-six \
python3-six \
# Connectivity
ssh \
# An updated version of Git (from the PPA source above)
# that supports doing Yocto externalsrc recipes against free-
# standing working copies that use Git worktrees.
Expand Down Expand Up @@ -530,6 +534,8 @@ RUN set -x && export DEBIAN_FRONTEND=noninteractive && \
python-crypto \
python-six \
python3-six \
# Connectivity
ssh \
# Corollary to the core Yocto gcc-multilib package. Allows various
# prebuilt native tools to work
g++-multilib \
Expand Down Expand Up @@ -616,6 +622,8 @@ RUN set -x && export DEBIAN_FRONTEND=noninteractive && \
python-crypto \
python-six \
python3-six \
# Connectivity
ssh \
# Corollary to the core Yocto gcc-multilib package. Allows various
# prebuilt native tools to work
g++-multilib \
Expand Down Expand Up @@ -699,6 +707,8 @@ RUN set -x && export DEBIAN_FRONTEND=noninteractive && \
findutils \
# Required for some poorly written 3rd party recipes :(
python3-six \
# Connectivity
ssh \
# Corollary to the core Yocto gcc-multilib package. Allows various
# prebuilt native tools to work
g++-multilib \
Expand Down
Loading