Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eblocker-icapserver, NetworkAddressFactoryCustomizationTest, UpnpPortForwardingAdd: Port mapping failed #312

Open
dev8765 opened this issue Dec 6, 2023 · 2 comments

Comments

@dev8765
Copy link

dev8765 commented Dec 6, 2023

Tests

[INFO] --- maven-surefire-plugin:2.13:test (default-test) @ eblocker-icapserver ---
[INFO] Surefire report directory: /home/a/build/eblocker/eblocker/eblocker-icapserver/target/surefire-reports

Running org.eblocker.server.upnp.NetworkAddressFactoryCustomizationTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.635 sec
Running org.eblocker.server.upnp.UpnpPortForwardingAddTest
2023-12-06T11:48:25,676 [ERROR] org.eblocker.server.upnp.UpnpPortForwardingAdd [main] - Port mapping failed: (UpnpPortForwarding) Protocol: TCP, 1 => 3.3.3. 3, Reason: defaultMsg
2023-12-06T11:48:25,948 [INFO ] org.eblocker.server.upnp.UpnpPortForwardingAdd [main] - Port mapping added: (UpnpPortForwarding) Protocol: TCP, 1 => 3.3.3.3
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 16.006 sec
Running org.eblocker.server.upnp.UpnpPortForwardingDeleteTest
2023-12-06T11:48:26,061 [INFO ] org.eblocker.server.upnp.UpnpPortForwardingDelete [main] - Removing port mapping failed: (UpnpPortForwarding) Protocol: TCP, 1 => 3.3.3.3, Reason: defaultMsg
2023-12-06T11:48:26,140 [INFO ] org.eblocker.server.upnp.UpnpPortForwardingDelete [main] - Port mapping removed: (UpnpPortForwarding) Protocol: TCP, 1 => 3. 3.3.3
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.182 sec
Running org.eblocker.server.upnp.UpnpManagementServiceTest
2023-12-06T11:48:30,633 [ERROR] org.eblocker.server.upnp.UpnpManagementService [main] - No gateway devices found on which to establish a port forwarding
2023-12-06T11:48:30,696 [ERROR] org.eblocker.server.upnp.UpnpManagementService [main] - No gateway devices found on which to establish a port forwarding
2023-12-06T11:48:31,522 [ERROR] org.eblocker.server.upnp.UpnpManagementService [main] - Could not find connection devices for device Mock for Device, hashCo de: 1631749749
2023-12-06T11:48:31,527 [ERROR] org.eblocker.server.upnp.UpnpManagementService [main] - No gateway devices found on which to establish a port forwarding
2023-12-06T11:48:31,532 [ERROR] org.eblocker.server.upnp.UpnpManagementService [main] - Could not find connection devices for device Mock for Device, hashCo de: 1631749749
2023-12-06T11:48:31,534 [ERROR] org.eblocker.server.upnp.UpnpManagementService [main] - No gateway devices found on which to establish a port forwarding
2023-12-06T11:48:31,584 [ERROR] org.eblocker.server.upnp.UpnpManagementService [main] - Could not find connection devices for device Mock for Device, hashCo de: 945613614
2023-12-06T11:48:31,589 [ERROR] org.eblocker.server.upnp.UpnpManagementService [main] - Could not find connection devices for device Mock for Device, hashCo de: 945613614
Tests run: 10, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.493 sec
Running org.eblocker.server.common.blocker.parser.EtcHostsParserTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.043 sec
Running org.eblocker.server.common.blocker.parser.SquidAclParserTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.064 sec
Running org.eblocker.server.common.blocker.UpdateTaskTest
2023-12-06T11:48:34,509 [INFO ] org.eblocker.server.common.blocker.UpdateTask [main] - updating 0
2023-12-06T11:48:34,682 [INFO ] org.eblocker.server.common.blocker.UpdateTask [main] - updating 0
2023-12-06T11:48:34,805 [INFO ] org.eblocker.server.common.blocker.UpdateTask [main] - updating 0

Settings in my Fritzbox:

  • The eBlocker device gets always the same, fixed ip address
  • Upnp is activated
  • Some port access rules are created (pls. see attachement)

Why are these tests failing, how to solve this?


fb-ports-access
@eblosug
Copy link
Member

eblosug commented Dec 7, 2023

It's normal that there are error messages in the log when the unit tests are run. That is because many error conditions are tested, mainly with mock objects (using the Mockito library).

The UPnP tests work with mock objects, they do not change anything on your real router.

In your log extract I can not see any failed tests, the result is always:

Failures: 0, Errors: 0

But maybe other tests are failing in your environment?

@dev8765
Copy link
Author

dev8765 commented Dec 7, 2023

I'm not concerned with UPnP, I have opened it intentionally.
Yes, later on are multiple Java exceptions in the log.
Sadly I have my build environment no more available.

My build environment was:
Debian 10 Buster x64 (on an apu2)
OpenJDK 11, fetched via "apt install"
Fritzbox 7490, UPnP turned on
Followed the steps in the README.md

...
cd eblocker
mvn test

Or alternativly, narrowed down

...
cd eblocker-icapserver
mvn test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants