diff --git a/.gitignore b/.gitignore index 1377554..9183973 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ *.swp +.vagrant diff --git a/.vagrant/machines/distgit/libvirt/action_provision b/.vagrant/machines/distgit/libvirt/action_provision deleted file mode 100644 index ded4fea..0000000 --- a/.vagrant/machines/distgit/libvirt/action_provision +++ /dev/null @@ -1 +0,0 @@ -1.5:4636a095-0c1a-40b8-bd59-8b556bf6875b \ No newline at end of file diff --git a/.vagrant/machines/distgit/libvirt/creator_uid b/.vagrant/machines/distgit/libvirt/creator_uid deleted file mode 100644 index c227083..0000000 --- a/.vagrant/machines/distgit/libvirt/creator_uid +++ /dev/null @@ -1 +0,0 @@ -0 \ No newline at end of file diff --git a/.vagrant/machines/distgit/libvirt/id b/.vagrant/machines/distgit/libvirt/id deleted file mode 100644 index 36c7ff0..0000000 --- a/.vagrant/machines/distgit/libvirt/id +++ /dev/null @@ -1 +0,0 @@ -4636a095-0c1a-40b8-bd59-8b556bf6875b \ No newline at end of file diff --git a/.vagrant/machines/distgit/libvirt/index_uuid b/.vagrant/machines/distgit/libvirt/index_uuid deleted file mode 100644 index b550e27..0000000 --- a/.vagrant/machines/distgit/libvirt/index_uuid +++ /dev/null @@ -1 +0,0 @@ -7406c2e7b0a84342953f8568d9fcf4f0 \ No newline at end of file diff --git a/.vagrant/machines/distgit/libvirt/private_key b/.vagrant/machines/distgit/libvirt/private_key deleted file mode 100644 index 4c2dbf4..0000000 --- a/.vagrant/machines/distgit/libvirt/private_key +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEpQIBAAKCAQEAzERE28zyGAlPETd0HilrWv0P1hNYth/mBmJH8YrDN1Ms28Qa -P+j5j+/vOJ9HaAmshpUv7bHAg/icprzXP97iZErnOfQ67y0dk/u/lkm6ZGXBKKe3 -3Hn8s2hTh1fnGKOmKkcelKjeEzqFXs6L3g/9te0gtweCO7QnJerGfjRYGCkhG0kA -CqVDqgHTV8ZzLK2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deM0yDR+gEji7ohMSQy -6kX4D2FizYDI6LZPsIaxtBr5pxk2m1LDcnvouTxOfFN+Y2fXfTQddYUAXHpvEMdl -4Bc9168snZHGqUPCNOgKSh3B9LIbykg8CBoXZp5oohj48n+V5dgiBbXu4WbqN8j0 -XtCn04ECgYEAvdGtX4oI19C3k0I8RemElmYXbBtQ/z4/IPcCHi+3IdrIPxD/gxJC -KRDViEx6fnKenUu83IOlyy+hQiTbv+7k0ARnbcRdGnMi7AC8E1pIrSlfFw5yoWgi -tuhoVxVNJkoqZ8V87aagC1Usme45fISGW3lNDU2ai7qG6aXxWbM3IVk= ------END RSA PRIVATE KEY----- diff --git a/.vagrant/machines/distgit/libvirt/synced_folders b/.vagrant/machines/distgit/libvirt/synced_folders deleted file mode 100644 index 801d365..0000000 --- a/.vagrant/machines/distgit/libvirt/synced_folders +++ /dev/null @@ -1 +0,0 @@ -{"rsync":{"/vagrant":{"type":"rsync","guestpath":"/vagrant","hostpath":"/home/clime/dist-git","disabled":false,"__vagrantfile":true,"owner":"vagrant","group":"vagrant"}}} \ No newline at end of file diff --git a/Vagrantfile b/Vagrantfile index 63cdc13..47d8a0a 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -9,9 +9,15 @@ Vagrant.configure(2) do |config| distgit.vm.synced_folder ".", "/vagrant", type: "rsync" + # setup test user distgit.vm.provision "shell", - inline: "echo 'nameserver 8.8.8.8' >> /etc/resolv.conf", - run: "always" + inline: "useradd clime -G packager" + + distgit.vm.provision "shell", + inline: "echo 'clime ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers" + + distgit.vm.provision "shell", + inline: "echo 'nameserver 8.8.8.8' >> /etc/resolv.conf" # Update the system distgit.vm.provision "shell", @@ -28,46 +34,33 @@ Vagrant.configure(2) do |config| inline: "cd /vagrant/ && tito build -i --test --rpm", run: "always" - distgit.vm.provision "shell", - inline: "cp /etc/httpd/conf.d/dist-git/lookaside-upload.conf.example /etc/httpd/conf.d/dist-git/lookaside-upload.conf", - run: "always" - distgit.vm.provision "file", - source: "./beaker-tests/pkgs-files/pkgs.example.org.pem", destination: "/tmp/pkgs.example.org.pem", + source: "./beaker-tests/pkgs-files/", destination: "/tmp/", run: "always" distgit.vm.provision "shell", - inline: "mv /tmp/pkgs.example.org.pem /etc/pki/tls/certs/pkgs.example.org.pem && restorecon -R /etc/pki/tls/certs/", - run: "always" - - distgit.vm.provision "file", - source: "./beaker-tests/pkgs-files/ca-bundle.crt", destination: "/tmp/ca-bundle.crt", + inline: "mv /tmp/pkgs-files/pkgs.example.org.pem /etc/pki/tls/certs/pkgs.example.org.pem && restorecon -R /etc/pki/tls/certs/", run: "always" distgit.vm.provision "shell", - inline: "mv /tmp/ca-bundle.crt /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem && restorecon -R /etc/pki/ca-trust/extracted/pem/", + inline: "mv /tmp/pkgs-files/ca-bundle.crt /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem && restorecon -R /etc/pki/ca-trust/extracted/pem/", + run: "always" + + distgit.vm.provision "shell", + inline: "mv /tmp/pkgs-files/lookaside-upload.conf /etc/httpd/conf.d/dist-git/ && restorecon -R /etc/httpd/conf.d/dist-git/", run: "always" distgit.vm.provision "shell", inline: "systemctl enable dist-git.socket && systemctl restart dist-git.socket", run: "always" - distgit.vm.provision "shell", - inline: "rm -f /etc/httpd/conf.d/ssl.conf", # remove default ssl config for it conflicts with lookaside-upload.conf - run: "always" - distgit.vm.provision "shell", inline: "systemctl enable httpd && systemctl restart httpd", run: "always" distgit.vm.provision "shell", - inline: "useradd clime -G packager" - - distgit.vm.provision "shell", - inline: "echo 'clime ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers" - - distgit.vm.provision "shell", - inline: "dnf install -y python-grokmirror" + inline: "dnf install -y python-grokmirror", + run: "always" end end diff --git a/beaker-tests/pkgs-files/ca-bundle.crt b/beaker-tests/files/etc/pki/tls/certs/ca-bundle.crt similarity index 100% rename from beaker-tests/pkgs-files/ca-bundle.crt rename to beaker-tests/files/etc/pki/tls/certs/ca-bundle.crt diff --git a/beaker-tests/files/etc/rpkg/fedpkg.conf b/beaker-tests/files/etc/rpkg/fedpkg.conf index b5c5e56..8a88d4d 100644 --- a/beaker-tests/files/etc/rpkg/fedpkg.conf +++ b/beaker-tests/files/etc/rpkg/fedpkg.conf @@ -1,6 +1,6 @@ [fedpkg] lookaside = http://pkgs.example.org/repo/pkgs -lookasidehash = md5 +lookasidehash = sha512 lookaside_cgi = https://pkgs.example.org/repo/pkgs/upload.cgi gitbaseurl = ssh://clime@pkgs.example.org/%(module)s anongiturl = git://pkgs.example.org/%(module)s diff --git a/beaker-tests/pkgs-files/lookaside-upload.conf b/beaker-tests/pkgs-files/lookaside-upload.conf new file mode 100644 index 0000000..fd044df --- /dev/null +++ b/beaker-tests/pkgs-files/lookaside-upload.conf @@ -0,0 +1,24 @@ + + # This alias must come before the /repo/ one to avoid being overridden. + ScriptAlias /repo/pkgs/upload.cgi /var/lib/dist-git/web/upload.cgi + + Alias /repo/ /var/lib/dist-git/cache/lookaside/ + + ServerName pkgs.example.org + ServerAdmin webmaster@fedoraproject.org + + SSLCertificateFile /etc/pki/tls/certs/pkgs.example.org.pem + SSLCertificateKeyFile /etc/pki/tls/certs/pkgs.example.org.pem + SSLCACertificateFile /etc/pki/tls/certs/ca-bundle.crt + + LogLevel trace8 + + # provide this manually for upload.cgi + SetEnv SSL_CLIENT_S_DN_CN clime + + + Options +ExecCGI + Require all granted + + + diff --git a/beaker-tests/setup.sh b/beaker-tests/setup.sh index a614f79..b5fe4e9 100755 --- a/beaker-tests/setup.sh +++ b/beaker-tests/setup.sh @@ -24,9 +24,7 @@ dnf -y install vagrant-libvirt dnf -y install jq dnf -y install git dnf -y install wget -dnf -y --best install fedpkg - -dnf -y downgrade fedpkg --allowerasing # FIXME: the dist-git Vagrantfile is not compatible with fedpkg-1.26 due to it not sending server cert +dnf -y install fedpkg # enable libvirtd for Vagrant (distgit) systemctl enable libvirtd && systemctl start libvirtd diff --git a/beaker-tests/tests/basic-test/run.sh b/beaker-tests/tests/basic-test/run.sh index b4f3494..73851a2 100755 --- a/beaker-tests/tests/basic-test/run.sh +++ b/beaker-tests/tests/basic-test/run.sh @@ -32,7 +32,7 @@ rlJournalStart rlRun "fedpkg import --skip-diffs ../prunerepo-1.1-1.fc23.src.rpm" # test of presence of the uploaded file - rlRun 'wget http://pkgs.example.org/repo/pkgs/prunerepo/prunerepo-1.1.tar.gz/md5/c5af09c7fb2c05e556898c93c62b1e35/prunerepo-1.1.tar.gz' + rlRun 'wget http://pkgs.example.org/repo/pkgs/prunerepo/prunerepo-1.1.tar.gz/sha512/6a6a30c0e8c661176ba0cf7e8f1909a493a298fd5088389f5eb630b577dee157106e5f89dc429bcf2a6fdffe4bc10b498906b9746220882827560bc5f72a1b01/prunerepo-1.1.tar.gz' # commit of spec and updated sources and push into the git repo rlRun "git add -A && git commit -m 'test commit'" @@ -79,6 +79,6 @@ rlJournalStart rlPhaseStartCleanup BasicTest rm -rf $TESTPATH/prunerepo $TESTPATH/prunerepo-copy* $TESTPATH/prunerepo2 $TESTPATH/prunerepo-1.1.tar.gz $TESTPATH/manifest* pkgs_cmd 'rm -rf /var/lib/dist-git/git/prunerepo.git' - #pkgs_cmd 'sudo rm -rf /var/lib/dist-git/cache/lookaside/pkgs/prunerepo' + pkgs_cmd 'sudo rm -rf /var/lib/dist-git/cache/lookaside/pkgs/prunerepo' rlPhaseEnd rlJournalEnd &> /dev/null diff --git a/beaker-tests/tests/manifest.js.prev b/beaker-tests/tests/manifest.js.prev deleted file mode 100644 index ca94947..0000000 --- a/beaker-tests/tests/manifest.js.prev +++ /dev/null @@ -1 +0,0 @@ -{"/prunerepo.git": {"owner": null, "fingerprint": "915058d82e629002f80ce05cc5e0d768794fea02", "description": "prunerepo", "reference": null, "modified": 1500904204}} \ No newline at end of file diff --git a/beaker-tests/tests/prunerepo-copy b/beaker-tests/tests/prunerepo-copy deleted file mode 160000 index e40ea73..0000000 --- a/beaker-tests/tests/prunerepo-copy +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e40ea73f6e4fbc1b3eeb921bc98b5800aaee9ada diff --git a/beaker-tests/tests/prunerepo-copy2 b/beaker-tests/tests/prunerepo-copy2 deleted file mode 160000 index e40ea73..0000000 --- a/beaker-tests/tests/prunerepo-copy2 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e40ea73f6e4fbc1b3eeb921bc98b5800aaee9ada diff --git a/beaker-tests/tests/sources b/beaker-tests/tests/sources deleted file mode 100644 index 90af5e5..0000000 --- a/beaker-tests/tests/sources +++ /dev/null @@ -1 +0,0 @@ -manifest test