8 my $moga = MogileFS
::Admin
->new(hosts
=> ['127.0.0.1:7001']);
9 my $doms = eval { $moga->get_domains };
12 plan skip_all
=> "No mogilefsd process running on 127.0.0.1:7001";
18 my $test_ns = "_MogileFS::Client::TestSuite";
20 if ($doms->{$test_ns}) {
21 pass
("test namespace already exists");
23 ok
($moga->create_domain($test_ns), "created test namespace");
26 my $mogc = MogileFS
::Client
->new(hosts
=> ['127.0.0.1:7001'],
28 ok
($mogc, "made mogile client object");
31 my $fh = $mogc->new_file("test_file1", "bogus_class");
32 ok
(! $fh, "got a filehandle");
33 is
($mogc->errcode, "unreg_class", "got correct error about making file in bogus class");
35 $fh = $mogc->new_file("test_file1");
36 ok
($fh, "filehandle in general class");
38 my $data = "0123456789" x
500;
39 my $wv = (print $fh $data);
40 is
($wv, length $data, "wrote data bytes out");
41 ok
($fh->close, "closed successfully");
43 ok
(scalar $mogc->get_paths("test_file1") >= 1, "exists in one or more places");
45 ok
($mogc->delete("test_file1"), "deleted test file");
47 ok
($moga->delete_domain($test_ns), "deleted test namespace");