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>
18 using boost::unit_test::test_suite;
19 using boost::unit_test::test_case;
21 using namespace zypp::media;
35 #define ONE_STEP(MSG) \
37 DBG << "======================================" << std::endl; \
38 DBG << "==>> " << MSG << std::endl; \
39 DBG << "======================================" << std::endl; \
40 if( do_step) { pause(); if( do_quit) exit(0); } \
43 BOOST_AUTO_TEST_CASE(strange_test)
47 sigemptyset(&sa.sa_mask);
50 sigaction(SIGINT, &sa, NULL);
52 sigaction(SIGTERM, &sa, NULL);
54 // if( argc > 1 && std::string(argv[1]) == "-i")
61 Pathname dir("./suse/setup/descr");
67 ONE_STEP("open " + url.asString());
73 ONE_STEP("provideDirTree(" + dir.asString() + ")");
74 mm.provideDirTree(id, Pathname(dir));
76 ONE_STEP("Create a temporary dir");
77 zypp::filesystem::TmpDir temp;
79 ONE_STEP("Create a copy of " + dir.asString());
80 zypp::filesystem::copy_dir(mm.localPath(id, dir), temp.path());
82 std::string cmd("/bin/ls -lR ");
83 cmd += temp.path().asString();
85 ONE_STEP("Check the directory copy")
90 catch(const MediaException &e)
97 ERR << "Catched *unknown* exception" << std::endl;
101 // vim: set ts=2 sts=2 sw=2 ai et: