diff options
author | Olivier Thauvin <nanardon@mandriva.org> | 2007-07-02 13:10:35 +0000 |
---|---|---|
committer | Olivier Thauvin <nanardon@mandriva.org> | 2007-07-02 13:10:35 +0000 |
commit | 5a66423d2da34baf0896cf7781868989464b548f (patch) | |
tree | 8eac9949b8a6fc1149af1d2d5103099812cf73bc /t/04mediacfg.t | |
parent | 0dcaef65a3809b25a0d40f9e8c1a4143767818da (diff) | |
download | perl-MDV-Distribconf-5a66423d2da34baf0896cf7781868989464b548f.tar perl-MDV-Distribconf-5a66423d2da34baf0896cf7781868989464b548f.tar.gz perl-MDV-Distribconf-5a66423d2da34baf0896cf7781868989464b548f.tar.bz2 perl-MDV-Distribconf-5a66423d2da34baf0896cf7781868989464b548f.tar.xz perl-MDV-Distribconf-5a66423d2da34baf0896cf7781868989464b548f.zip |
- resync lost file after svn crash
Diffstat (limited to 't/04mediacfg.t')
-rw-r--r-- | t/04mediacfg.t | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/t/04mediacfg.t b/t/04mediacfg.t new file mode 100644 index 0000000..b5c1237 --- /dev/null +++ b/t/04mediacfg.t @@ -0,0 +1,29 @@ +#!/usr/bin/perl + +use strict; +use warnings; +use Test::More tests => 11; + +use MDV::Distribconf::Build; +use_ok('MDV::Distribconf::MediaCFG'); +is(MDV::Distribconf::MediaCFG::_valid_param('foo', 'name', 'toto'), 0, + "Valid value return no error"); + +is(MDV::Distribconf::MediaCFG::_valid_param('foo', 'size', '1'), 0, + "valide size value"); +is(MDV::Distribconf::MediaCFG::_valid_param('foo', 'size', '1k'), 0, + "valide size value"); +is(MDV::Distribconf::MediaCFG::_valid_param('foo', 'size', '1d'), 1, + "non valide size value"); +is(MDV::Distribconf::MediaCFG::_valid_param('foo', 'size', 'coin'), 1, + "non valide size value"); + +my $mdc = MDV::Distribconf::Build->new("testdata/testa"); + +ok($mdc->load, "Can't load distrib tree"); + +ok($mdc->check_index_sync('first'), "Check media hdlist sync with rpms, good case"); +ok(!$mdc->check_index_sync('second'), "Check media hdlist sync with rpms, bad case"); + +ok($mdc->check_media_md5('first_src'), "Check hdlist md5sum validity, good case"); +ok(!$mdc->check_media_md5('second_src'), "Check hdlist md5sum validity, bad case"); |