We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent0d55551 commit69c6d73Copy full SHA for 69c6d73
agent/agentssh/x11_test.go
@@ -164,10 +164,17 @@ func TestServer_X11_EvictionLRU(t *testing.T) {
164
165
c:=sshClient(t,ln.Addr().String())
166
167
+// block off one port to test x11Forwarder evicts at highest port, not number of listeners.
168
+externalListener,err:=inproc.Listen("tcp",
169
+fmt.Sprintf("localhost:%d",agentssh.X11StartPort+agentssh.X11DefaultDisplayOffset+1))
170
+require.NoError(t,err)
171
+deferexternalListener.Close()
172
+
173
// Calculate how many simultaneous X11 sessions we can create given the
174
// configured port range.
175
176
startPort:=agentssh.X11StartPort+agentssh.X11DefaultDisplayOffset
-maxSessions:=agentssh.X11MaxPort-startPort+1
177
+maxSessions:=agentssh.X11MaxPort-startPort+1-1// -1 for the blocked port
178
require.Greater(t,maxSessions,0,"expected a positive maxSessions value")
179
180
// shellSession holds references to the session and its standard streams so