From f0ad0f949641de619d6f0d5bd0c20ec5ed10dcd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Roth?= Date: Fri, 4 Oct 2024 12:26:44 +0200 Subject: [PATCH 1/3] improve and test grab downloader --- http/grab.go | 8 ++--- system/t04_mirror/UpdateMirror26Test_gold | 33 +++++++++++++++++++ system/t04_mirror/UpdateMirror27Test_gold | 39 +++++++++++++++++++++++ system/t04_mirror/update.py | 31 ++++++++++++++++++ 4 files changed, 106 insertions(+), 5 deletions(-) create mode 100644 system/t04_mirror/UpdateMirror26Test_gold create mode 100644 system/t04_mirror/UpdateMirror27Test_gold diff --git a/http/grab.go b/http/grab.go index 0bad19c5..51fc672b 100644 --- a/http/grab.go +++ b/http/grab.go @@ -59,14 +59,13 @@ func (d *GrabDownloader) DownloadWithChecksum(ctx context.Context, url string, d // Success break } - d.log("Download Error: %v\n", err) if retryableError(err) { maxTries-- - d.log("Retrying download %s: %d\n", url, maxTries) + d.log("Retrying %d %s\n", maxTries, url) time.Sleep(delay) } else { // Can't retry - d.log("Cannot retry download %s\n", url) + d.log("Error (retrying): HTTP code %s while fetching %s\n", err, url) break } } @@ -115,8 +114,7 @@ func (d *GrabDownloader) maybeSetupChecksum(req *grab.Request, expected *utils.C } func (d *GrabDownloader) download(_ context.Context, url string, destination string, expected *utils.ChecksumInfo, ignoreMismatch bool) error { - // TODO clean up dest dir on permanent failure - d.log("Download %s -> %s\n", url, destination) + d.log("Downloading: %s\n", url) req, err := grab.NewRequest(destination, url) if err != nil { diff --git a/system/t04_mirror/UpdateMirror26Test_gold b/system/t04_mirror/UpdateMirror26Test_gold new file mode 100644 index 00000000..aa6d212e --- /dev/null +++ b/system/t04_mirror/UpdateMirror26Test_gold @@ -0,0 +1,33 @@ + + +Applying filter... +Building download queue... +Download queue: 1 items (3.35 KiB) +Downloading & parsing package files... +Downloading: http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/dists/stretch/InRelease +Downloading: http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/dists/stretch/InRelease +Downloading: http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/dists/stretch/Release +Downloading: http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/dists/stretch/Release +Downloading: http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/dists/stretch/Release.gpg +Downloading: http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/dists/stretch/Release.gpg +Downloading: http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/dists/stretch/main/binary-i386/Packages.gz +Downloading: http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/dists/stretch/main/binary-i386/Packages.gz +Downloading: http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/pool/main/b/boost-defaults/libboost-program-options-dev_1.62.0.1_i386.deb +Downloading: http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/pool/main/b/boost-defaults/libboost-program-options-dev_1.62.0.1_i386.deb +Mirror `grab` has been successfully updated. +Packages filtered: 50604 -> 1. +Retrying 0 http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/dists/stretch/InRelease +Retrying 0 http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/dists/stretch/InRelease +gpgv: issuer "debian-release@lists.debian.org" +gpgv: using RSA key 0146DC6D4A0B2914BDED34DB648ACFD622F3D138 +gpgv: using RSA key 067E3C456BAE240ACEE88F6FEF0F382A1A7B6500 +gpgv: using RSA key 16E90B3FDF65EDE3AA7F323C04EE7237B7D453EC +gpgv: using RSA key A7236886F3CCCAAD148A27F80E98404D386FA1D9 +gpgv: Good signature from "Debian Archive Automatic Signing Key (10/buster) " +gpgv: Good signature from "Debian Archive Automatic Signing Key (11/bullseye) " +gpgv: Good signature from "Debian Archive Automatic Signing Key (9/stretch) " +gpgv: Good signature from "Debian Stable Release Key (9/stretch) " +gpgv: Signature made Sat Aug 14 07:43:24 2021 UTC +gpgv: Signature made Sat Aug 14 07:43:25 2021 UTC +gpgv: Signature made Sat Aug 14 08:26:43 2021 UTC +gpgv: Signature made Sat Aug 14 08:46:19 2021 UTC \ No newline at end of file diff --git a/system/t04_mirror/UpdateMirror27Test_gold b/system/t04_mirror/UpdateMirror27Test_gold new file mode 100644 index 00000000..677e80cb --- /dev/null +++ b/system/t04_mirror/UpdateMirror27Test_gold @@ -0,0 +1,39 @@ + + server returned 404 Not Found +Applying filter... +Building download queue... +Download queue: 2 items (6.70 KiB) +Downloading & parsing package files... +Downloading: http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/dists/stretch/InRelease +Downloading: http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/dists/stretch/InRelease +Downloading: http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/dists/stretch/Release +Downloading: http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/dists/stretch/Release +Downloading: http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/dists/stretch/Release.gpg +Downloading: http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/dists/stretch/Release.gpg +Downloading: http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/dists/stretch/main/binary-amd64/Packages.gz +Downloading: http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/dists/stretch/main/binary-amd64/Packages.gz +Downloading: http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/dists/stretch/main/binary-i386/Packages.gz +Downloading: http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/dists/stretch/main/binary-i386/Packages.gz +Downloading: http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/pool/main/b/boost-defaults/libboost-program-options-dev_1.62.0.1_amd64.deb +Downloading: http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/pool/main/b/boost-defaults/libboost-program-options-dev_1.62.0.1_amd64.deb +Downloading: http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/pool/main/b/boost-defaults/libboost-program-options-dev_1.62.0.1_i386.deb +Downloading: http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/pool/main/b/boost-defaults/libboost-program-options-dev_1.62.0.1_i386.deb +ERROR: unable to update: download errors: +Packages filtered: 76844 -> 2. +Retrying 0 http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/dists/stretch/InRelease +Retrying 0 http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/dists/stretch/InRelease +Retrying 0 http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/pool/main/b/boost-defaults/libboost-program-options-dev_1.62.0.1_amd64.deb +Retrying 0 http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/pool/main/b/boost-defaults/libboost-program-options-dev_1.62.0.1_amd64.deb +gpgv: issuer "debian-release@lists.debian.org" +gpgv: using RSA key 0146DC6D4A0B2914BDED34DB648ACFD622F3D138 +gpgv: using RSA key 067E3C456BAE240ACEE88F6FEF0F382A1A7B6500 +gpgv: using RSA key 16E90B3FDF65EDE3AA7F323C04EE7237B7D453EC +gpgv: using RSA key A7236886F3CCCAAD148A27F80E98404D386FA1D9 +gpgv: Good signature from "Debian Archive Automatic Signing Key (10/buster) " +gpgv: Good signature from "Debian Archive Automatic Signing Key (11/bullseye) " +gpgv: Good signature from "Debian Archive Automatic Signing Key (9/stretch) " +gpgv: Good signature from "Debian Stable Release Key (9/stretch) " +gpgv: Signature made Sat Aug 14 07:43:24 2021 UTC +gpgv: Signature made Sat Aug 14 07:43:25 2021 UTC +gpgv: Signature made Sat Aug 14 08:26:43 2021 UTC +gpgv: Signature made Sat Aug 14 08:46:19 2021 UTC \ No newline at end of file diff --git a/system/t04_mirror/update.py b/system/t04_mirror/update.py index e950d981..fb44dd7e 100644 --- a/system/t04_mirror/update.py +++ b/system/t04_mirror/update.py @@ -451,3 +451,34 @@ class UpdateMirror25Test(BaseTest): ] runCmd = "aptly mirror update -keyring=aptlytest.gpg mirror19" outputMatchPrepare = filterOutSignature + + +class UpdateMirror26Test(BaseTest): + """ + update mirrors: regular update, grab downloader + """ + configOverride = {"downloader": "grab"} + sortOutput = True + longTest = False + fixtureGpg = True + fixtureCmds = [ + "aptly mirror create -architectures=i386 -keyring=aptlytest.gpg -filter=libboost-program-options-dev grab http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian stretch main", + ] + runCmd = "aptly mirror update -downloader=grab -keyring=aptlytest.gpg grab" + outputMatchPrepare = filterOutRedirects + + +class UpdateMirror27Test(BaseTest): + """ + update mirrors: failing update, grab downloader + """ + configOverride = {"downloader": "grab"} + sortOutput = True + longTest = False + fixtureGpg = True + fixtureCmds = [ + "aptly mirror create -architectures=amd64,i386 -keyring=aptlytest.gpg -filter=libboost-program-options-dev grab-fail http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian stretch main", + ] + runCmd = "aptly mirror update -downloader=grab -keyring=aptlytest.gpg grab-fail" + outputMatchPrepare = filterOutRedirects + expectedCode = 1 From b2b7f11d17119ab9cf563ec7f7904779011e737d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Roth?= Date: Fri, 4 Oct 2024 12:57:31 +0200 Subject: [PATCH 2/3] ci: remove pip and virtualenv - separate unit tests, benchmark, system tests, flake8 --- .github/workflows/ci.yml | 37 +++++++++++++++++++++++-------------- Makefile | 22 ++++------------------ system/lib.py | 2 +- 3 files changed, 28 insertions(+), 33 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b689dd37..17f28d64 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ env: jobs: test: - name: "System Tests (Ubuntu 22.04)" + name: "Test (Ubuntu 22.04)" runs-on: ubuntu-22.04 continue-on-error: false timeout-minutes: 30 @@ -33,7 +33,7 @@ jobs: - name: "Install packages" run: | sudo apt-get update - sudo apt-get install -y --no-install-recommends graphviz gnupg2 gpgv2 git gcc make devscripts + sudo apt-get install -y --no-install-recommends graphviz gnupg2 gpgv2 git gcc make devscripts python3 python3-requests-unixsocket python3-termcolor python3-swiftclient python3-boto python3-azure-storage python3-etcd3 python3-plyvel flake8 - name: "Checkout repository" uses: actions/checkout@v4 @@ -41,6 +41,10 @@ jobs: # fetch the whole repo for `git describe` to work fetch-depth: 0 + - name: "Run flake8" + run: | + make flake8 + - name: "Read go version from go.mod" run: | gover=$(sed -n 's/^go \(.*\)/\1/p' go.mod) @@ -53,23 +57,28 @@ jobs: with: go-version: ${{ steps.goversion.outputs.GOVER }} - - name: "Setup Python" - uses: actions/setup-python@v4 - with: - python-version: '3.11' - - - name: "Install Python packages" - run: | - pip install six packaging appdirs virtualenv - pip install -U pip setuptools - pip install -r system/requirements.txt - - name: "Install Azurite" id: azuright uses: potatoqualitee/azuright@v1.1 with: directory: ${{ runner.temp }} + - name: "Run Unit Tests" + env: + RUN_LONG_TESTS: 'yes' + AZURE_STORAGE_ENDPOINT: "http://127.0.0.1:10000/devstoreaccount1" + AZURE_STORAGE_ACCOUNT: "devstoreaccount1" + AZURE_STORAGE_ACCESS_KEY: "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==" + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + run: | + sudo mkdir -p /srv ; sudo chown runner /srv + COVERAGE_DIR=${{ runner.temp }} make test + + - name: "Run Benchmark" + run: | + COVERAGE_DIR=${{ runner.temp }} make bench + - name: "Run System Tests" env: RUN_LONG_TESTS: 'yes' @@ -80,7 +89,7 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} run: | sudo mkdir -p /srv ; sudo chown runner /srv - COVERAGE_DIR=${{ runner.temp }} make all + COVERAGE_DIR=${{ runner.temp }} make system-test - name: "Merge code coverage" run: | diff --git a/Makefile b/Makefile index 71a7731a..6e141109 100644 --- a/Makefile +++ b/Makefile @@ -17,8 +17,6 @@ RELEASE=no help: ## Print this help @grep -E '^[a-zA-Z][a-zA-Z0-9_-]*:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' -all: prepare test bench check system-test # used for system tests in ci - prepare: ## Install go module dependencies # set version @make version > VERSION @@ -31,24 +29,12 @@ prepare: ## Install go module dependencies go mod tidy -v go generate -check: system/env -ifeq ($(RUN_LONG_TESTS), yes) - system/env/bin/flake8 -endif - install: @echo "\e[33m\e[1mBuilding aptly ...\e[0m" go generate @out=`mktemp`; if ! go install -v > $$out 2>&1; then cat $$out; rm -f $$out; echo "\nBuild failed\n"; exit 1; else rm -f $$out; fi -system/env: system/requirements.txt -ifeq ($(RUN_LONG_TESTS), yes) - rm -rf system/env - $(PYTHON) -m venv system/env - system/env/bin/pip install -r system/requirements.txt -endif - -system-test: install system/env ## Run system tests in github CI +system-test: install ## Run system tests in github CI ifeq ($(RUN_LONG_TESTS), yes) go generate # install etcd @@ -61,7 +47,7 @@ ifeq ($(RUN_LONG_TESTS), yes) if [ ! -e ~/aptly-fixture-db ]; then git clone https://github.com/aptly-dev/aptly-fixture-db.git ~/aptly-fixture-db/; fi if [ ! -e ~/aptly-fixture-pool ]; then git clone https://github.com/aptly-dev/aptly-fixture-pool.git ~/aptly-fixture-pool/; fi cd /home/runner; curl -O http://repo.aptly.info/system-tests/etcd.db.xz; xz -d etcd.db.xz - PATH=$(BINPATH)/:$(PATH) && . system/env/bin/activate && APTLY_VERSION=$(VERSION) FORCE_COLOR=1 $(PYTHON) system/run.py --long $(TESTS) --coverage-dir $(COVERAGE_DIR) $(CAPTURE) + PATH=$(BINPATH)/:$(PATH) && APTLY_VERSION=$(VERSION) FORCE_COLOR=1 $(PYTHON) system/run.py --long $(TESTS) --coverage-dir $(COVERAGE_DIR) $(CAPTURE) endif docker-test: ## Run system tests @@ -203,7 +189,7 @@ docker-deb: ## Build debian packages in docker container docker-unit-tests: ## Run unit tests in docker container @docker run -it --rm -v ${PWD}:/app aptly-dev /app/system/run-unit-tests -docker-system-tests: ## Run system tests in docker container (add TEST=t04_mirror to run only specific tests) +docker-system-tests: ## Run system tests in docker container (add TEST=t04_mirror or TEST=UpdateMirror26Test to run only specific tests) @docker run -it --rm -v ${PWD}:/app aptly-dev /app/system/run-system-tests $(TEST) docker-dev-server: ## Run development server (auto recompiling) on http://localhost:3142 @@ -223,4 +209,4 @@ clean: ## remove local build and module cache rm -rf build/ docs/ obj-*-linux-gnu* rm -f unit.out aptly.test -.PHONY: help man prepare version binaries docker-release docker-system-tests docker-unit-tests docker-lint docker-build docker-image build docker-shell clean releasetype dpkg dev-server docker-dev-server +.PHONY: help man prepare version binaries docker-release docker-system-tests docker-unit-tests docker-lint docker-build docker-image build docker-shell clean releasetype dpkg dev-server docker-dev-server flake8 diff --git a/system/lib.py b/system/lib.py index 9206c06a..0b170b64 100644 --- a/system/lib.py +++ b/system/lib.py @@ -103,7 +103,7 @@ class DotFinder(object): def find_dot(self, executables): for executable in executables: try: - subprocess.check_output([executable, "-V"], text=True) + subprocess.check_output([executable, "-V"], text=True, stderr=subprocess.DEVNULL) return executable except Exception: pass From 33047c2c5567be189a92e994bbd258d75afd0195 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Roth?= Date: Fri, 4 Oct 2024 18:21:31 +0200 Subject: [PATCH 3/3] cleanup gpg keys - move gpg files to one place - with gpg2, the secretkey parameter is ignored. aptly can also ignore it --- .gitignore | 5 ++-- pgp/gnupg_test.go | 24 +++++++++--------- pgp/internal_test.go | 8 +++--- pgp/keyrings/aptly.pub | Bin 915 -> 0 bytes pgp/keyrings/aptly.sec | Bin 977 -> 0 bytes pgp/keyrings/aptly_passphrase.pub | Bin 915 -> 0 bytes pgp/keyrings/aptly_passphrase.sec | Bin 1052 -> 0 bytes .../files}/aptly2.pub.armor | 0 .../files}/aptly2.sec.armor | 0 .../files}/aptly2_passphrase.pub.armor | 0 .../files}/aptly2_passphrase.sec.armor | 0 .../files}/aptly2_trusted.pub | Bin system/t12_api/publish.py | 1 - 13 files changed, 18 insertions(+), 20 deletions(-) delete mode 100644 pgp/keyrings/aptly.pub delete mode 100644 pgp/keyrings/aptly.sec delete mode 100644 pgp/keyrings/aptly_passphrase.pub delete mode 100644 pgp/keyrings/aptly_passphrase.sec rename {pgp/keyrings => system/files}/aptly2.pub.armor (100%) rename {pgp/keyrings => system/files}/aptly2.sec.armor (100%) rename {pgp/keyrings => system/files}/aptly2_passphrase.pub.armor (100%) rename {pgp/keyrings => system/files}/aptly2_passphrase.sec.armor (100%) rename {pgp/keyrings => system/files}/aptly2_trusted.pub (100%) diff --git a/.gitignore b/.gitignore index f7e71d55..6b1b2081 100644 --- a/.gitignore +++ b/.gitignore @@ -43,9 +43,8 @@ aptly.test build/ -pgp/keyrings/aptly2*.gpg -pgp/keyrings/aptly2*.gpg~ -pgp/keyrings/.#* +system/files/aptly2.gpg~ +system/files/aptly2_passphrase.gpg~ *.creds diff --git a/pgp/gnupg_test.go b/pgp/gnupg_test.go index afc11d2d..d17dbe20 100644 --- a/pgp/gnupg_test.go +++ b/pgp/gnupg_test.go @@ -110,8 +110,8 @@ func (s *Gnupg1SignerSuite) SetUpTest(c *C) { c.Skip(err.Error()) } - s.keyringNoPassphrase = [2]string{"keyrings/aptly.pub", "keyrings/aptly.sec"} - s.keyringPassphrase = [2]string{"keyrings/aptly_passphrase.pub", "keyrings/aptly_passphrase.sec"} + s.keyringNoPassphrase = [2]string{"../system/files/aptly.pub", "../system/files/aptly.sec"} + s.keyringPassphrase = [2]string{"../system/files/aptly_passphrase.pub", "../system/files/aptly_passphrase.sec"} s.passphraseKey = "F30E8CB9CDDE2AF8" s.noPassphraseKey = "21DBB89C16DB3E6D" @@ -119,8 +119,8 @@ func (s *Gnupg1SignerSuite) SetUpTest(c *C) { s.signer.SetBatch(true) s.verifier = &GoVerifier{} - s.verifier.AddKeyring("./keyrings/aptly.pub") - s.verifier.AddKeyring("./keyrings/aptly_passphrase.pub") + s.verifier.AddKeyring("../system/files/aptly.pub") + s.verifier.AddKeyring("../system/files/aptly_passphrase.pub") c.Assert(s.verifier.InitKeyring(false), IsNil) @@ -183,7 +183,7 @@ func (s *Gnupg2SignerSuite) SetUpTest(c *C) { args = append(args, "--pinentry-mode", "loopback") } } - args = append(args, "keyrings/aptly2"+item.suffix+".sec.armor") + args = append(args, "../system/files/aptly2"+item.suffix+".sec.armor") output, err := exec.Command(gpg, args...).CombinedOutput() c.Log(string(output)) @@ -193,14 +193,14 @@ func (s *Gnupg2SignerSuite) SetUpTest(c *C) { // import public keys into gpg2 // we can't use pre-built keyrings as gpg 2.0.x and 2.1+ have different keyring formats for _, suffix := range []string{"", "_passphrase"} { - output, err := exec.Command(gpg, "--no-default-keyring", "--batch", "--keyring", "./keyrings/aptly2"+suffix+".gpg", - "--import", "keyrings/aptly2"+suffix+".pub.armor").CombinedOutput() + output, err := exec.Command(gpg, "--no-default-keyring", "--batch", "--keyring", "../system/files/aptly2"+suffix+".gpg", + "--import", "../system/files/aptly2"+suffix+".pub.armor").CombinedOutput() c.Log(string(output)) c.Check(err, IsNil) } - s.keyringNoPassphrase = [2]string{"./keyrings/aptly2.gpg", ""} - s.keyringPassphrase = [2]string{"./keyrings/aptly2_passphrase.gpg", ""} + s.keyringNoPassphrase = [2]string{"../system/files/aptly2.gpg", ""} + s.keyringPassphrase = [2]string{"../system/files/aptly2_passphrase.gpg", ""} s.noPassphraseKey = "751DF85C2B220D45" s.passphraseKey = "6656CD181E92D2D5" @@ -208,7 +208,7 @@ func (s *Gnupg2SignerSuite) SetUpTest(c *C) { s.signer.SetBatch(true) s.verifier = &GoVerifier{} - s.verifier.AddKeyring("./keyrings/aptly2_trusted.pub") + s.verifier.AddKeyring("../system/files/aptly2_trusted.pub") c.Assert(s.verifier.InitKeyring(false), IsNil) @@ -220,6 +220,6 @@ func (s *Gnupg2SignerSuite) SetUpTest(c *C) { func (s *Gnupg2SignerSuite) TearDownTest(c *C) { s.SignerSuite.TearDownTest(c) - os.Remove("./keyrings/aptly2.gpg") - os.Remove("./keyrings/aptly2_passphrase.gpg") + os.Remove("../system/files/aptly2.gpg") + os.Remove("../system/files/aptly2_passphrase.gpg") } diff --git a/pgp/internal_test.go b/pgp/internal_test.go index 0e31b6ba..8601179f 100644 --- a/pgp/internal_test.go +++ b/pgp/internal_test.go @@ -24,8 +24,8 @@ type GoSignerSuite struct { var _ = Suite(&GoSignerSuite{}) func (s *GoSignerSuite) SetUpTest(c *C) { - s.keyringNoPassphrase = [2]string{"keyrings/aptly.pub", "keyrings/aptly.sec"} - s.keyringPassphrase = [2]string{"keyrings/aptly_passphrase.pub", "keyrings/aptly_passphrase.sec"} + s.keyringNoPassphrase = [2]string{"../system/files/aptly.pub", "../system/files/aptly.sec"} + s.keyringPassphrase = [2]string{"../system/files/aptly_passphrase.pub", "../system/files/aptly_passphrase.sec"} s.passphraseKey = "F30E8CB9CDDE2AF8" s.noPassphraseKey = "21DBB89C16DB3E6D" @@ -33,8 +33,8 @@ func (s *GoSignerSuite) SetUpTest(c *C) { s.signer.SetBatch(true) s.verifier = &GoVerifier{} - s.verifier.AddKeyring("./keyrings/aptly.pub") - s.verifier.AddKeyring("./keyrings/aptly_passphrase.pub") + s.verifier.AddKeyring("../system/files/aptly.pub") + s.verifier.AddKeyring("../system/files/aptly_passphrase.pub") c.Assert(s.verifier.InitKeyring(false), IsNil) diff --git a/pgp/keyrings/aptly.pub b/pgp/keyrings/aptly.pub deleted file mode 100644 index 08758e4302de6ce4f49a2af5c44c3933784c7aaa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 915 zcmV;E18n@60ipy_`=yT&1OU0Xct7+Dh9|KF?G`P|&qxfns=ia+?_C}Z3Q77aY&oDm z=DPPGT}v`rhosG`k(mHKkP*T<;A>!VCtNV^wrbkr>Li1NuVz(`hR_)ne z3th6NpdiQ7<Fwy!G{GEu6DDvIH>J2*jMl!ZAe17%%=dLdNX9~nLZfdb`w!OtYzEZ zU$tG7+;oa-r;o+m6H6^)RKfTUEn;!>+{aCdpam;laCrjBCQ$?bPc%>)c$RkTb8gOo zrva@giIB^900*$mRq4tsG9J{_hH8zMD=;ruT--<4KXg9&0lu4`2*h(Q_s&%G^(Qn2 zVuFZYUd@|3-K+MvV;N!hz-S>vtdu82MEjJB_U#G=RRF%3O;1~3hdN8HZHx{C9 z1CNbQHrRY!)*y&Ov@Jn!bZmJbRAqB?WpW@WWN&UKbRczeWguyEDIh#_Wpi{uVQ_S8 zc`j*gW^X=-VgwTr0stZf0#f^>j{+Mb1`7!Y2Ll2I6$kzyoEjx*d~P+M;6PgR0^f+5npe&Ob>g0mP-)vE<&{=?mIr z23Ur<0SyFF`=yT%1OW6E{*kf_=~7suCOy4D*L(qZ6Ku9KyXE#t+4?gNe8$M_(Kmq- zP;Yssfh76u=2mM8H4M=@hjQBhqbgdyn+ihl14|aY*z!=QmG;cwgo~FYwKN))*q5??(Uw1q1-f`}d!7QG;m{ zd-x)&h$fKs*|h%_ERc**yvS^~>Cd~Ej{+ME0162ZA=|i|7TZ2;IfekBy@su2 pbXyVDebzEULM=)oxk=@Z0G>PR9ZewfiG<^n85QUm&on6Zx23xEox=bC diff --git a/pgp/keyrings/aptly.sec b/pgp/keyrings/aptly.sec deleted file mode 100644 index f90e1c913181ff15a8dc9434d9b43a64ccefee16..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 977 zcmV;?11|iP0lNfJ`=yT&1OU0Xct7+Dh9|KF?G`P|&qxfns=ia+?_C}Z3Q77aY&oDm z=DPPGT}v`rhosG`k(mHKkP*T<;A>!VCtNV^wrbkr>Li1NuVz(`hR_)ne z3th6NpdiQ7<Fwy!G{GEu6DDvIH>J2*jMl!ZAe17%%=dLdNX9~nLZfdb`w!OtYzEZ zU$tG7+;oa-r;o+m6H6^)RKfTUEn;!>+{aCdpam;laCrjBCQ$?bPc%>)c$RkTb8gOo zrva@giIB^900*$mRq4tsG9J{_hH8zMD=;ruT--<4KXg9&0lu4`2*h(Q_s&%G^(Qn2 zVuFZYUd@|3-K+MvV;N!hz-S>vtdu82MEjJB_U#G=RRF%3O;1~3hdN8HZHx{C9 z1CNbQHrRY!)*y&O005w)1dfm)xUZvne1p<;!PnDwZ9?-4)U+)@aCB^WAXH^@bY*fN zC}eMLCv+fnb7dfDbSWS_bY*jNKw)rnY0HE3a(ZB;`uDTtQSlXgu zM=odGfgQv0Qk5Cj1975qb5DQ zLDzf%coS^4GrQ&XN!j`{4}8YR?a?=Z5>Rh>r-3B-?dDc%3N;MTI)`%G9>92-n&|a% z)LlaXfply-t^?#vGJ^2g{?cK~Krj|0&Rn4^{p$0Xv3rm7)`x=C9dStXI_Eb}gm_=( zKriske%2Twp6^Eh0|f*C%KP`9b5Vn76MOg~tB59$_Sv-m7A%mAQM|}(x9QKjnB(_V zXtb9;au%wdN7F+V;=@Y=go{bR&2wgoV)FVDFfpOyZ35#g;O5Kp{lK80cnONvC==;` zMkJTzP8M|J&oob%LA4M)&u6GkeK2k=j4ojRt+6foRS$h2I9E${008;|bEM3c%`#AN zru560gfdK6&xeM|gQ~xG>`LCTiFnl$FNjG57!d*h2?YXD`=yTp8w>yn2@oOMxSST- zK5aRM0H0M8G=^ntPd5ey_o*~SD*~Mfd4vF;U8*?cN<@Qwtw{io%pDp^eS*?nqr;}I-q#?f(6RWI z-OXcvP^lCq*Y(mz1OSYhefdk_v|koHb|0LjoxH?qTlgA$bn7b870Rh(E1cglq~G{> zWL?y~4}83gH#RycF+D%8ydsilZBTai=zl~H98lZSjS(v;$SGmeyYy8*$-j|mLziOa z{obdM51&ogV40AocwqWy+AlT_X#AfTRq$3*Tw5Ulo75{ z5GH^K+7jr|XFr#NX?6%so!OiZh!Wm`05$wkSQradtZH3SskB4Zw%f(MlI2R-7a=l+ z{8{$?w!RKVk-wSPG5bS^_ZEKw8Ne}Uuq?ynS-DDNnLJuM7R5qGzPE3U5p_#<2X?R+ zuJ3`wrlz5JMxYP|v@Jn!bZmJbRAqB?WpW@WWN&UKbRczeWguyEDIh#_Wpi{uVQ_S8 zc`j*gW^X=-VgwTr0stZf0#pF_hXNZT1`7!Y2Ll2I6$kfGlbf zPQGN+gxEe1^{B*lQvX=Ds$?0p8=xACrv5hEUyUMX#wm|s_X7X}1_S`N5*%@3y6^74 z;EF*YS!LmMi4Gt({SiHgpC!7P5z)S3^=$Wb)i;Na;L}$HUX!z_VwFNdy=X0ssjG0#pF_hXNZ60162Z^A3!;&E6{bVvhizhW1^F pQh@M!p0s?4b08k6=4vgD0G>G%4Dudkh>m4~)&`HDtX0QWgp6=$od5s; diff --git a/pgp/keyrings/aptly_passphrase.sec b/pgp/keyrings/aptly_passphrase.sec deleted file mode 100644 index 2ffe24ef89c4e7d10037073e8862f7503f8618cc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1052 zcmV+%1mpXa0pSEx0QiRy1OSd4WNFxt1~o!-S1@skL_54;9Geppna?(rQ9M6;^61m0 zTSc%gL&7ChBb7d0Or!C1EV9=15fqC^yng{ATtzFu#5gJRR62G-ad;H|u8fW1KTwD| zCDAtEgtlGHCcZom-PUPIqgO@njh~(Gx=D-y-tNOz))K;%IhEXR8>;}I-q#?f(6RWI z-OXcvP^lCq*Y(mz1OSYhefdk_v|koHb|0LjoxH?qTlgA$bn7b870Rh(E1cglq~G{> zWL?y~4}83gH#RycF+D%8ydsilZBTai=zl~H98lZSjS(v;$SGmeyYy8*$-j|mLziOa z{obdM51&ogV40AocwqWy+AlT_X#AfTRq$3*Tw5Ulo75{ z5GH^K+7jr|XFr#NX?6%so!OiZh!Wm`05$wkSQradtZH3SskB4Zw%f(MlI2R-7a=l+ z{8{$?w!RKVk-wSPG5bS^_ZEKw8Ne}Uuq?ynS-DDNnLJuM7R5qGzPE3U5p_#<2X?R+ zuJ3`wrlz5JMxYP|{sRL7D=XB?HUmj|U^$$e&t2|=B_YXad=mkJ=kX&cY2vWjGN3nB zD-j=-J1wYJT@3T@DFIFtwk?epcH;rGEkST}Yyg0vjU+3ke7Z0|EvW2m%QT3j`Jd z0|5da0Rk6*0162Z^A3!;&E6{bMJNEA4<(}n&Y3^*){v!(-Bs8-C|2#O0HCM&2wQDL zL1o(Y!zdTRXwe3#C+wX8R|Hf5_=gY#0O}1zeu71#Pm+V%W03BEpY+~@YNsmzLu}9< z&~xP=E_?QwN@)RxScujUPBN7AA^+HG%i6s$B3mGKZ5tj*`G&8FiOB@0g)rSHZ@?Eg zK@T)4WW2ZO_6d|uzGT#d*gg>TsKje>Z zf0g#1l9hhR0AF)>qD$GcIyY`KhK&{VxJh?n50SC%vbZd5af68kggg`TG9C524rc0esPistbb8{ZDgdC~ W)GO}0JmQ4yFg1%k_1g1bkD$UqR@;aG diff --git a/pgp/keyrings/aptly2.pub.armor b/system/files/aptly2.pub.armor similarity index 100% rename from pgp/keyrings/aptly2.pub.armor rename to system/files/aptly2.pub.armor diff --git a/pgp/keyrings/aptly2.sec.armor b/system/files/aptly2.sec.armor similarity index 100% rename from pgp/keyrings/aptly2.sec.armor rename to system/files/aptly2.sec.armor diff --git a/pgp/keyrings/aptly2_passphrase.pub.armor b/system/files/aptly2_passphrase.pub.armor similarity index 100% rename from pgp/keyrings/aptly2_passphrase.pub.armor rename to system/files/aptly2_passphrase.pub.armor diff --git a/pgp/keyrings/aptly2_passphrase.sec.armor b/system/files/aptly2_passphrase.sec.armor similarity index 100% rename from pgp/keyrings/aptly2_passphrase.sec.armor rename to system/files/aptly2_passphrase.sec.armor diff --git a/pgp/keyrings/aptly2_trusted.pub b/system/files/aptly2_trusted.pub similarity index 100% rename from pgp/keyrings/aptly2_trusted.pub rename to system/files/aptly2_trusted.pub diff --git a/system/t12_api/publish.py b/system/t12_api/publish.py index 4ecffbc1..42866421 100644 --- a/system/t12_api/publish.py +++ b/system/t12_api/publish.py @@ -6,7 +6,6 @@ from api_lib import TASK_SUCCEEDED, APITest DefaultSigningOptions = { "Keyring": os.path.join(os.path.dirname(inspect.getsourcefile(APITest)), "files") + "/aptly.pub", - "SecretKeyring": os.path.join(os.path.dirname(inspect.getsourcefile(APITest)), "files") + "/aptly.sec", }