Skip to content

Commit

Permalink
Merge pull request #3975 from cyrusimap/cass-high-port
Browse files Browse the repository at this point in the history
PortManager: start at port 29100
  • Loading branch information
ksmurchison authored Oct 2, 2024
2 parents 53ad74e + 400da32 commit a651631
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 13 deletions.
5 changes: 2 additions & 3 deletions cassandane/Cassandane/PortManager.pm
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,8 @@ sub alloc
die "Invalid TEST_UNIT_WORKER_ID - code not run in Worker context"
if (defined($workerid) && $workerid eq 'invalid');
my $cassini = Cassandane::Cassini->instance();
my $cassini_base_port = $cassini->val('cassandane', 'base_port') // 0;
$base_port = 0 + $cassini_base_port || 9100;
$base_port += $max_ports * ($workerid-1);
my $cassandane_base_port = 0 + $cassini->val('cassandane', 'base_port', '29100');
$base_port = $cassandane_base_port + $max_ports * ($workerid-1);
}
for (my $i = 0 ; $i < $max_ports ; $i++)
{
Expand Down
2 changes: 1 addition & 1 deletion cassandane/Cassandane/Test/Cassini.pm
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ sub test_environment_override
'cassandane.pwcheck' => 'alwaystrue',
'cassandane.cleanup' => 'no',
'cassandane.maxworkers' => '1',
'cassandane.base_port' => '9100',
'cassandane.base_port' => '29100',
'cassandane.suppress' => '',
'valgrind.enabled' => 'no',
'valgrind.binary' => '/usr/bin/valgrind',
Expand Down
12 changes: 6 additions & 6 deletions cassandane/Cassandane/Test/MessageStoreFactory.pm
Original file line number Diff line number Diff line change
Expand Up @@ -91,28 +91,28 @@ sub test_uri
$self->assert(ref $ms eq 'Cassandane::MaildirMessageStore');
$self->assert($ms->{directory} eq '/foo/bar');

$ms = Cassandane::MessageStoreFactory->create(uri => 'imap://victoria:secret@foo.com:9143/inbox.foo');
$ms = Cassandane::MessageStoreFactory->create(uri => 'imap://victoria:secret@foo.com:29143/inbox.foo');
$self->assert(ref $ms eq 'Cassandane::IMAPMessageStore');
$self->assert($ms->{username} eq 'victoria');
$self->assert($ms->{password} eq 'secret');
$self->assert($ms->{host} eq 'foo.com');
$self->assert($ms->{port} == 9143);
$self->assert($ms->{port} == 29143);
$self->assert($ms->{folder} eq 'inbox.foo');

$ms = Cassandane::MessageStoreFactory->create(uri => 'imap://victoria@foo.com:9143/inbox.foo');
$ms = Cassandane::MessageStoreFactory->create(uri => 'imap://victoria@foo.com:29143/inbox.foo');
$self->assert(ref $ms eq 'Cassandane::IMAPMessageStore');
$self->assert($ms->{username} eq 'victoria');
$self->assert(!defined $ms->{password});
$self->assert($ms->{host} eq 'foo.com');
$self->assert($ms->{port} == 9143);
$self->assert($ms->{port} == 29143);
$self->assert($ms->{folder} eq 'inbox.foo');

$ms = Cassandane::MessageStoreFactory->create(uri => 'imap://foo.com:9143/inbox.foo');
$ms = Cassandane::MessageStoreFactory->create(uri => 'imap://foo.com:29143/inbox.foo');
$self->assert(ref $ms eq 'Cassandane::IMAPMessageStore');
$self->assert(!defined $ms->{username});
$self->assert(!defined $ms->{password});
$self->assert($ms->{host} eq 'foo.com');
$self->assert($ms->{port} == 9143);
$self->assert($ms->{port} == 29143);
$self->assert($ms->{folder} eq 'inbox.foo');

$ms = Cassandane::MessageStoreFactory->create(uri => 'imap://foo.com/inbox.foo');
Expand Down
2 changes: 1 addition & 1 deletion cassandane/cassandane.ini.example
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
##maxworkers = 1
# Base port number to use. All Cyrus instances run by Cassandane
# will listen at ports starting from this number.
##base_port = 9100
##base_port = 29100
# A list of tests or suites which will be suppressed. These tests
# will still run if requested on the command line, but will not be
# run by default.
Expand Down
2 changes: 1 addition & 1 deletion cassandane/genmail3.pl
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ sub usage
my %params = (
type => 'imap',
host => 'localhost',
port => 9100,
port => 29100,
folder => 'inbox',
username => 'cassandane',
password => 'testpw',
Expand Down
2 changes: 1 addition & 1 deletion cassandane/imap-append.pl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ sub usage
my %imap_params = (
type => 'imap',
host => 'localhost',
port => 9100,
port => 29100,
folder => 'inbox',
username => 'cassandane',
password => 'testpw',
Expand Down

0 comments on commit a651631

Please sign in to comment.