Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

feat: enrich the unenroll scenario #174

Merged

Conversation

mdelapenya
Copy link
Contributor

What is this PR doing?

It adds an existing step to the unenroll scenario, checking the elastic-agent process is there.

Why is it important?

We want to ensure the elastic-agent process is still running in the host, as described in the original test script

Related issues

We want to ensure the elastic-agent process is still running in the host
@mdelapenya mdelapenya self-assigned this Jul 17, 2020
@mdelapenya mdelapenya requested review from a team, michalpristas and EricDavisX July 17, 2020 06:39
@mdelapenya mdelapenya added enhancement New feature or request ingest-manager labels Jul 17, 2020
@mdelapenya mdelapenya marked this pull request as ready for review July 17, 2020 06:40
@elasticmachine
Copy link
Contributor

elasticmachine commented Jul 17, 2020

💔 Tests Failed

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #174 opened]

  • Start Time: 2020-07-17T06:39:55.651+0000

  • Duration: 19 min 1 sec

Test stats 🧪

Test Results
Failed 3
Passed 33
Skipped 13
Total 49

Test errors

Expand to view the tests failures

  • Name: Initializing / End-To-End Tests / ingest-manager_fleet_mode / Un-enrolling an agent – Fleet Mode Agent

    • Age: 1
    • Duration: 20.254267
    • Error Details: Step the agent is not listed as online in Fleet: The Agent is still online
  • Name: Initializing / End-To-End Tests / ingest-manager_fleet_mode / Re-enrolling an agent – Fleet Mode Agent

    • Age: 1
    • Duration: 20.458164
    • Error Details: Step the agent is listed in Fleet as online: There are 4 online agents. We expected to have exactly one
  • Name: Initializing / Tests / Sanity checks / checkgherkinlint – pre_commit.lint

    • Age: 1
    • Duration: 0
    • Error Details: error

Steps errors

Expand to view the steps failures

  • Name: Run functional tests for ingest-manager:fleet_mode

    • Description:

    • Duration: 9 min 18 sec

    • Start Time: 2020-07-17T06:49:35.393+0000

    • log

  • Name: Error signal

    • Description:

    • Duration: 0 min 0 sec

    • Start Time: 2020-07-17T06:58:52.989+0000

    • log

  • Name: General Build Step

    • Description: [2020-07-17T06:58:53.485Z] Archiving artifacts
      hudson.AbortException: script returned exit code 1

    • Duration: 0 min 0 sec

    • Start Time: 2020-07-17T06:58:53.471+0000

    • log

Log output

Expand to view the last 100 lines of log output

[2020-07-17T06:57:59.462Z] ingest-manager_package-registry_1 is up-to-date
[2020-07-17T06:57:59.462Z] Creating ingest-manager_elastic-agent_1 ... 
[2020-07-17T06:57:59.462Z] ingest-manager_kibana_1 is up-to-date
[2020-07-17T06:58:01.825Z] 
Creating ingest-manager_elastic-agent_1 ... done
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
[2020-07-17T06:58:01.825Z]                                  Dload  Upload   Total   Spent    Left  Speed
[2020-07-17T06:58:02.976Z] 
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  6 72.4M    6 4683k    0     0  6721k      0  0:00:11 --:--:--  0:00:11 6777k
100 72.4M  100 72.4M    0     0  54.8M      0  0:00:01  0:00:01 --:--:-- 55.1M
[2020-07-17T06:58:04.365Z] elastic-agent-8.0.0-SNAPSHOT-linux-x86_64/data/downloads/filebeat-8.0.0-SNAPSHOT-linux-x86_64.tar.gz.sha512
[2020-07-17T06:58:04.365Z] elastic-agent-8.0.0-SNAPSHOT-linux-x86_64/README.md
[2020-07-17T06:58:04.365Z] elastic-agent-8.0.0-SNAPSHOT-linux-x86_64/elastic-agent.reference.yml
[2020-07-17T06:58:04.365Z] elastic-agent-8.0.0-SNAPSHOT-linux-x86_64/elastic-agent
[2020-07-17T06:58:04.365Z] elastic-agent-8.0.0-SNAPSHOT-linux-x86_64/LICENSE.txt
[2020-07-17T06:58:04.365Z] elastic-agent-8.0.0-SNAPSHOT-linux-x86_64/data/downloads/metricbeat-8.0.0-SNAPSHOT-linux-x86_64.tar.gz
[2020-07-17T06:58:04.942Z] elastic-agent-8.0.0-SNAPSHOT-linux-x86_64/elastic-agent.yml
[2020-07-17T06:58:04.942Z] elastic-agent-8.0.0-SNAPSHOT-linux-x86_64/data/downloads/filebeat-8.0.0-SNAPSHOT-linux-x86_64.tar.gz
[2020-07-17T06:58:05.205Z] elastic-agent-8.0.0-SNAPSHOT-linux-x86_64/.build_hash.txt
[2020-07-17T06:58:05.205Z] elastic-agent-8.0.0-SNAPSHOT-linux-x86_64/data/downloads/metricbeat-8.0.0-SNAPSHOT-linux-x86_64.tar.gz.sha512
[2020-07-17T06:58:09.430Z] The Elastic Agent is currently in BETA and should not be used in production
[2020-07-17T06:58:09.430Z] 2020-07-17T06:58:08.745Z	DEBUG	kibana/client.go:170	Request method: POST, path: /api/ingest_manager/fleet/agents/enroll
[2020-07-17T06:58:10.818Z] Successfully enrolled the Agent.
[2020-07-17T06:58:14.131Z] ingest-manager_elasticsearch_1 is up-to-date
[2020-07-17T06:58:14.131Z] ingest-manager_package-registry_1 is up-to-date
[2020-07-17T06:58:14.131Z] Recreating ingest-manager_elastic-agent_1 ... 
[2020-07-17T06:58:14.131Z] ingest-manager_kibana_1 is up-to-date
[2020-07-17T06:58:29.072Z] 
Recreating ingest-manager_elastic-agent_1 ... done
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
[2020-07-17T06:58:29.072Z]                                  Dload  Upload   Total   Spent    Left  Speed
[2020-07-17T06:58:29.908Z] 
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
 32 72.4M   32 23.8M    0     0  26.2M      0  0:00:02 --:--:--  0:00:02 26.2M
100 72.4M  100 72.4M    0     0  54.8M      0  0:00:01  0:00:01 --:--:-- 54.8M
[2020-07-17T06:58:30.851Z] elastic-agent-8.0.0-SNAPSHOT-linux-x86_64/data/downloads/filebeat-8.0.0-SNAPSHOT-linux-x86_64.tar.gz.sha512
[2020-07-17T06:58:30.851Z] elastic-agent-8.0.0-SNAPSHOT-linux-x86_64/README.md
[2020-07-17T06:58:30.851Z] elastic-agent-8.0.0-SNAPSHOT-linux-x86_64/elastic-agent.reference.yml
[2020-07-17T06:58:30.851Z] elastic-agent-8.0.0-SNAPSHOT-linux-x86_64/elastic-agent
[2020-07-17T06:58:31.114Z] elastic-agent-8.0.0-SNAPSHOT-linux-x86_64/LICENSE.txt
[2020-07-17T06:58:31.114Z] elastic-agent-8.0.0-SNAPSHOT-linux-x86_64/data/downloads/metricbeat-8.0.0-SNAPSHOT-linux-x86_64.tar.gz
[2020-07-17T06:58:31.690Z] elastic-agent-8.0.0-SNAPSHOT-linux-x86_64/elastic-agent.yml
[2020-07-17T06:58:31.690Z] elastic-agent-8.0.0-SNAPSHOT-linux-x86_64/data/downloads/filebeat-8.0.0-SNAPSHOT-linux-x86_64.tar.gz
[2020-07-17T06:58:31.952Z] elastic-agent-8.0.0-SNAPSHOT-linux-x86_64/.build_hash.txt
[2020-07-17T06:58:31.952Z] elastic-agent-8.0.0-SNAPSHOT-linux-x86_64/data/downloads/metricbeat-8.0.0-SNAPSHOT-linux-x86_64.tar.gz.sha512
[2020-07-17T06:58:34.526Z] The Elastic Agent is currently in BETA and should not be used in production
[2020-07-17T06:58:34.526Z] 2020-07-17T06:58:34.440Z	DEBUG	kibana/client.go:170	Request method: POST, path: /api/ingest_manager/fleet/agents/enroll
[2020-07-17T06:58:34.790Z] panic: runtime error: comparing uncomparable type errors.agentError
[2020-07-17T06:58:34.790Z] 
[2020-07-17T06:58:34.790Z] goroutine 1 [running]:
[2020-07-17T06:58:34.790Z] github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/cmd.enroll(0xc00031ade0, 0xc000338c80, 0xc00031ae10, 0xc0002751c0, 0x2, 0x4, 0xcaff9d, 0x4)
[2020-07-17T06:58:34.790Z] 	/go/src/github.com/elastic/beats/x-pack/elastic-agent/pkg/agent/cmd/enroll.go:125 +0xac7
[2020-07-17T06:58:34.790Z] github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/agent/cmd.newEnrollCommandWithArgs.func1(0xc000338c80, 0xc0002751c0, 0x2, 0x4)
[2020-07-17T06:58:34.790Z] 	/go/src/github.com/elastic/beats/x-pack/elastic-agent/pkg/agent/cmd/enroll.go:36 +0x6d
[2020-07-17T06:58:34.790Z] github.com/spf13/cobra.(*Command).execute(0xc000338c80, 0xc000275100, 0x4, 0x4, 0xc000338c80, 0xc000275100)
[2020-07-17T06:58:34.790Z] 	/go/pkg/mod/github.com/spf13/[email protected]/command.go:766 +0x29d
[2020-07-17T06:58:34.790Z] github.com/spf13/cobra.(*Command).ExecuteC(0xc000338500, 0x6, 0x6, 0xc00031ade0)
[2020-07-17T06:58:34.790Z] 	/go/pkg/mod/github.com/spf13/[email protected]/command.go:852 +0x2ea
[2020-07-17T06:58:34.790Z] github.com/spf13/cobra.(*Command).Execute(...)
[2020-07-17T06:58:34.790Z] 	/go/pkg/mod/github.com/spf13/[email protected]/command.go:800
[2020-07-17T06:58:34.790Z] main.main()
[2020-07-17T06:58:34.790Z] 	/go/src/github.com/elastic/beats/x-pack/elastic-agent/main.go:20 +0x138
[2020-07-17T06:58:34.790Z] time="2020-07-17T06:58:34Z" level=error msg="Could not execute command in container" command="[elastic-agent enroll http://kibana:5601 RTJ1UVczTUJNNEZhU2YxbzJVNmU6TUVDOFpJcE1STy1JeERqTFBZODF5dw== -f --insecure]" error="Could not run compose file: [/var/lib/jenkins/workspace/stack_e2e-testing-mbp_PR-174/.op/compose/profiles/ingest-manager/docker-compose.yml /var/lib/jenkins/workspace/stack_e2e-testing-mbp_PR-174/.op/compose/services/centos/docker-compose.yml] - Local Docker compose exited abnormally whilst running docker-compose: [exec -T centos elastic-agent enroll http://kibana:5601 RTJ1UVczTUJNNEZhU2YxbzJVNmU6TUVDOFpJcE1STy1JeERqTFBZODF5dw== -f --insecure]. exit status 2" service=centos
[2020-07-17T06:58:34.790Z] time="2020-07-17T06:58:34Z" level=error msg="Could not enroll the agent with the token" command="[elastic-agent enroll http://kibana:5601 RTJ1UVczTUJNNEZhU2YxbzJVNmU6TUVDOFpJcE1STy1JeERqTFBZODF5dw== -f --insecure]" error="Could not run compose file: [/var/lib/jenkins/workspace/stack_e2e-testing-mbp_PR-174/.op/compose/profiles/ingest-manager/docker-compose.yml /var/lib/jenkins/workspace/stack_e2e-testing-mbp_PR-174/.op/compose/services/centos/docker-compose.yml] - Local Docker compose exited abnormally whilst running docker-compose: [exec -T centos elastic-agent enroll http://kibana:5601 RTJ1UVczTUJNNEZhU2YxbzJVNmU6TUVDOFpJcE1STy1JeERqTFBZODF5dw== -f --insecure]. exit status 2" service=centos tag=7 token="RTJ1UVczTUJNNEZhU2YxbzJVNmU6TUVDOFpJcE1STy1JeERqTFBZODF5dw=="
[2020-07-17T06:58:35.363Z] Stopping ingest-manager_centos_2 ... 
[2020-07-17T06:58:47.607Z] 
Stopping ingest-manager_centos_2 ... done
Removing ingest-manager_centos_2 ... 
[2020-07-17T06:58:47.607Z] 
Removing ingest-manager_centos_2 ... done
Going to remove ingest-manager_centos_2
[2020-07-17T06:58:47.607Z] Stopping ingest-manager_kibana_1           ... 
[2020-07-17T06:58:47.607Z] Stopping ingest-manager_package-registry_1 ... 
[2020-07-17T06:58:47.607Z] Stopping ingest-manager_elasticsearch_1    ... 
[2020-07-17T06:58:52.665Z] 
Stopping ingest-manager_kibana_1           ... done

Stopping ingest-manager_package-registry_1 ... done

Stopping ingest-manager_elasticsearch_1    ... done
Removing ingest-manager_kibana_1           ... 
[2020-07-17T06:58:52.665Z] Removing ingest-manager_package-registry_1 ... 
[2020-07-17T06:58:52.665Z] Removing ingest-manager_elasticsearch_1    ... 
[2020-07-17T06:58:52.665Z] 
Removing ingest-manager_package-registry_1 ... done

Removing ingest-manager_elasticsearch_1    ... done

Removing ingest-manager_kibana_1           ... done
Removing network ingest-manager_default
[2020-07-17T06:58:52.926Z] <?xml version="1.0" encoding="UTF-8"?>
[2020-07-17T06:58:52.926Z] <testsuites name="main" tests="6" skipped="0" failures="2" errors="0" time="463.179459999">
[2020-07-17T06:58:52.926Z]   <testsuite name="Fleet Mode Agent" tests="6" skipped="0" failures="2" errors="0" time="224.477706545">
[2020-07-17T06:58:52.926Z]     <testcase name="Deploying an agent" status="passed" time="36.030131751"></testcase>
[2020-07-17T06:58:52.927Z]     <testcase name="Starting the agent starts backend processes" status="passed" time="25.057066364"></testcase>
[2020-07-17T06:58:52.927Z]     <testcase name="Stopping the agent stops backend processes" status="passed" time="20.41564252"></testcase>
[2020-07-17T06:58:52.927Z]     <testcase name="Un-enrolling an agent" status="failed" time="20.254265962">
[2020-07-17T06:58:52.927Z]       <failure message="Step the agent is not listed as online in Fleet: The Agent is still online"></failure>
[2020-07-17T06:58:52.927Z]     </testcase>
[2020-07-17T06:58:52.927Z]     <testcase name="Re-enrolling an agent" status="failed" time="20.458163644">
[2020-07-17T06:58:52.927Z]       <failure message="Step the agent is listed in Fleet as online: There are 4 online agents. We expected to have exactly one"></failure>
[2020-07-17T06:58:52.927Z]     </testcase>
[2020-07-17T06:58:52.927Z]     <testcase name="Revoking the enrollment token for an agent" status="passed" time="36.157574768"></testcase>
[2020-07-17T06:58:52.927Z]   </testsuite>
[2020-07-17T06:58:52.927Z]   <testsuite name="Stand-alone Agent Mode" tests="0" skipped="0" failures="0" errors="0" time="0"></testsuite>
[2020-07-17T06:58:52.927Z] </testsuites>make: *** [functional-test] Error 1
[2020-07-17T06:58:52.927Z] Makefile:36: recipe for target 'functional-test' failed
[2020-07-17T06:58:52.927Z] + echo 'ERROR: functional-test failed'
[2020-07-17T06:58:52.927Z] ERROR: functional-test failed
[2020-07-17T06:58:52.927Z] + exit_status=1
[2020-07-17T06:58:52.927Z] + sed -e 's/^[ \t]*//; s#>.*failed$#>#g' outputs/TEST-ingest-manager-fleet_mode
[2020-07-17T06:58:52.927Z] + grep -E '^<.*>$'
[2020-07-17T06:58:52.927Z] + exit 1
[2020-07-17T06:58:53.018Z] Recording test results
[2020-07-17T06:58:53.485Z] Archiving artifacts
[2020-07-17T06:58:53.622Z] Failed in branch ingest-manager_fleet_mode
[2020-07-17T06:58:54.911Z] Stage "Release" skipped due to earlier failure(s)
[2020-07-17T06:58:56.159Z] Running on worker-1225339 in /var/lib/jenkins/workspace/stack_e2e-testing-mbp_PR-174
[2020-07-17T06:58:56.225Z] [INFO] getVaultSecret: Getting secrets
[2020-07-17T06:58:56.302Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2020-07-17T06:58:58.369Z] + chmod 755 generate-build-data.sh
[2020-07-17T06:58:58.369Z] + ./generate-build-data.sh https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/stack/e2e-testing-mbp/PR-174/ https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/stack/e2e-testing-mbp/PR-174/runs/1 FAILURE 1141311
[2020-07-17T06:58:58.369Z] INFO: curl https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/stack/e2e-testing-mbp/PR-174/runs/1/steps/?limit=10000 -o steps-info.json
[2020-07-17T06:59:00.634Z] INFO: curl https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/stack/e2e-testing-mbp/PR-174/runs/1/tests/?status=FAILED -o tests-errors.json
[2020-07-17T06:59:01.337Z] INFO: curl https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/stack/e2e-testing-mbp/PR-174/runs/1/log/ -o pipeline-log.txt

@mdelapenya
Copy link
Contributor Author

@EricDavisX, I'm merging this to make progress and continue with #150

@mdelapenya mdelapenya merged commit c17e637 into elastic:master Jul 17, 2020
@mdelapenya mdelapenya deleted the check-agent-runs-after-unenrollment branch July 17, 2020 10:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants