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

smoketest: Extend HTTP-API tests #2481

Merged
merged 1 commit into from
Nov 16, 2023
Merged

Conversation

sever-sever
Copy link
Member

@sever-sever sever-sever commented Nov 14, 2023

Change Summary

smoketest: Extend HTTP-API tests

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe): Extend smoketests

Related Task(s)

Related PR(s)

Component(s) name

Proposed changes

How to test

Smoketest result

There is a local issue that was initially on the test VM
I didn't change the token; maybe some local issue

vyos@r4:~$ /usr/libexec/vyos/tests/smoke/cli/test_service_https.py
test_api_auth (__main__.TestHTTPSService.test_api_auth) ... ERROR
test_api_config_file (__main__.TestHTTPSService.test_api_config_file) ... ok
test_api_configure (__main__.TestHTTPSService.test_api_configure) ... ok
test_api_generate (__main__.TestHTTPSService.test_api_generate) ... ok
test_api_reset (__main__.TestHTTPSService.test_api_reset) ... ok
test_api_show (__main__.TestHTTPSService.test_api_show) ... ok
test_certificate (__main__.TestHTTPSService.test_certificate) ... ok
test_default (__main__.TestHTTPSService.test_default) ... ok
test_server_block (__main__.TestHTTPSService.test_server_block) ... ok

======================================================================
ERROR: test_api_auth (__main__.TestHTTPSService.test_api_auth)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/libexec/vyos/tests/smoke/cli/base_vyostest_shim.py", line 114, in wrapped
    return f(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^
  File "/usr/libexec/vyos/tests/smoke/cli/test_service_https.py", line 226, in test_api_auth
    token = r.json()['data']['AuthToken']['data']['result']['token']
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable

----------------------------------------------------------------------
Ran 9 tests in 84.361s

FAILED (errors=1)
vyos@r4:~$ 

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

@vyosbot vyosbot requested review from a team, dmbaturin, sarthurdev, zdc, jestabro and c-po and removed request for a team November 14, 2023 16:41
@sever-sever sever-sever changed the title smoketest: Extend HTPP-API tests smoketest: Extend HTTP-API tests Nov 14, 2023
@c-po
Copy link
Member

c-po commented Nov 16, 2023

There is a local issue that was initially on the test VM
I didn't change the token; maybe some local issue

Most likely - this is usually from some leftovers from previous fails

[email protected]:~$ /usr/libexec/vyos/tests/smoke/cli/test_service_https.py
test_api_auth (__main__.TestHTTPSService.test_api_auth) ... ok
test_api_config_file (__main__.TestHTTPSService.test_api_config_file) ... ok
test_api_configure (__main__.TestHTTPSService.test_api_configure) ... ok
test_api_generate (__main__.TestHTTPSService.test_api_generate) ... ok
test_api_reset (__main__.TestHTTPSService.test_api_reset) ... ok
test_api_show (__main__.TestHTTPSService.test_api_show) ... ok
test_certificate (__main__.TestHTTPSService.test_certificate) ... ok
test_default (__main__.TestHTTPSService.test_default) ... ok
test_server_block (__main__.TestHTTPSService.test_server_block) ... ok

----------------------------------------------------------------------
Ran 9 tests in 78.443s

OK

@c-po c-po merged commit 4131b6c into vyos:current Nov 16, 2023
6 of 7 checks passed
@c-po
Copy link
Member

c-po commented Nov 16, 2023

@Mergifyio backport sagitta

Copy link
Contributor

mergify bot commented Nov 16, 2023

backport sagitta

✅ Backports have been created

c-po added a commit that referenced this pull request Nov 16, 2023
smoketest: Extend HTTP-API tests (backport #2481)
c-po added a commit to c-po/vyos-1x that referenced this pull request Nov 20, 2023
…nly default

Why: Smoketests fail as they can not establish IPv6 connection to uvicorn
backend server.

vyos#2481 added a bunch of new smoketests.

While debugging those failing, it was uncovered, that uvicorn only listens on
IPv4 connections

vyos@vyos# netstat -tulnp | grep 8080
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 127.0.0.1:8080          0.0.0.0:*               LISTEN      -

As the CLI already has an option to move the API communication from an IP to a
UNIX domain socket, the best idea is to make this the default way of
communication, as we never directly talk to the API server but rather use the
NGINX reverse proxy.
c-po added a commit to c-po/vyos-1x that referenced this pull request Nov 20, 2023
…nly default

Why: Smoketests fail as they can not establish IPv6 connection to uvicorn
backend server.

vyos#2481 added a bunch of new smoketests.

While debugging those failing, it was uncovered, that uvicorn only listens on
IPv4 connections

vyos@vyos# netstat -tulnp | grep 8080
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 127.0.0.1:8080          0.0.0.0:*               LISTEN      -

As the CLI already has an option to move the API communication from an IP to a
UNIX domain socket, the best idea is to make this the default way of
communication, as we never directly talk to the API server but rather use the
NGINX reverse proxy.
c-po added a commit to c-po/vyos-1x that referenced this pull request Nov 20, 2023
…nly default

Why: Smoketests fail as they can not establish IPv6 connection to uvicorn
backend server.

vyos#2481 added a bunch of new smoketests.

While debugging those failing, it was uncovered, that uvicorn only listens on
IPv4 connections

vyos@vyos# netstat -tulnp | grep 8080
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 127.0.0.1:8080          0.0.0.0:*               LISTEN      -

As the CLI already has an option to move the API communication from an IP to a
UNIX domain socket, the best idea is to make this the default way of
communication, as we never directly talk to the API server but rather use the
NGINX reverse proxy.
c-po added a commit to c-po/vyos-1x that referenced this pull request Nov 20, 2023
…nly default

Why: Smoketests fail as they can not establish IPv6 connection to uvicorn
backend server.

vyos#2481 added a bunch of new smoketests.

While debugging those failing, it was uncovered, that uvicorn only listens on
IPv4 connections

vyos@vyos# netstat -tulnp | grep 8080
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 127.0.0.1:8080          0.0.0.0:*               LISTEN      -

As the CLI already has an option to move the API communication from an IP to a
UNIX domain socket, the best idea is to make this the default way of
communication, as we never directly talk to the API server but rather use the
NGINX reverse proxy.
mergify bot pushed a commit that referenced this pull request Nov 20, 2023
…nly default

Why: Smoketests fail as they can not establish IPv6 connection to uvicorn
backend server.

#2481 added a bunch of new smoketests.

While debugging those failing, it was uncovered, that uvicorn only listens on
IPv4 connections

vyos@vyos# netstat -tulnp | grep 8080
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 127.0.0.1:8080          0.0.0.0:*               LISTEN      -

As the CLI already has an option to move the API communication from an IP to a
UNIX domain socket, the best idea is to make this the default way of
communication, as we never directly talk to the API server but rather use the
NGINX reverse proxy.

(cherry picked from commit f5e43b1)
c-po added a commit to vyos/vyos-documentation that referenced this pull request Nov 21, 2023
…nly default

Why: Smoketests fail as they can not establish IPv6 connection to uvicorn
backend server.

vyos/vyos-1x#2481 added a bunch of new smoketests.

While debugging those failing, it was uncovered, that uvicorn only listens on
IPv4 connections

vyos@vyos# netstat -tulnp | grep 8080
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 127.0.0.1:8080          0.0.0.0:*               LISTEN      -

As the CLI already has an option to move the API communication from an IP to a
UNIX domain socket, the best idea is to make this the default way of
communication, as we never directly talk to the API server but rather use the
NGINX reverse proxy.
c-po added a commit to vyos/vyos-documentation that referenced this pull request Nov 21, 2023
…nly default

Why: Smoketests fail as they can not establish IPv6 connection to uvicorn
backend server.

vyos/vyos-1x#2481 added a bunch of new smoketests.

While debugging those failing, it was uncovered, that uvicorn only listens on
IPv4 connections

vyos@vyos# netstat -tulnp | grep 8080
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 127.0.0.1:8080          0.0.0.0:*               LISTEN      -

As the CLI already has an option to move the API communication from an IP to a
UNIX domain socket, the best idea is to make this the default way of
communication, as we never directly talk to the API server but rather use the
NGINX reverse proxy.

(cherry picked from commit 12ffd3e)
jestabro pushed a commit to jestabro/vyos-1x that referenced this pull request Nov 21, 2023
…nly default

Why: Smoketests fail as they can not establish IPv6 connection to uvicorn
backend server.

vyos#2481 added a bunch of new smoketests.

While debugging those failing, it was uncovered, that uvicorn only listens on
IPv4 connections

vyos@vyos# netstat -tulnp | grep 8080
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 127.0.0.1:8080          0.0.0.0:*               LISTEN      -

As the CLI already has an option to move the API communication from an IP to a
UNIX domain socket, the best idea is to make this the default way of
communication, as we never directly talk to the API server but rather use the
NGINX reverse proxy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants