Skip to content

Commit

Permalink
Merge branch 'main' into sgmoore/update_content_version
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiusens authored Mar 25, 2023
2 parents 7cc0a37 + 71ed1a3 commit 3c81696
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 10 deletions.
2 changes: 1 addition & 1 deletion requirements-devel.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ click==8.1.3
codespell==2.2.2
colorama==0.4.6
coverage==7.0.4
craft-archives==0.0.1
craft-archives==0.0.3
craft-cli==1.2.0
craft-grammar==1.1.1
craft-parts==1.18.3
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cffi==1.15.1
chardet==5.1.0
charset-normalizer==2.1.1
click==8.1.3
craft-archives==0.0.1
craft-archives==0.0.3
craft-cli==1.2.0
craft-grammar==1.1.1
craft-parts==1.18.3
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def recursive_data_files(directory, install_directory):
install_requires = [
"attrs",
"click",
"craft-archives==0.0.1",
"craft-archives==0.0.3",
"craft-cli",
"craft-grammar",
"craft-parts",
Expand Down
3 changes: 1 addition & 2 deletions tests/spread/core22/package-repositories/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ environment:
SNAP/test_apt_key_name: test-apt-key-name
SNAP/test_apt_keyserver: test-apt-keyserver
SNAP/test_apt_ppa: test-apt-ppa
SNAP/test_pin: test-pin
SNAPCRAFT_BUILD_ENVIRONMENT: ""

restore: |
cd "$SNAP"
rm -f ./*.snap
snapcraft clean
snapcraft clean --destructive-mode
ls -l /etc/apt/sources.list.d/
rm /etc/apt/sources.list.d/snapcraft-*
snap remove "${SNAP}"
execute: |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----

xsFNBFRt70cBEADH/8Jg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ywktGjduhGE2nM5Q/Kd0S+kovwf9q
wmPMF8BLwUwshZoHKjLmalu08DzoyO6Bfcl6SThlO1iHoSayFnP6hJZeWkTaF/L+
Uzbbfnjz+fWAutUoZSxHsK50VfykqgUiG9t7Kv4q5B/3s7X42O4270yEc4OSZM+Y
Ij3EOKWCgHkR3YH9/wk3w1jPiVKjO+jfZnX7FV77vVxbsR/+ibzEPEo51nWcp64q
bBf+bSSGotGv5ef6ETWw4k0cOF9Dws/zmLs9g9CYpuv5DG5d/pvSUKVmqcb2iEc2
bymJDuKD3kE9MNCqdtnCbwVUpyRauzKhjzY8vmYlFzhlJB5WU0tR6VMMQZNcmXst
1T/RVTcIlXZUYfgbUwvPX6SOLERX1do9vtbD+XvWAYQ/J7G4knHRtf5RpiW1xQkp
FSbrQ9ACQFlqN49Ogbl47J6TZ7BrjDpROote55ixmrU=
=PEEJ
-----END PGP PUBLIC KEY BLOCK-----

Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: test-pin
version: '1.0'
summary: test
description: test
grade: stable
confinement: strict
base: core22

parts:
test-ppa:
plugin: nil
stage-packages:
- test-ppa
override-build: |
apt-cache policy test-ppa
apt-cache policy test-ppa | grep -F "999 http://ppa.launchpad.net/snappy-dev/snapcraft-daily/ubuntu"
craftctl default
package-repositories:
- type: apt
formats: [deb, deb-src]
components: [main]
suites: [focal]
key-id: 78E1918602959B9C59103100F1831DDAFC42E99D
url: http://ppa.launchpad.net/snappy-dev/snapcraft-daily/ubuntu
priority: 999

apps:
test-ppa:
command: usr/bin/test-ppa
12 changes: 7 additions & 5 deletions tests/spread/tools/restore.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#!/bin/sh -e

# Remove any snapcraft-configured apt GPG keys.
rm -f /etc/apt/trusted.gpg.d/snapcraft.gpg

# Remove any snapcraft-configured apt sources.
rm -f /etc/apt/sources.list.d/snapcraft-*
# Remove any snapcraft-configured apt keys and sources.
# Remove keyrings
rm -f /etc/apt/keyrings/craft-*
# Remove repo source files
rm -f /etc/apt/sources.list.d/craft-*
# Remove pin preferences
rm -f /etc/apt/preferences.d/craft-archives

# Remove all auto-installed packages
apt-get autoremove --purge -y
Expand Down
6 changes: 6 additions & 0 deletions tests/unit/parts/test_parts.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ def test_parts_lifecycle_initialize_with_package_repositories_deps_not_installed
"craft_archives.repo.apt_sources_manager."
"AptSourcesManager.install_package_repository_sources"
)
mocker.patch(
"craft_archives.repo.apt_preferences_manager.AptPreferencesManager.write"
)
mocker.patch("craft_parts.packages.Repository.refresh_packages_list")

parts_lifecycle = PartsLifecycle(
Expand Down Expand Up @@ -266,6 +269,9 @@ def test_parts_lifecycle_initialize_with_package_repositories_deps_installed(
"craft_archives.repo.apt_sources_manager."
"AptSourcesManager.install_package_repository_sources"
)
mocker.patch(
"craft_archives.repo.apt_preferences_manager.AptPreferencesManager.write"
)
mocker.patch("craft_parts.packages.Repository.refresh_packages_list")

parts_lifecycle = PartsLifecycle(
Expand Down

0 comments on commit 3c81696

Please sign in to comment.