1 # Copyright (c) 2010-2012 Zmanda, Inc. All Rights Reserved.
3 # This program is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU General Public License
5 # as published by the Free Software Foundation; either version 2
6 # of the License, or (at your option) any later version.
8 # This program is distributed in the hope that it will be useful, but
9 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 # You should have received a copy of the GNU General Public License along
14 # with this program; if not, write to the Free Software Foundation, Inc.,
15 # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 # Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300
18 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
20 use Test::More tests => 31;
24 use lib "@amperldir@";
29 # put the debug messages somewhere
30 Amanda::Debug::dbopen("installcheck");
31 Installcheck::log_test_output();
33 # some round-trip tests
52 aaaaaaaaaaaaaaaaaaaaaa
53 aaaaaaaaaaaaaaaaaaaaaaa
54 aaaaaaaaaaaaaaaaaaaaaaaaaaaa
55 aaaaaaaaaaaaaaaaaaaaaaaaaaaaa
56 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
57 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
58 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
59 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
61 # (note that odd-length strings will trigger a warning)
62 my $feat = Amanda::Feature::Set->from_string($str);
63 my $str2 = $feat->as_string();
64 my $feat2 = Amanda::Feature::Set->from_string($str2);
65 my $str3 = $feat2->as_string();
66 is($str2, $str3, "round-trip '$str' -> '$str2'")
69 # check the various constructors
70 like((Amanda::Feature::Set->old())->as_string(),
73 like((Amanda::Feature::Set->mine())->as_string(),
78 my $feat = Amanda::Feature::Set->mine();
79 ok($feat->has($Amanda::Feature::fe_amrecover_feedme_tape),
80 "'mine' features include fe_amrecover_feedme_tape");
81 $feat->remove($Amanda::Feature::fe_amrecover_feedme_tape);
82 ok(!$feat->has($Amanda::Feature::fe_amrecover_feedme_tape),
83 "fe_amrecover_feedme_tape removed");
85 $feat = Amanda::Feature::Set->old();
86 ok(!$feat->has($Amanda::Feature::fe_req_xml),
87 "old set does not have fe_req_xml");
88 $feat->add($Amanda::Feature::fe_req_xml);
89 ok($feat->has($Amanda::Feature::fe_req_xml),