6 #include <boost/test/unit_test.hpp>
7 #include <boost/test/parameterized_test.hpp>
8 #include <boost/test/unit_test_log.hpp>
10 #include "zypp/base/Logger.h"
12 #include "zypp/PathInfo.h"
13 #include "zypp/TmpPath.h"
14 #include "zypp/repo/yum/Downloader.h"
20 using namespace boost::unit_test;
22 using namespace zypp::repo;
24 #include "tests/zypp/KeyRingTestReceiver.h"
26 void yum_download_test(const string &dir)
28 KeyRingTestReceiver keyring_callbacks;
29 keyring_callbacks.answerTrustKey(true);
31 Pathname p = dir + "/10.2-updates-subset";
32 Url url("dir:" + p.asString());
33 MediaSetAccess media(url);
34 yum::Downloader yum("/");
35 filesystem::TmpDir tmp;
37 Pathname localdir(tmp.path());
39 yum.download(media, localdir);
46 "patch-fetchmsttfonts.sh-2333.xml",
47 "patch-flash-player-2359.xml",
48 "patch-glabels-2348.xml",
50 "patch-openssl-2349.xml",
60 while ( files[i] != NULL )
62 BOOST_CHECK_MESSAGE( PathInfo(localdir + "/repodata/" + files[i] ).isExist(), (string("/repodata/") + files[i]).c_str() );
69 init_unit_test_suite( int argc, char *argv[] )
74 datadir = TESTS_SRC_DIR;
75 datadir = (Pathname(datadir) + "/repo/yum/data").asString();
76 cout << "YUMDownloader_test:"
77 " path to directory with test data required as parameter. Using " << datadir << endl;
78 //return (test_suite *)0;
86 test_suite* test= BOOST_TEST_SUITE("YUMDownloader");
88 std::string const params[] = { datadir };
89 test->add(BOOST_PARAM_TEST_CASE(&yum_download_test,
90 (std::string const*)params, params+1));
94 // vim: set ts=2 sts=2 sw=2 ai et: