Debian Codegraph @

cassandane/Cassandane/Cyrus/Bug3649.pm

raw
1 #!/usr/bin/perl
2 #
3 # Copyright (c) 2011-2017 FastMail Pty Ltd. All rights reserved.
4 #
5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions
7 # are met:
8 #
9 # 1. Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer.
11 #
12 # 2. Redistributions in binary form must reproduce the above copyright
13 # notice, this list of conditions and the following disclaimer in
14 # the documentation and/or other materials provided with the
15 # distribution.
16 #
17 # 3. The name "Fastmail Pty Ltd" must not be used to
18 # endorse or promote products derived from this software without
19 # prior written permission. For permission or any legal
20 # details, please contact
21 # FastMail Pty Ltd
22 # PO Box 234
23 # Collins St West 8007
24 # Victoria
25 # Australia
26 #
27 # 4. Redistributions of any form whatsoever must retain the following
28 # acknowledgment:
29 # "This product includes software developed by Fastmail Pty. Ltd."
30 #
31 # FASTMAIL PTY LTD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
32 # INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
33 # EVENT SHALL OPERA SOFTWARE AUSTRALIA BE LIABLE FOR ANY SPECIAL, INDIRECT
34 # OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
35 # USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
36 # TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
37 # OF THIS SOFTWARE.
38 #
39
40 package Cassandane::Cyrus::Bug3649;
41 use strict;
42 use warnings;
43
44 use lib '.';
45 use base qw(Cassandane::Cyrus::TestCase);
46 use Cassandane::Util::Log;
47 use Cassandane::Instance;
48
49 sub new
50 {
51 my $class = shift;
52 return $class->SUPER::new({ adminstore => 1 }, @_);
53 }
54
55 sub set_up
56 {
57 my ($self) = @_;
58 $self->SUPER::set_up();
59 }
60
61 sub tear_down
62 {
63 my ($self) = @_;
64 $self->SUPER::tear_down();
65 }
66
67 sub test_delete_subuser
68 {
69 my ($self) = @_;
70 my $adminstore = $self->{adminstore};
71 my $admintalk = $adminstore->get_client();
72
73 xlog $self, "Test Cyrus extension which renames a user to a different partition";
74
75 # create and prepare the user
76 $self->{instance}->create_user('admin1');
77 $adminstore->set_folder('user.admin1');
78 for ('A'..'Z') {
79 $self->make_message("Message $_", store => $adminstore);
80 }
81 $admintalk->unselect();
82
83 $admintalk->delete('user.admin1');
84 }
85
86 1;