Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 342146

Summary: testRestrictedTelnetHost testcase failure on linux machine
Product: [Eclipse Project] Equinox Reporter: Thomas Watson <tjwatson>
Component: FrameworkAssignee: Lazar Kirchev <l.kirchev>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: kim.moir, l.kirchev
Version: 3.7   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard: stalebug
Attachments:
Description Flags
Patch for the failing telnet test none

Description Thomas Watson CLA 2011-04-07 08:48:37 EDT
The test calls InetAddress.getLocalHost() and assumes the InetAddress returned is not localhost (127.0.0.1).  One the linux test machine we are getting the following failure:

	Telnet should listen only on localhost, not on 127.0.0.1

junit.framework.AssertionFailedError: Telnet should listen only on localhost, not on 127.0.0.1
at org.eclipse.osgi.tests.console.TestRestrictedTelnetHost.testRestrictedTelnetHost(TestRestrictedTelnetHost.java:50)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:416)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:249)
at org.eclipse.test.CoreTestApplication.runTests(CoreTestApplication.java:36)
at org.eclipse.test.CoreTestApplication.run(CoreTestApplication.java:32)
at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
at org.eclipse.core.launcher.Main.main(Main.java:34)


I tried to put a workaround to disable the test by checking that the hostname of the local InetAddress is not "localhost" but that did not seem to work.  We will probably have to disable this test for now.
Comment 1 Lazar Kirchev CLA 2011-04-07 08:57:23 EDT
Ok, disable it while I am trying to find another way to test this functionality.
Comment 2 Lazar Kirchev CLA 2011-04-11 06:38:58 EDT
Does the test machine have an IP address different from 127.0.0.1? Because I tried to reproduce this problem on a Linux machine, but if there was actually an IP address, InetAddress.getLocalHost() returned this address. It returned 127.0.0.1 only if there was no other IP address configured on the machine. 

If this is the case the functionality could not be tested - it requires another IP in addition to 127.0.0.1. The workaround I suggest here is to check if the address, which InetAddress.getLocalHost() returns is 127.0.0.1, and if so - not to make any further checks.
Comment 3 Lazar Kirchev CLA 2011-04-11 06:39:43 EDT
Created attachment 192921 [details]
Patch for the failing telnet test
Comment 4 Thomas Watson CLA 2011-04-11 09:35:54 EDT
Kim, could you tell us about the Linux test machine and its IP addresses (comment2)?
Comment 5 Kim Moir CLA 2011-04-11 09:55:36 EDT
The test machine is ejlnx1.ottawa.ibm.com.  It has an internal IBM address.
Comment 6 Lazar Kirchev CLA 2011-04-11 10:35:43 EDT
(In reply to comment #5)
> The test machine is ejlnx1.ottawa.ibm.com.  It has an internal IBM address.

Then this seems strange. I thought that probably InetAddress.getLocalHost() returns always 127.0.0.1 on linux but when I tested it on a linux machine with an IP address, it returned the IP address, not 127.0.0.1. That is why I supposed that probably the test machine has no IP other than 127.0.0.1, but it now turns out that this is not the case. Probably the problem is in the configuration of the IP addresses?
Comment 7 Eclipse Genie CLA 2018-12-28 02:42:31 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 8 Lars Vogel CLA 2019-09-04 01:52:07 EDT
This bug was marked as stalebug a while ago. Marking as worksforme.

If this report is still relevant for the current release, please reopen and remove the stalebug whiteboard tag.