Skip to content

Commit

Permalink
test: use lxd for python symlink tests
Browse files Browse the repository at this point in the history
Signed-off-by: Callahan Kovacs <[email protected]>
  • Loading branch information
mr-cal committed Feb 20, 2025
1 parent 6628d64 commit 2b84cb8
Show file tree
Hide file tree
Showing 31 changed files with 120 additions and 16 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def main():
print("hello world")
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env python3

from distutils.core import setup

setup(
name="hello",
version="0.1",
entry_points={"console_scripts": ["hello=hello:main"]},
packages=["hello"],
)

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def main():
print("hello world")
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env python3

from distutils.core import setup

setup(
name="hello",
version="0.1",
entry_points={"console_scripts": ["hello=hello:main"]},
packages=["hello"],
)

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def main():
print("hello world")
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env python3

from distutils.core import setup

setup(
name="hello",
version="0.1",
entry_points={"console_scripts": ["hello=hello:main"]},
packages=["hello"],
)

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def main():
print("hello world")
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env python3

from distutils.core import setup

setup(
name="hello",
version="0.1",
entry_points={"console_scripts": ["hello=hello:main"]},
packages=["hello"],
)

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def main():
print("hello world")
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env python3

from distutils.core import setup

setup(
name="hello",
version="0.1",
entry_points={"console_scripts": ["hello=hello:main"]},
packages=["hello"],
)

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def main():
print("hello world")
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env python3

from distutils.core import setup

setup(
name="hello",
version="0.1",
entry_points={"console_scripts": ["hello=hello:main"]},
packages=["hello"],
)

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def main():
print("hello world")
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env python3

from distutils.core import setup

setup(
name="hello",
version="0.1",
entry_points={"console_scripts": ["hello=hello:main"]},
packages=["hello"],
)

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def main():
print("hello world")
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env python3

from distutils.core import setup

setup(
name="hello",
version="0.1",
entry_points={"console_scripts": ["hello=hello:main"]},
packages=["hello"],
)

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def main():
print("hello world")
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env python3

from distutils.core import setup

setup(
name="hello",
version="0.1",
entry_points={"console_scripts": ["hello=hello:main"]},
packages=["hello"],
)
18 changes: 12 additions & 6 deletions tests/spread/plugins/craft-parts/python-symlinks/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,24 @@ environment:
SNAP/strict_gnome_extension: strict-gnome-extension

restore: |
unset SNAPCRAFT_BUILD_ENVIRONMENT
cd "${SNAP}"
snapcraft clean
rm -f ./*.snap
rm -rf ./squashfs-root
execute: |
unset SNAPCRAFT_BUILD_ENVIRONMENT
cd "${SNAP}"
if [ -f expected-symlink ]; then
snapcraft prime
ls -l prime/bin
[ -x prime/bin/hello ]
[ "$(readlink prime/bin/python3)" == "$(cat expected-symlink)" ]
snapcraft pack
unsquashfs ${SNAP}_1.0_amd64.snap
ls -l squashfs-root/bin
[ -x squashfs-root/bin/hello ]
[ "$(readlink squashfs-root/bin/python3)" == "$(cat expected-symlink)" ]
else
snapcraft prime 2>&1 | MATCH "No suitable Python interpreter found, giving up."
fi
snapcraft prime -v 2>&1 | MATCH "No suitable Python interpreter found, giving up."
fi

0 comments on commit 2b84cb8

Please sign in to comment.