From: Duncan Mac-Vicar P Date: Tue, 8 May 2007 01:01:20 +0000 (+0000) Subject: trying to fix key import bug, so lets make test better X-Git-Tag: BASE-SuSE-Linux-10_3-Branch~786 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7609a4ca282317a8796f843c226ab581ca10974b;p=platform%2Fupstream%2Flibzypp.git trying to fix key import bug, so lets make test better --- diff --git a/tests/zypp/KeyRing.cc b/tests/zypp/KeyRing.cc index cc04801..0d40e3a 100644 --- a/tests/zypp/KeyRing.cc +++ b/tests/zypp/KeyRing.cc @@ -11,6 +11,7 @@ #include "zypp/TmpPath.h" #include +#include #include using boost::unit_test::test_suite; @@ -249,25 +250,30 @@ struct KeyRingReceive : public zypp::callback::ReceiveReport }; -void keyring_test() +void keyring_test( const string &dir ) { KeyRingCallbacks keyring_callbacks; KeyRingSignalReceiver receiver; @@ -356,9 +362,25 @@ void keyring_test() test_suite* init_unit_test_suite( int argc, char* argv[] ) { + string datadir; + if (argc < 2) + { + datadir = TESTS_SRC_DIR; + datadir = (Pathname(datadir) + "/zypp/data/KeyRing").asString(); + cout << "keyring_test:" + " path to directory with test data required as parameter. Using " << datadir << endl; + //return (test_suite *)0; + } + else + { + datadir = argv[1]; + } + + std::string const params[] = { datadir }; //set_log_stream( std::cout ); - test_suite* test= BOOST_TEST_SUITE( "PublicKeyTest" ); - test->add( BOOST_TEST_CASE( &keyring_test ), 0 /* expected zero error */ ); - return test; + test_suite* test= BOOST_TEST_SUITE( "PublicKeyTest" ); + test->add(BOOST_PARAM_TEST_CASE( &keyring_test, + (std::string const*)params, params+1)); + return test; } diff --git a/tests/zypp/data/KeyRing/private.asc b/tests/zypp/data/KeyRing/private.asc new file mode 100644 index 0000000..803f0d7 --- /dev/null +++ b/tests/zypp/data/KeyRing/private.asc @@ -0,0 +1,33 @@ +-----BEGIN PGP PRIVATE KEY BLOCK----- +Version: GnuPG v1.4.5 (GNU/Linux) + +lQHhBEY/vAIRBAD2cxLY83P2G1h5TkkKYQY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Lmglel/ +m+MTV05nT6+1KCBqCRUluHqDaCiFHOUOFVWvtirmPJZ/67J78NJpF7huzXvkQraa +tXyHnAyhwiwTZLq2jabMjQgGhV8QyKd4qniSBL+jAAMGCACfH4FGqrs9pGBURmSj +ZKlHAUdnGul0M2KuyJhv8ZBkApUtPcMhZJco50pFpkqjfH7f3xXMRVDP5FpjaRt6 +7abbezp/Dgs8+691OtAREDWbAzarNNR3FbB9fUebh1J2i4W7tfBcoKwKFWJCvqX2 +HGTzVy1k33vnuGCVwC/KiZ/C6pc4DqUwCWNoZNd8hmFadJgx3CMlxSTllsaIyOXp +8dMJ+FFsTmzONzZpFC9DDtpaUeEChCptjWwy5WkQFPe+FOLUH1BnGScQYwGlE8l+ +cFkE7hW8tyOwcx4sk1J/tDCeJ1wE8we1LXMdIiD5ugf3Jej1/98o+hQTHjfkwGqC +GWJV/gMDAq1XPx6FkKCtYI80yXvLiqb3UuzJbGJv5vVmdtsUcwiHhGnyWRd6AbKy +Z0sflw+3PmpqEuAZ8LsdfJv8uIhkWh2W+eDYBrZBJ4IqQogALCf+AMCISQQYEQIA +CQUCRj+8DAIbDAAKCRC9Ydib2Yghvk73AJ9cke9SDyJr+M+nusuWZqzdsJYr0wCc +DHnEr0GsuEal8fCTCJuMQScd4zo= +=7nLA +-----END PGP PRIVATE KEY BLOCK----- diff --git a/tests/zypp/data/KeyRing/public.asc b/tests/zypp/data/KeyRing/public.asc new file mode 100644 index 0000000..ca2aa69 --- /dev/null +++ b/tests/zypp/data/KeyRing/public.asc @@ -0,0 +1,30 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.4.5 (GNU/Linux) + +mQGiBEY/vAIRBAD2cxLY83P2G1h5TkkKYQYTLopgWQh7/7H5UK0cf62gLH7R6F7B +wW4EqmLsm8eGE8kIOob5wCQU6pxpBMv+1UYoO1bohtx4L2JUY5ycJiq4u1CNyRuc +iR3ygsueMRkelkQ2hpNuKvmficOcoazvU3tZM6ITJjV/tQvY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9fUebh1J2i4W7tfBcoKwKFWJCvqX2HGTzVy1k33vnuGCVwC/K +iZ/C6pc4DqUwCWNoZNd8hmFadJgx3CMlxSTllsaIyOXp8dMJ+FFsTmzONzZpFC9D +DtpaUeEChCptjWwy5WkQFPe+FOLUH1BnGScQYwGlE8l+cFkE7hW8tyOwcx4sk1J/ +tDCeJ1wE8we1LXMdIiD5ugf3Jej1/98o+hQTHjfkwGqCGWJViEkEGBECAAkFAkY/ +vAwCGwwACgkQvWHYm9mIIb5O9wCfeI0Ro1UCK/CVT1/BH9NNB0TyYzAAmwdQFE6I +aVStjbDRYEnTHQOGsVy9 +=LiUY +-----END PGP PUBLIC KEY BLOCK----- diff --git a/tests/zypp/data/KeyRing/readme.txt b/tests/zypp/data/KeyRing/readme.txt new file mode 100644 index 0000000..cfab478 --- /dev/null +++ b/tests/zypp/data/KeyRing/readme.txt @@ -0,0 +1,2 @@ +passphrase for the key pair is zypp-devel + diff --git a/tests/zypp/data/KeyRing/repomd.xml b/tests/zypp/data/KeyRing/repomd.xml new file mode 100644 index 0000000..f68f8dc --- /dev/null +++ b/tests/zypp/data/KeyRing/repomd.xml @@ -0,0 +1,21 @@ + + + + + 49589f0e6569914ada9293e8c3895cb899b58a58 + 1177395604 + 67b155adc1e7622f7962849ee43965253a797765 + + + + 4174aed6d4ffb8cfee41b64ae357ce1db3fe904a + 1177395604 + 1981b7db9252974869ce1d71443bde69fa9423ca + + + + 2a72bebe987fb613673d9db73120e95a999f143d + 1177395604 + 6a328b1ec1fab195fb69035c13fe4340ee2b9cbd + + diff --git a/tests/zypp/data/KeyRing/repomd.xml.asc b/tests/zypp/data/KeyRing/repomd.xml.asc new file mode 100644 index 0000000..b3f011a --- /dev/null +++ b/tests/zypp/data/KeyRing/repomd.xml.asc @@ -0,0 +1,16 @@ +-----BEGIN PGP MESSAGE----- +Version: GnuPG v1.4.5 (GNU/Linux) + +owGtkz9oFEEUxs8cATlQSG2zLmiX253/88LeXWUawUobu/nzNrfk9vbY3ZMYECwi +pLCwiU3A1sreJrYW1kK0srNQrLR393JRFDEp0s18fO99M7+Z9+xKt7OydmSODz/s +X39z6VX3re2VOCty39/JJ5ujdyvJqFkED7CssmI6CEk/DgOcusJn061BeO/u5roO +R8NeclIVNOZpNQjHdT3biKJJNp3v9P18G/vo51GOtfGmNlFrDoe9IEjabVA/nOEg +LOoxlgu10SeFM3WTGIxLTAdhW7CoXJjas/W3dsNoaXZjdNvVPF82qsYmHHIQGtIY +pZAAhDe5QIGhdkyDcFYDWKGN0El0Wr1sVmc5VrXJZ0NClGIgZMyT6Ld64ipmOF3/ +V65UlghhvCOoJKWpAkk1B0TOQAoqmFGglBRJ9EeLBYyoveLfWNJsgpOsqquz0Pwy +ngsPUdygl56nqdUubc5HrGwkJpRD4i1LEWJuLhoPAU2s8haooKC4ltCmKcI5sx4l +pAY4Zc6cG8+szHJTPjwLztJ2HjTUKGrRImiVWkmYVMyDt4oRGiMIAwAp4cxf+M8x +jGpL0JHUWAKiCYeYCUeap+CMx4jUgrP+P2iS6GQMh739UXe1087v6Wyvrex+6xyu +fv3xZO/5zU97919eff+leHR069px58XG9urTy3duHxx8PLjxef/1941u+fgn +=9GUB +-----END PGP MESSAGE-----