diff --git a/beaker-tests/setup.sh b/beaker-tests/setup.sh index b948f3c..20d823f 100755 --- a/beaker-tests/setup.sh +++ b/beaker-tests/setup.sh @@ -55,11 +55,17 @@ vagrant ssh -c "echo $PUBKEY > /tmp/id_rsa.pub.remote" vagrant ssh -c ' sudo mkdir -p /home/clime/.ssh -sudo touch /home/clime/.ssh/authorized_keys -sudo mv /tmp/id_rsa.pub.remote /home/clime/.ssh/authorized_keys +sudo cp /tmp/id_rsa.pub.remote /home/clime/.ssh/authorized_keys sudo chown -R clime:clime /home/clime/.ssh sudo chmod 700 /home/clime/.ssh sudo chmod 600 /home/clime/.ssh/authorized_keys ' distgit +vagrant ssh -c ' +sudo mkdir -p /root/.ssh +sudo cp /tmp/id_rsa.pub.remote /root/.ssh/authorized_keys +sudo chmod 700 /root/.ssh +sudo chmod 600 /root/.ssh/authorized_keys +' distgit + cd $SCRIPTPATH diff --git a/beaker-tests/tests/basic-test/dist-git.conf b/beaker-tests/tests/basic-test/dist-git.conf new file mode 100644 index 0000000..a6b6aae --- /dev/null +++ b/beaker-tests/tests/basic-test/dist-git.conf @@ -0,0 +1,14 @@ +[dist-git] +git_author_name = Fedora Release Engineering +git_author_email = rel-eng@lists.fedoraproject.org + +cache_dir = /var/lib/dist-git/cache +gitroot_dir = /var/lib/dist-git/git + +gitolite = True +grok = True +fedmsgs = True +old_paths = True +nomd5 = True + +default_namespace = rpms diff --git a/beaker-tests/tests/basic-test/run.sh b/beaker-tests/tests/basic-test/run.sh index 51328bd..c3976d1 100755 --- a/beaker-tests/tests/basic-test/run.sh +++ b/beaker-tests/tests/basic-test/run.sh @@ -16,6 +16,7 @@ rlJournalStart pkgs_cmd 'git config --global user.email "clime@redhat.com"' pkgs_cmd 'git config --global user.name "clime"' pkgs_cmd '/usr/share/dist-git/setup_git_package rpms/prunerepo' + scp -o 'StrictHostKeyChecking no' $SCRIPTDIR/dist-git.conf root@pkgs.example.org:/etc/dist-git/dist-git.conf rlPhaseEnd rlPhaseStartTest BasicTest diff --git a/beaker-tests/tests/direct-test/dist-git-no-namespace.conf b/beaker-tests/tests/direct-test/dist-git-no-namespace.conf new file mode 100644 index 0000000..c5282ab --- /dev/null +++ b/beaker-tests/tests/direct-test/dist-git-no-namespace.conf @@ -0,0 +1,12 @@ +[dist-git] +git_author_name = Fedora Release Engineering +git_author_email = rel-eng@lists.fedoraproject.org + +cache_dir = /var/lib/dist-git/cache +gitroot_dir = /var/lib/dist-git/git + +gitolite = True +grok = True +fedmsgs = True +old_paths = True +nomd5 = True diff --git a/beaker-tests/tests/direct-test/dist-git.conf b/beaker-tests/tests/direct-test/dist-git.conf new file mode 100644 index 0000000..a6b6aae --- /dev/null +++ b/beaker-tests/tests/direct-test/dist-git.conf @@ -0,0 +1,14 @@ +[dist-git] +git_author_name = Fedora Release Engineering +git_author_email = rel-eng@lists.fedoraproject.org + +cache_dir = /var/lib/dist-git/cache +gitroot_dir = /var/lib/dist-git/git + +gitolite = True +grok = True +fedmsgs = True +old_paths = True +nomd5 = True + +default_namespace = rpms diff --git a/beaker-tests/tests/direct-test/run.sh b/beaker-tests/tests/direct-test/run.sh index ed1875a..e2137f3 100755 --- a/beaker-tests/tests/direct-test/run.sh +++ b/beaker-tests/tests/direct-test/run.sh @@ -13,6 +13,7 @@ function pkgs_cmd { rlJournalStart rlPhaseStartSetup DirectTest + scp -o 'StrictHostKeyChecking no' $SCRIPTDIR/dist-git.conf root@pkgs.example.org:/etc/dist-git/dist-git.conf rlPhaseEnd rlPhaseStartTest DirectTest @@ -38,12 +39,26 @@ rlJournalStart resp=`curl --silent -X POST http://pkgs.example.org/repo/pkgs/upload.cgi -F name=foo -F md5sum=80e541f050d558424d62743195481595 -F file=@"$SCRIPTDIR/../../data/prunerepo-1.1-1.fc23.src.rpm"` rlRun "grep -q 'Uploads with md5 are no longer allowed.' <<< '$resp'" + # try operate without default namespacing + scp -o 'StrictHostKeyChecking no' $SCRIPTDIR/dist-git-no-namespace.conf root@pkgs.example.org:/etc/dist-git/dist-git.conf + + pkgs_cmd '/usr/share/dist-git/setup_git_package prunerepo' + rlRun "git clone git://pkgs.example.org/prunerepo.git prunerepo2" + + resp=`curl --silent -X POST http://pkgs.example.org/repo/pkgs/upload.cgi -F name=prunerepo -F sha512sum=a5f31ae7586dae8dc1ca9a91df208893a0c3ab0032ab153c12eb4255f7219e4baec4c7581f353295c52522fee155c64f1649319044fd1bbb40451f123496b6b3 -F file=@"$SCRIPTDIR/../../data/prunerepo-1.1-1.fc23.src.rpm"` + rlRun "grep -q 'stored OK' <<< '$resp'" + + # test of presence of the uploaded file + rlRun 'wget http://pkgs.example.org/repo/pkgs/prunerepo/prunerepo-1.1-1.fc23.src.rpm/sha512/a5f31ae7586dae8dc1ca9a91df208893a0c3ab0032ab153c12eb4255f7219e4baec4c7581f353295c52522fee155c64f1649319044fd1bbb40451f123496b6b3/prunerepo-1.1-1.fc23.src.rpm' + cd $CWD rlPhaseEnd rlPhaseStartCleanup DirectTest pkgs_cmd 'rm -rf /var/lib/dist-git/git/rpms/prunerepo.git' + pkgs_cmd 'rm -rf /var/lib/dist-git/git/prunerepo.git' pkgs_cmd 'sudo rm -rf /var/lib/dist-git/cache/lookaside/pkgs/rpms/prunerepo' + pkgs_cmd 'sudo rm -rf /var/lib/dist-git/cache/lookaside/pkgs/prunerepo' rm -rf $TEST_CWD rlPhaseEnd rlJournalEnd &> /dev/null diff --git a/beaker-tests/tests/fedpkg-test/dist-git.conf b/beaker-tests/tests/fedpkg-test/dist-git.conf new file mode 100644 index 0000000..a6b6aae --- /dev/null +++ b/beaker-tests/tests/fedpkg-test/dist-git.conf @@ -0,0 +1,14 @@ +[dist-git] +git_author_name = Fedora Release Engineering +git_author_email = rel-eng@lists.fedoraproject.org + +cache_dir = /var/lib/dist-git/cache +gitroot_dir = /var/lib/dist-git/git + +gitolite = True +grok = True +fedmsgs = True +old_paths = True +nomd5 = True + +default_namespace = rpms diff --git a/beaker-tests/tests/fedpkg-test/run.sh b/beaker-tests/tests/fedpkg-test/run.sh index 7bf14b7..8a00065 100755 --- a/beaker-tests/tests/fedpkg-test/run.sh +++ b/beaker-tests/tests/fedpkg-test/run.sh @@ -16,6 +16,7 @@ rlJournalStart pkgs_cmd 'git config --global user.email "clime@redhat.com"' pkgs_cmd 'git config --global user.name "clime"' pkgs_cmd '/usr/share/dist-git/setup_git_package rpms/prunerepo' + scp -o 'StrictHostKeyChecking no' $SCRIPTDIR/dist-git.conf root@pkgs.example.org:/etc/dist-git/dist-git.conf rlPhaseEnd rlPhaseStartTest FedpkgTest