#!/usr/bin/perl

# Copryight (C) 2004-2005  Joshua Hoblitt
#
# $Id: 10_server_is_valid_volume_name.t,v 1.3 2007-03-28 22:02:11 jhoblitt Exp $

use strict;
use warnings FATAL => qw( all );

use Test::More tests => 3;

use lib qw( ./t ./lib );

use Nebulous::Server;
use Nebulous::Util qw( :standard );
use Test::Nebulous;

my $neb = Nebulous::Server->new(
    dsn         => "DBI:mysql:database=test:host=localhost",
    dbuser      => "test",
    dbpasswd    => "",
);

Test::Nebulous->setup;

ok($neb->_is_valid_volume_name('node01'), "valid volume name");

Test::Nebulous->setup;

ok($neb->_is_valid_volume_name('node02'), "valid volume name");

Test::Nebulous->setup;

is($neb->_is_valid_volume_name('node99'), undef, "invalid volume name");

Test::Nebulous->cleanup;
