1 #include <zypp/media/MediaManager.h>
2 #include <zypp/base/String.h>
3 #include <zypp/base/Logger.h>
4 #include <zypp/Pathname.h>
5 #include <zypp/PathInfo.h>
6 #include <zypp/TmpPath.h>
7 #include <zypp/ExternalProgram.h>
16 #include <boost/test/unit_test.hpp>
17 #include <boost/test/unit_test.hpp>
19 using boost::unit_test::test_suite;
20 using boost::unit_test::test_case;
22 using namespace zypp::media;
36 #define ONE_STEP(MSG) \
38 DBG << "======================================" << std::endl; \
39 DBG << "==>> " << MSG << std::endl; \
40 DBG << "======================================" << std::endl; \
41 if( do_step) { pause(); if( do_quit) exit(0); } \
44 BOOST_AUTO_TEST_CASE(strange_test)
48 sigemptyset(&sa.sa_mask);
51 sigaction(SIGINT, &sa, NULL);
53 sigaction(SIGTERM, &sa, NULL);
55 // if( argc > 1 && std::string(argv[1]) == "-i")
62 Pathname dir("./suse/setup/descr");
68 ONE_STEP("open " + url.asString());
74 ONE_STEP("provideDirTree(" + dir.asString() + ")");
75 mm.provideDirTree(id, Pathname(dir));
77 ONE_STEP("Create a temporary dir");
78 zypp::filesystem::TmpDir temp;
80 ONE_STEP("Create a copy of " + dir.asString());
81 zypp::filesystem::copy_dir(mm.localPath(id, dir), temp.path());
83 std::string cmd("/bin/ls -lR ");
84 cmd += temp.path().asString();
86 ONE_STEP("Check the directory copy")
91 catch(const MediaException &e)
98 ERR << "Catched *unknown* exception" << std::endl;
102 // vim: set ts=2 sts=2 sw=2 ai et: