Closed GoogleCodeExporter closed 9 years ago
As a thinking exercise, I spec'd this out in cucumber syntax. Whether it makes
sense
to use cucumber itself while implementing this is not all that important, but
tests
should be written that assert the following (unless someone decides this really
isn't
what we want):
Feature: TCP/UDP ports need to follow unless explicitly told not to
In order to close issue memcached issue 67
I need to make TCP and UDP ports definitions be a little less surprising
Scenario: Specifying no ports
Given a memcached binary
When I run memcached with no arguments
Then memcached should be listening on TCP port 11211
And memcached should be listening on UDP port 11211
Scenario: Specifying only a TCP port
Given a memcached binary
When I run memcached with -p11212
Then memcached should be listening on TCP port 11212
And memcached should be listening on UDP port 11212
Scenario: Specifying only a UDP port
Given a memcached binary
When I run memcached with -U11212
Then memcached should be listening on TCP port 11212
And memcached should be listening on UDP port 11212
Scenario: Specifying a TCP emphemeral port only
Given a memcached binary
When I run memcached with -p -1
Then memcached should be listening on an ephemeral TCP port
And memcached should be listening on an ephemeral UDP port
Scenario: Specifying a UDP ephemeral port only
Given a memcached binary
When I run memcached with -U -1
Then memcached should be listening on an ephemeral TCP port
And memcached should be listening on an ephemeral UDP port
Scenario: Specifying the TCP port is disabled
Given a memcached binary
When I run memcached with -p -1
Then memcached should not be listening on any TCP port
And memcached should not be listening on any UDP port
Scenario: Specifying the UDP port is disabled
Given a memcached binary
When I run memcached with -U -1
Then memcached should not be listening on any TCP port
And memcached should not be listening on any UDP port
Scenario: Specifying a TCP port and a UDP port
Given a memcached binary
When I run memcached with -p 11212 -U 11213
Then memcached should be listening on TCP port 11212
And memcached should be listening on UDP port 11213
Scenario: Specifying a TCP port and disabling UDP
Given a memcached binary
When I run memcached with -p 11212 -U 0
Then memcached should be listening on TCP port 11212
And memcached should not be listening on any UDP port
Scenario: Specifying a UDP port and disabling TCP
Given a memcached binary
When I run memcached with -U 11212 -p 0
Then memcached should be listening on UDP port 11212
And memcached should not be listening on any TCP port
Scenario: Specifying a TCP port and an ephemeral UDP port
Given a memcached binary
When I run memcached with -p 11212 -U -1
Then memcached should be listening on TCP port 11212
And memcached should be listening on an ephemeral UDP port
Scenario: Specifying a UDP port and an ephemeral TCP port
Given a memcached binary
When I run memcached with -U 11212 -p -1
Then memcached should be listening on UDP port 11212
And memcached should be listening on an ephemeral TCP port
Original comment by dsalli...@gmail.com
on 22 Sep 2009 at 4:12
Dustin,
I'll work out a Perl test that uses this scenario.
--Patrick
Original comment by CaptTo...@gmail.com
on 24 Sep 2009 at 4:09
May be instead assume that listen defaults are "-p 11211 -U 11211" and anything
that
specifies -p and/or -U overrides defaults? I.e.
memcached: listens on tcp 11211 and udp 11211
memcached -p 11212: listens on tcp 11212 only
memcached -U 11212: listens on udp 11212 only
memcached -p 11212 -U 11212: listens on tcp 11212 and udp 11212
Original comment by mdou...@gmail.com
on 24 Sep 2009 at 4:51
mdounin -- I do like this idea. We had this discussion in an email thread and
it
turned into a bikeshed. No two participants so far agree on the behavior. :)
http://groups.google.com/group/memcached/browse_thread/thread/1f8dcbc5efb1e9eb/f
a1dadb60c934d13
Personally, I'd like *something* here.
Original comment by dsalli...@gmail.com
on 29 Oct 2009 at 6:44
Original comment by dsalli...@gmail.com
on 30 Oct 2009 at 4:05
http://github.com/dustin/memcached/tree/issue_67
I adjusted buildbot to not run two tests on the same host concurrently just
because
this thing specifies port numbers. That will make the whole build process take
longer, but be safer. Perhaps we should add file lock in the specific tests
that
shouldn't run concurrently.
Original comment by dsalli...@gmail.com
on 30 Oct 2009 at 11:05
Shipped.
Original comment by dsalli...@gmail.com
on 30 Oct 2009 at 11:30
Original issue reported on code.google.com by
dsalli...@gmail.com
on 18 Jul 2009 at 7:03