1 # Copyright (c) 2010-2012 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;
23 use lib "@amperldir@";
28 # put the debug messages somewhere
29 Amanda::Debug::dbopen("installcheck");
30 Installcheck::log_test_output();
32 # some round-trip tests
51 aaaaaaaaaaaaaaaaaaaaaa
52 aaaaaaaaaaaaaaaaaaaaaaa
53 aaaaaaaaaaaaaaaaaaaaaaaaaaaa
54 aaaaaaaaaaaaaaaaaaaaaaaaaaaaa
55 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
56 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
57 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
58 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
60 # (note that odd-length strings will trigger a warning)
61 my $feat = Amanda::Feature::Set->from_string($str);
62 my $str2 = $feat->as_string();
63 my $feat2 = Amanda::Feature::Set->from_string($str2);
64 my $str3 = $feat2->as_string();
65 is($str2, $str3, "round-trip '$str' -> '$str2'")
68 # check the various constructors
69 like((Amanda::Feature::Set->old())->as_string(),
72 like((Amanda::Feature::Set->mine())->as_string(),
77 my $feat = Amanda::Feature::Set->mine();
78 ok($feat->has($Amanda::Feature::fe_amrecover_feedme_tape),
79 "'mine' features include fe_amrecover_feedme_tape");
80 $feat->remove($Amanda::Feature::fe_amrecover_feedme_tape);
81 ok(!$feat->has($Amanda::Feature::fe_amrecover_feedme_tape),
82 "fe_amrecover_feedme_tape removed");
84 $feat = Amanda::Feature::Set->old();
85 ok(!$feat->has($Amanda::Feature::fe_req_xml),
86 "old set does not have fe_req_xml");
87 $feat->add($Amanda::Feature::fe_req_xml);
88 ok($feat->has($Amanda::Feature::fe_req_xml),