Author: dmacvicar Date: Mon Nov 3 15:34:09 2008 New Revision: 11566 URL: http://svn.opensuse.org/viewcvs/zypp?rev=11566&view=rev Log: check that files are downloaded too Modified: trunk/libzypp/tests/zypp/Fetcher_test.cc Modified: trunk/libzypp/tests/zypp/Fetcher_test.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/zypp/Fetcher_test.cc?rev=11566&r1=11565&r2=11566&view=diff ============================================================================== --- trunk/libzypp/tests/zypp/Fetcher_test.cc (original) +++ trunk/libzypp/tests/zypp/Fetcher_test.cc Mon Nov 3 15:34:09 2008 @@ -34,6 +34,11 @@ fetcher.enqueueDir(OnMediaLocation("/complexdir"), true); fetcher.start( dest.path(), media ); fetcher.reset(); + + BOOST_CHECK( PathInfo(dest.path() + "/complexdir/subdir2").isExist() ); + BOOST_CHECK( PathInfo(dest.path() + "/complexdir/subdir2/subdir2-file1.txt").isExist() ); + BOOST_CHECK( PathInfo(dest.path() + "/complexdir/subdir1/subdir1-file1.txt").isExist() ); + BOOST_CHECK( PathInfo(dest.path() + "/complexdir/subdir1/subdir1-file2.txt").isExist() ); } } @@ -90,6 +95,12 @@ // enqueue is not digested fetcher.start( dest.path(), media ); fetcher.reset(); + + BOOST_CHECK( PathInfo(dest.path() + "/complexdir-broken/subdir2").isExist() ); + BOOST_CHECK( PathInfo(dest.path() + "/complexdir-broken/subdir2/subdir2-file1.txt").isExist() ); + BOOST_CHECK( PathInfo(dest.path() + "/complexdir-broken/subdir1/subdir1-file1.txt").isExist() ); + BOOST_CHECK( PathInfo(dest.path() + "/complexdir-broken/subdir1/subdir1-file2.txt").isExist() ); + } } @@ -177,6 +188,7 @@ fetcher.enqueue(loc); fetcher.start(dest.path(), media); fetcher.reset(); + BOOST_CHECK( PathInfo(dest.path() + "/contentindex/subdir1/subdir1-file1.txt").isExist() ); } } @@ -194,6 +206,8 @@ fetcher.enqueue(loc); fetcher.start(dest.path(), media); fetcher.reset(); + BOOST_CHECK( PathInfo(dest.path() + "/contentindex-broken-digest/subdir1/subdir1-file1.txt").isExist() ); + // now retrieve a file that is modified, so the checksum has to fail loc = OnMediaLocation("/contentindex-broken-digest/subdir1/subdir1-file2.txt",1); fetcher.enqueue(loc); @@ -240,6 +254,8 @@ fetcher.enqueue(loc); fetcher.start( dest.path(), media ); fetcher.reset(); + BOOST_CHECK( PathInfo(dest.path() + "/contentindex-broken-digest/subdir1/subdir1-file2.txt").isExist() ); + } } @@ -265,6 +281,12 @@ fetcher.reset(); + BOOST_CHECK( PathInfo(dest.path() + "/complexdir/subdir2").isExist() ); + BOOST_CHECK( PathInfo(dest.path() + "/complexdir/subdir2/subdir2-file1.txt").isExist() ); + BOOST_CHECK( PathInfo(dest.path() + "/complexdir/subdir1/subdir1-file1.txt").isExist() ); + BOOST_CHECK( PathInfo(dest.path() + "/complexdir/subdir1/subdir1-file2.txt").isExist() ); + + fetcher.enqueueDir(OnMediaLocation("/complexdir-broken"), true); BOOST_CHECK_THROW( fetcher.start( dest.path(), media ), Exception); -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org