Skip to content
This repository was archived by the owner on Oct 23, 2023. It is now read-only.

Remove the option to skip the proxy test as it is no longer available #65

Merged
merged 1 commit into from
Apr 17, 2023

Conversation

MonicaisHer
Copy link
Contributor

@MonicaisHer MonicaisHer commented Apr 17, 2023

Removing the replacement code since, the corresponding tests have been removed in canonical/edgex-snap-hooks#85

This will resolve #52 and #55

@MonicaisHer
Copy link
Contributor Author

The test was passed by using a snap built from this PR with some temporary changes:

  • main branch was used instead of v3 of the edegx-snap-testing repo
  • edegxfoundry snap was tested on the latest/edge instead of the latest/beta to utilize the new security changes
Run the 'edgexfoundry' test suite:
2023/04/17 11:31:28 [CLEAN]
2023/04/17 11:31:28 [exec] snap remove --purge edgexfoundry
2023/04/17 11:31:29 [stdout] 2023-04-17T11:31:29+02:00 INFO Waiting for "snap.edgexfoundry.core-data.service" to stop.
2023/04/17 11:31:30 [stdout] 2023-04-17T11:31:30+02:00 INFO Waiting for "snap.edgexfoundry.support-notifications.service" to stop.
2023/04/17 11:31:31 [stdout] 2023-04-17T11:31:31+02:00 INFO Waiting for "snap.edgexfoundry.core-metadata.service" to stop.
2023/04/17 11:31:32 [stdout] 2023-04-17T11:31:32+02:00 INFO Waiting for "snap.edgexfoundry.support-scheduler.service" to stop.
2023/04/17 11:31:37 [stdout] edgexfoundry removed
2023/04/17 11:31:37 [SETUP]
2023/04/17 11:31:37 [exec] snap install edgexfoundry --channel=latest/edge
2023/04/17 11:32:10 [stdout] edgexfoundry (edge) 3.0.0-dev.117 from Canonical** installed
2023/04/17 11:32:10 Retry 1/180: Waiting for ports: 59880 (core-data), 59881 (core-metadata), 59882 (core-command), 8200 (vault), 8500 (consul), 6379 (redis), 8000 (nginx(http)), 59842 (security-proxy-auth), 8443 (nginx(https))
2023/04/17 11:32:11 Retry 2/180: Waiting for ports: 59880 (core-data), 59881 (core-metadata), 59882 (core-command), 59842 (security-proxy-auth)
2023/04/17 11:32:12 Retry 3/180: Waiting for ports: 59880 (core-data), 59881 (core-metadata), 59882 (core-command)
2023/04/17 11:32:13 Retry 4/180: Waiting for ports: 59880 (core-data), 59881 (core-metadata), 59882 (core-command)
2023/04/17 11:32:14 Retry 5/180: Waiting for ports: 59880 (core-data), 59881 (core-metadata), 59882 (core-command)
2023/04/17 11:32:14 [exec] snap start --enable edgexfoundry.support-scheduler
2023/04/17 11:32:15 [stdout] Started.
2023/04/17 11:32:15 Retry 1/60: Waiting for ports: 59861 (support-scheduler)
=== RUN   TestChangeStartupMsg_app
    exec.go:19: [exec] snap set edgexfoundry apps.support-scheduler.config.edgex-config-provider='none'
    exec.go:19: [exec] snap set edgexfoundry apps.support-scheduler.config.edgex-common-config='./config/core-common-config-bootstrapper/res/configuration.yaml'
    config_test.go:26: Set and verify new startup message: snap-testing (app)
    exec.go:19: [exec] snap set edgexfoundry apps.support-scheduler.config.service-startupmsg='snap-testing (app)'
    exec.go:19: [exec] snap restart edgexfoundry.support-scheduler
    exec.go:101: [stdout] 2023-04-17T11:32:18+02:00 INFO Waiting for "snap.edgexfoundry.support-scheduler.service" to stop.
    exec.go:101: [stdout] Restarted.
    net.go:144: Retry 1/180: Waiting for ports: 59880 (core-data), 59881 (core-metadata), 59882 (core-command), 8200 (vault), 8500 (consul), 6379 (redis), 8000 (nginx(http)), 59842 (security-proxy-auth), 8443 (nginx(https))
    config.go:247: Retry 1/10: Waiting for expected content in logs: msg="snap-testing (app)"
    exec.go:19: [exec] journalctl --since "2023-04-17 11:32:17" --no-pager | grep "edgexfoundry.support-scheduler"|| true
    config.go:252: Found expected content in logs: msg="snap-testing (app)"
    config_test.go:34: Unset and check default message
    exec.go:19: [exec] snap unset edgexfoundry apps.support-scheduler.config.service-startupmsg
    exec.go:19: [exec] snap restart edgexfoundry.support-scheduler
    exec.go:101: [stdout] 2023-04-17T11:32:23+02:00 INFO Waiting for "snap.edgexfoundry.support-scheduler.service" to stop.
    exec.go:101: [stdout] Restarted.
    net.go:144: Retry 1/180: Waiting for ports: 59880 (core-data), 59881 (core-metadata), 59882 (core-command), 8200 (vault), 8500 (consul), 6379 (redis), 8000 (nginx(http)), 59842 (security-proxy-auth), 8443 (nginx(https))
    config.go:247: Retry 1/10: Waiting for expected content in logs: msg="This is the Support Scheduler Microservice"
    exec.go:19: [exec] journalctl --since "2023-04-17 11:32:22" --no-pager | grep "edgexfoundry.support-scheduler"|| true
    config.go:252: Found expected content in logs: msg="This is the Support Scheduler Microservice"
    exec.go:19: [exec] snap unset edgexfoundry apps.support-scheduler.config.service-startupmsg
    exec.go:19: [exec] snap restart edgexfoundry.support-scheduler
    exec.go:101: [stdout] 2023-04-17T11:32:26+02:00 INFO Waiting for "snap.edgexfoundry.support-scheduler.service" to stop.
    exec.go:101: [stdout] Restarted.
--- PASS: TestChangeStartupMsg_app (11.19s)
=== RUN   TestChangeStartupMsg_global
    exec.go:19: [exec] snap set edgexfoundry apps.support-scheduler.config.edgex-config-provider='none'
    exec.go:19: [exec] snap set edgexfoundry apps.support-scheduler.config.edgex-common-config='./config/core-common-config-bootstrapper/res/configuration.yaml'
    config_test.go:55: Set and verify new startup message: snap-testing (global)
    exec.go:19: [exec] snap set edgexfoundry config.service-startupmsg='snap-testing (global)'
    exec.go:19: [exec] snap restart edgexfoundry.support-scheduler
    exec.go:101: [stdout] 2023-04-17T11:32:29+02:00 INFO Waiting for "snap.edgexfoundry.support-scheduler.service" to stop.
    exec.go:101: [stdout] Restarted.
    net.go:144: Retry 1/180: Waiting for ports: 59880 (core-data), 59881 (core-metadata), 59882 (core-command), 8200 (vault), 8500 (consul), 6379 (redis), 8000 (nginx(http)), 59842 (security-proxy-auth), 8443 (nginx(https))
    config.go:247: Retry 1/10: Waiting for expected content in logs: msg="snap-testing (global)"
    exec.go:19: [exec] journalctl --since "2023-04-17 11:32:28" --no-pager | grep "edgexfoundry.support-scheduler"|| true
    config.go:252: Found expected content in logs: msg="snap-testing (global)"
    config_test.go:63: Unset and check default message
    exec.go:19: [exec] snap unset edgexfoundry config.service-startupmsg
    exec.go:19: [exec] snap restart edgexfoundry.support-scheduler
    exec.go:101: [stdout] Restarted.
    net.go:144: Retry 1/180: Waiting for ports: 59880 (core-data), 59881 (core-metadata), 59882 (core-command), 8200 (vault), 8500 (consul), 6379 (redis), 8000 (nginx(http)), 59842 (security-proxy-auth), 8443 (nginx(https))
    config.go:247: Retry 1/10: Waiting for expected content in logs: msg="This is the Support Scheduler Microservice"
    exec.go:19: [exec] journalctl --since "2023-04-17 11:32:31" --no-pager | grep "edgexfoundry.support-scheduler"|| true
    config.go:252: Found expected content in logs: msg="This is the Support Scheduler Microservice"
    exec.go:19: [exec] snap unset edgexfoundry config.service-startupmsg
    exec.go:19: [exec] snap restart edgexfoundry.support-scheduler
    exec.go:101: [stdout] 2023-04-17T11:32:35+02:00 INFO Waiting for "snap.edgexfoundry.support-scheduler.service" to stop.
    exec.go:101: [stdout] Restarted.
--- PASS: TestChangeStartupMsg_global (8.88s)
=== RUN   TestChangeStartupMsg_mixedGlobalApp
    exec.go:19: [exec] snap set edgexfoundry apps.support-scheduler.config.edgex-config-provider='none'
    exec.go:19: [exec] snap set edgexfoundry apps.support-scheduler.config.edgex-common-config='./config/core-common-config-bootstrapper/res/configuration.yaml'
    config_test.go:87: Set local and global startup messages and verify that local has taken precedence
    exec.go:19: [exec] snap set edgexfoundry apps.support-scheduler.config.service-startupmsg='snap-testing (app specific)'
    exec.go:19: [exec] snap set edgexfoundry config.service-startupmsg='snap-testing (global override)'
    exec.go:19: [exec] snap restart edgexfoundry.support-scheduler
    exec.go:101: [stdout] Restarted.
    net.go:144: Retry 1/180: Waiting for ports: 59880 (core-data), 59881 (core-metadata), 59882 (core-command), 8200 (vault), 8500 (consul), 6379 (redis), 8000 (nginx(http)), 59842 (security-proxy-auth), 8443 (nginx(https))
    config.go:247: Retry 1/10: Waiting for expected content in logs: msg="snap-testing (app specific)"
    exec.go:19: [exec] journalctl --since "2023-04-17 11:32:37" --no-pager | grep "edgexfoundry.support-scheduler"|| true
    config.go:252: Found expected content in logs: msg="snap-testing (app specific)"
    config_test.go:96: Unset and check default message
    exec.go:19: [exec] snap unset edgexfoundry apps.support-scheduler.config.service-startupmsg
    exec.go:19: [exec] snap unset edgexfoundry config.service-startupmsg
    exec.go:19: [exec] snap restart edgexfoundry.support-scheduler
    exec.go:101: [stdout] Restarted.
    net.go:144: Retry 1/180: Waiting for ports: 59880 (core-data), 59881 (core-metadata), 59882 (core-command), 8200 (vault), 8500 (consul), 6379 (redis), 8000 (nginx(http)), 59842 (security-proxy-auth), 8443 (nginx(https))
    config.go:247: Retry 1/10: Waiting for expected content in logs: msg="This is the Support Scheduler Microservice"
    exec.go:19: [exec] journalctl --since "2023-04-17 11:32:41" --no-pager | grep "edgexfoundry.support-scheduler"|| true
    config.go:252: Found expected content in logs: msg="This is the Support Scheduler Microservice"
    exec.go:19: [exec] snap unset edgexfoundry config.service-startupmsg
    exec.go:19: [exec] snap restart edgexfoundry.support-scheduler
    exec.go:101: [stdout] Restarted.
--- PASS: TestChangeStartupMsg_mixedGlobalApp (10.22s)
=== RUN   TestCommon
=== RUN   TestCommon/config
=== RUN   TestCommon/config/autostart
=== RUN   TestCommon/net
=== RUN   TestCommon/net/ports_open
    net.go:144: Retry 1/60: Waiting for ports: 59880 (core-data), 59881 (core-metadata), 59882 (core-command), 8200 (vault), 8500 (consul), 6379 (redis), 8000 (nginx(http)), 59842 (security-proxy-auth), 8443 (nginx(https))
=== NAME  TestCommon/net
    net.go:144: Retry 1/60: Waiting for ports: 59880 (core-data), 59881 (core-metadata), 59882 (core-command), 8200 (vault), 8500 (consul), 6379 (redis), 8000 (nginx(http)), 59842 (security-proxy-auth)
=== RUN   TestCommon/net/ports_not_listening_on_all_interfaces
    exec.go:19: [exec] lsof -nPi :59880 || true
    net.go:264: Looking for '*:59880 (LISTEN)'
    exec.go:19: [exec] lsof -nPi :59881 || true
    net.go:264: Looking for '*:59881 (LISTEN)'
    exec.go:19: [exec] lsof -nPi :59882 || true
    net.go:264: Looking for '*:59882 (LISTEN)'
    exec.go:19: [exec] lsof -nPi :8200 || true
    net.go:264: Looking for '*:8200 (LISTEN)'
    exec.go:19: [exec] lsof -nPi :8500 || true
    net.go:264: Looking for '*:8500 (LISTEN)'
    exec.go:19: [exec] lsof -nPi :6379 || true
    net.go:264: Looking for '*:6379 (LISTEN)'
    exec.go:19: [exec] lsof -nPi :8000 || true
    net.go:264: Looking for '*:8000 (LISTEN)'
    exec.go:19: [exec] lsof -nPi :59842 || true
    net.go:264: Looking for '*:59842 (LISTEN)'
=== RUN   TestCommon/net/ports_listening_on_localhost
    exec.go:19: [exec] lsof -nPi :59880 || true
    net.go:264: Looking for '127.0.0.1:59880 (LISTEN)'
    exec.go:19: [exec] lsof -nPi :59881 || true
    net.go:264: Looking for '127.0.0.1:59881 (LISTEN)'
    exec.go:19: [exec] lsof -nPi :59882 || true
    net.go:264: Looking for '127.0.0.1:59882 (LISTEN)'
    exec.go:19: [exec] lsof -nPi :8200 || true
    net.go:264: Looking for '127.0.0.1:8200 (LISTEN)'
    exec.go:19: [exec] lsof -nPi :8500 || true
    net.go:264: Looking for '127.0.0.1:8500 (LISTEN)'
    exec.go:19: [exec] lsof -nPi :6379 || true
    net.go:264: Looking for '127.0.0.1:6379 (LISTEN)'
    exec.go:19: [exec] lsof -nPi :8000 || true
    net.go:264: Looking for '127.0.0.1:8000 (LISTEN)'
    exec.go:19: [exec] lsof -nPi :59842 || true
    net.go:264: Looking for '127.0.0.1:59842 (LISTEN)'
=== RUN   TestCommon/packaging
=== RUN   TestCommon/packaging/semantic_snap_version
    exec.go:19: [exec] snap info edgexfoundry | grep installed | awk '{print $2}'
    exec.go:101: [stdout] 3.0.0-dev.117
--- PASS: TestCommon (3.13s)
    --- PASS: TestCommon/config (0.00s)
        --- PASS: TestCommon/config/autostart (0.00s)
    --- PASS: TestCommon/net (2.42s)
        --- PASS: TestCommon/net/ports_open (0.00s)
        --- PASS: TestCommon/net/ports_not_listening_on_all_interfaces (1.23s)
        --- PASS: TestCommon/net/ports_listening_on_localhost (1.19s)
    --- PASS: TestCommon/packaging (0.71s)
        --- PASS: TestCommon/packaging/semantic_snap_version (0.71s)
PASS
2023/04/17 11:32:48 [TEARDOWN]
2023/04/17 11:32:48 [exec] (journalctl --since "2023-04-17 11:31:37" --no-pager | grep "edgexfoundry"|| true) > edgexfoundry.log
Wrote snap logs to /home/mengyi/Desktop/edgex634_640/edgex-checkbox-provider/tmp/edgex-snap-testing/test/suites/edgexfoundry/edgexfoundry.log
2023/04/17 11:32:48 Removing installed snap: true
2023/04/17 11:32:48 [exec] snap remove --purge edgexfoundry
2023/04/17 11:32:49 [stdout] 2023-04-17T11:32:49+02:00 INFO Waiting for "snap.edgexfoundry.support-notifications.service" to stop.
2023/04/17 11:32:51 [stdout] 2023-04-17T11:32:51+02:00 INFO Waiting for "snap.edgexfoundry.core-data.service" to stop.
2023/04/17 11:32:52 [stdout] 2023-04-17T11:32:52+02:00 INFO Waiting for "snap.edgexfoundry.support-scheduler.service" to stop.
2023/04/17 11:32:56 [stdout] edgexfoundry removed
ok      edgex-snap-testing/test/suites/edgexfoundry     87.846s

@MonicaisHer MonicaisHer marked this pull request as ready for review April 17, 2023 09:43
@MonicaisHer MonicaisHer requested a review from farshidtz April 17, 2023 09:43
@farshidtz farshidtz merged commit 64a4363 into canonical:master Apr 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing libssl for TestTLSCert go test
2 participants