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