From 8328a4a25a9a6e5f4be771ecfaaca44b28ee7205 Mon Sep 17 00:00:00 2001 From: gabriel-farache Date: Thu, 21 Apr 2022 14:39:15 +0200 Subject: [PATCH 01/11] Update test plans to use secured connectivity with the operator and rename edgedeployment in edgeworkload --- payload.json | 24 ++ ...eployment.json.in => edgeworkload.json.in} | 2 +- scripts/create_output_streams.sh | 7 + scripts/generate_certs.sh | 8 + scripts/get_device_update.sh | 24 ++ scripts/jmeter.log | 149 ++++++++++++ scripts/register_device.sh | 50 ++++ scripts/request_operator.sh | 24 ++ scripts/run_test_plan.sh | 69 ++++-- scripts/service.yaml | 16 ++ scripts/setup.sh | 22 ++ scripts/teardown.sh | 8 +- test_plans/flotta_test_plan.jmx | 216 ++++++++++++++++-- .../flotta_test_plan_edge_devices_only.jmx | 201 +++++++++++++++- .../flotta_test_plan_multiple_namespaces.jmx | 214 +++++++++++++++-- 15 files changed, 969 insertions(+), 65 deletions(-) create mode 100644 payload.json rename samples/{edgedeployment.json.in => edgeworkload.json.in} (97%) create mode 100755 scripts/create_output_streams.sh create mode 100755 scripts/generate_certs.sh create mode 100755 scripts/get_device_update.sh create mode 100644 scripts/jmeter.log create mode 100755 scripts/register_device.sh create mode 100755 scripts/request_operator.sh create mode 100644 scripts/service.yaml create mode 100755 scripts/setup.sh diff --git a/payload.json b/payload.json new file mode 100644 index 0000000..43b3061 --- /dev/null +++ b/payload.json @@ -0,0 +1,24 @@ +{ + "content": { + "certificate_request": "$CERTIFICATE_REQUEST", + "hardware": { + "cpu": { + "architecture": "x86_64", + "flags": [], + "model_name": "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz" + }, + "hostname": "$HOSTNAME", + "system_vendor": { + "manufacturer": "LENOVO", + "product_name": "${PRODUCT_NAME}", + "serial_number": "${SERIAL_NAME}" + } + }, + "os_image_id": "unknown" + }, + "directive": "registration", + "message_id": "$UUID", + "sent": "2021-11-21T14:45:25.271+02:00", + "type": "data", + "version": 1 +} diff --git a/samples/edgedeployment.json.in b/samples/edgeworkload.json.in similarity index 97% rename from samples/edgedeployment.json.in rename to samples/edgeworkload.json.in index 19c9af8..ae7903a 100644 --- a/samples/edgedeployment.json.in +++ b/samples/edgeworkload.json.in @@ -1,6 +1,6 @@ { "apiVersion": "management.project-flotta.io/v1alpha1", - "kind": "EdgeDeployment", + "kind": "EdgeWorkload", "name": "${DEPLOYMENT_NAME}-${DEPLOYMENT_SUFFIX}", "namespace": "${NAMESPACE}", }, diff --git a/scripts/create_output_streams.sh b/scripts/create_output_streams.sh new file mode 100755 index 0000000..4af8d62 --- /dev/null +++ b/scripts/create_output_streams.sh @@ -0,0 +1,7 @@ +#!/bin/bash +touch ${TEST_DIR}/${DEVICE_ID}_register.out +touch ${TEST_DIR}/${DEVICE_ID}_register.err +touch ${TEST_DIR}/${DEVICE_ID}_get_updates.err +touch ${TEST_DIR}/${DEVICE_ID}_get_updates.out +touch ${TEST_DIR}/${DEVICE_ID}_hearthbeat.out +touch ${TEST_DIR}/${DEVICE_ID}_hearthbeat.err \ No newline at end of file diff --git a/scripts/generate_certs.sh b/scripts/generate_certs.sh new file mode 100755 index 0000000..ea026aa --- /dev/null +++ b/scripts/generate_certs.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +# make get-certs +kubectl -n flotta get secrets flotta-ca --template="{{index .data \"ca.crt\" | base64decode}}" >${test_dir}/${DEVICE_ID}_ca.pem +export REG_SECRET_NAME=$(kubectl get secrets -n flotta -l reg-client-ca=true --sort-by=.metadata.creationTimestamp | tail -1 | awk '{print $1}') +kubectl -n flotta get secret ${REG_SECRET_NAME} --template="{{index .data \"client.crt\" | base64decode}}" > ${test_dir}/${DEVICE_ID}_cert.pem +kubectl -n flotta get secret ${REG_SECRET_NAME} --template="{{index .data \"client.key\" | base64decode}}" > ${test_dir}/${DEVICE_ID}_key.pem +# make get-certs END diff --git a/scripts/get_device_update.sh b/scripts/get_device_update.sh new file mode 100755 index 0000000..ddb012c --- /dev/null +++ b/scripts/get_device_update.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +echo "curl -XGET \\ + --cacert ${test_dir}/default_ca.pem \\ + --cert ${test_dir}/${DEVICE_ID}.pem \\ + --key ${test_dir}/${DEVICE_ID}.key -v \\ + -H \"Content-Type: application/json\" \\ + -H \"Cache-Control: no-cache\" \\ + https://${HTTP_SERVER}:${HTTP_SERVER_PORT}/${REQUEST_PATH}" + +curl -XGET \ + --cacert ${test_dir}/default_ca.pem \ + --cert ${test_dir}/${DEVICE_ID}.pem \ + --key ${test_dir}/${DEVICE_ID}.key -v \ + -H "Content-Type: application/json" \ + -H "Cache-Control: no-cache" \ + https://${HTTP_SERVER}:${HTTP_SERVER_PORT}/${REQUEST_PATH} + +if [ $? -ne 0 ]; then + echo "Error getting device updates" + exit -1 +fi; + +exit 0 diff --git a/scripts/jmeter.log b/scripts/jmeter.log new file mode 100644 index 0000000..2258c08 --- /dev/null +++ b/scripts/jmeter.log @@ -0,0 +1,149 @@ +2022-04-22 16:38:13,913 INFO o.a.j.u.JMeterUtils: Setting Locale to en_GB +2022-04-22 16:38:13,925 INFO o.a.j.JMeter: Loading user properties from: /home/test/apache-jmeter-5.4.1/bin/user.properties +2022-04-22 16:38:13,925 INFO o.a.j.JMeter: Loading system properties from: /home/test/apache-jmeter-5.4.1/bin/system.properties +2022-04-22 16:38:13,925 INFO o.a.j.JMeter: Setting JMeter property: EDGE_DEVICES_COUNT=1 +2022-04-22 16:38:13,925 INFO o.a.j.JMeter: Setting JMeter property: EDGE_DEPLOYMENTS_PER_DEVICE=5 +2022-04-22 16:38:13,925 INFO o.a.j.JMeter: Setting JMeter property: RAMP_UP_TIME=2 +2022-04-22 16:38:13,925 INFO o.a.j.JMeter: Setting JMeter property: ITERATIONS=1 +2022-04-22 16:38:13,925 INFO o.a.j.JMeter: Setting JMeter property: OCP_API_SERVER=api.mycluster.redhat.com +2022-04-22 16:38:13,925 INFO o.a.j.JMeter: Setting JMeter property: K8S_BEARER_TOKEN=eyJhbGciOiJSUzI1NiIsImtpZCI6IlhscnBTQjdRcXo0UjhWN01IZ05zdVh2WnFFajh5UTAzTk5uTjNDdnR3N0kifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJkZWZhdWx0Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZWNyZXQubmFtZSI6ImZsb3R0YS1zY2FsZS10b2tlbi1ybmR6diIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50Lm5hbWUiOiJmbG90dGEtc2NhbGUiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC51aWQiOiJiMWRhNzRmZi1jNzYzLTRkMDktODVlNS1hMjNhYmEwNjU2MWQiLCJzdWIiOiJzeXN0ZW06c2VydmljZWFjY291bnQ6ZGVmYXVsdDpmbG90dGEtc2NhbGUifQ.oR3nTYDlV0b-kghIJK3wKLei6KpGLYq1bPZei6jQDI8j76wiTbxso8O75xhele30Ss8sbRimMV3qj9QJhIcupVlBlWit7U8ENVr_7RHrh9O6F4KwNJTiW9TetOSOt7puS7hx7eDTRLIzyMbf6pfNXUUiBhIvALxnHyn2mkXoApYxkVvM7s0nWeVECx4JXJHnSh9vUje3imphOcz1hkm1H1r6vdZpjefBJPBC7ip0Ypoheud2ijKJf81cZI40FnPzny0Vl1hnPdHMtt4_sHWD_zGJIjuRbwo5h-rB7iXfAXxTf1ZpDvgbMn0p-D1AbybsIcyoHKxXZki9uG5hfOSoz1QZmvVYOEXSaHQ8tV60DJtKZfeXfyItkqvSuzl6t-ulxTJp2S5it9r_v-NIWO5CUyjsQDkYMcsA2hZqv_TGcR70bz_BjQa91dawb1b1Tj9eavmMreDqAStCQSjSB0pea5ju2D999gvYxxddUpyqOzsBfw5qMPg84JwQVrKKl5KmboQtlRqdmwyT7VJupge6HR_DhYoa7yg9hGbPdz4ZUSTje2DrqRGSfbtalYDk3vESIiHjlg2Uri9bm4K5in0Z5Dr5S95ik2SDoJmub5fATWTETMqGmzGfi0FPqkLtoMU34kCWLAi-4aHzZO8XCLlObWB0e0falK3n_o7c_I7itg4 +2022-04-22 16:38:13,926 INFO o.a.j.JMeter: Setting JMeter property: HTTP_SERVER=project-flotta.io +2022-04-22 16:38:13,926 INFO o.a.j.JMeter: Setting JMeter property: HTTP_SERVER_PORT=30043 +2022-04-22 16:38:13,926 INFO o.a.j.JMeter: Setting JMeter property: TEST_DIR=/root/gabriel-folder/flotta-scale-tests/scripts/test-run-delete_me +2022-04-22 16:38:13,926 INFO o.a.j.JMeter: Setting JMeter property: SCRIPTS_DIR=/root/gabriel-folder/flotta-scale-tests/scripts +2022-04-22 16:38:13,926 INFO o.a.j.JMeter: Setting JMeter property: NAMESPACES_COUNT=10 +2022-04-22 16:38:13,932 INFO o.a.j.JMeter: Copyright (c) 1998-2021 The Apache Software Foundation +2022-04-22 16:38:13,932 INFO o.a.j.JMeter: Version 5.4.1 +2022-04-22 16:38:13,932 INFO o.a.j.JMeter: java.version=1.8.0_302 +2022-04-22 16:38:13,932 INFO o.a.j.JMeter: java.vm.name=OpenJDK 64-Bit Server VM +2022-04-22 16:38:13,932 INFO o.a.j.JMeter: os.name=Linux +2022-04-22 16:38:13,932 INFO o.a.j.JMeter: os.arch=amd64 +2022-04-22 16:38:13,932 INFO o.a.j.JMeter: os.version=4.18.0-339.el8.x86_64 +2022-04-22 16:38:13,932 INFO o.a.j.JMeter: file.encoding=UTF-8 +2022-04-22 16:38:13,932 INFO o.a.j.JMeter: java.awt.headless=true +2022-04-22 16:38:13,933 INFO o.a.j.JMeter: Max memory =61084270592 +2022-04-22 16:38:13,933 INFO o.a.j.JMeter: Available Processors =40 +2022-04-22 16:38:13,936 INFO o.a.j.JMeter: Default Locale=English (United Kingdom) +2022-04-22 16:38:13,937 INFO o.a.j.JMeter: JMeter Locale=English (United Kingdom) +2022-04-22 16:38:13,937 INFO o.a.j.JMeter: JMeterHome=/home/test/apache-jmeter-5.4.1 +2022-04-22 16:38:13,937 INFO o.a.j.JMeter: user.dir =/root/gabriel-folder/flotta-scale-tests/scripts +2022-04-22 16:38:13,937 INFO o.a.j.JMeter: PWD =/root/gabriel-folder/flotta-scale-tests/scripts +2022-04-22 16:38:13,938 INFO o.a.j.JMeter: IP: 10.46.41.62 Name: helios05.lab.eng.tlv2.redhat.com FullName: helios05.lab.eng.tlv2.redhat.com +2022-04-22 16:38:13,941 INFO o.a.j.JMeter: Setting property 'jmeter.reportgenerator.outputdir' to:'/root/gabriel-folder/flotta-scale-tests/scripts/test-run-delete_me/results' +2022-04-22 16:38:13,943 INFO o.a.j.s.FileServer: Default base='/root/gabriel-folder/flotta-scale-tests/scripts' +2022-04-22 16:38:13,944 INFO o.a.j.s.FileServer: Set new base='/root/gabriel-folder/flotta-scale-tests/scripts/../test_plans' +2022-04-22 16:38:14,041 INFO o.a.j.s.SaveService: Testplan (JMX) version: 2.2. Testlog (JTL) version: 2.2 +2022-04-22 16:38:14,057 INFO o.a.j.s.SaveService: Using SaveService properties file encoding UTF-8 +2022-04-22 16:38:14,061 INFO o.a.j.s.SaveService: Using SaveService properties version 5.0 +2022-04-22 16:38:14,066 INFO o.a.j.s.SaveService: Loading file: ../test_plans/flotta_test_plan_edge_devices_only.jmx +2022-04-22 16:38:14,114 INFO o.a.j.p.h.s.HTTPSamplerBase: Parser for text/html is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser +2022-04-22 16:38:14,114 INFO o.a.j.p.h.s.HTTPSamplerBase: Parser for application/xhtml+xml is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser +2022-04-22 16:38:14,114 INFO o.a.j.p.h.s.HTTPSamplerBase: Parser for application/xml is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser +2022-04-22 16:38:14,114 INFO o.a.j.p.h.s.HTTPSamplerBase: Parser for text/xml is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser +2022-04-22 16:38:14,114 INFO o.a.j.p.h.s.HTTPSamplerBase: Parser for text/vnd.wap.wml is org.apache.jmeter.protocol.http.parser.RegexpHTMLParser +2022-04-22 16:38:14,114 INFO o.a.j.p.h.s.HTTPSamplerBase: Parser for text/css is org.apache.jmeter.protocol.http.parser.CssParser +2022-04-22 16:38:14,146 INFO o.a.j.JMeter: Creating summariser +2022-04-22 16:38:14,150 INFO o.a.j.r.d.ReportGenerator: ReportGenerator will use for Parsing the separator: ',' +2022-04-22 16:38:14,150 INFO o.a.j.r.d.ReportGenerator: Will generate report at end of test from results file: /root/gabriel-folder/flotta-scale-tests/scripts/test-run-delete_me/results.csv +2022-04-22 16:38:14,150 INFO o.a.j.r.d.ReportGenerator: Reading report generator properties from: /home/test/apache-jmeter-5.4.1/bin/reportgenerator.properties +2022-04-22 16:38:14,150 INFO o.a.j.r.d.ReportGenerator: Merging with JMeter properties +2022-04-22 16:38:14,154 INFO o.a.j.r.c.ReportGeneratorConfiguration: Property 'jmeter.reportgenerator.temp_dir' not found, using default value 'temp' instead. +2022-04-22 16:38:14,157 INFO o.a.j.r.c.ReportGeneratorConfiguration: Property 'jmeter.reportgenerator.apdex_per_transaction' not found, using default value 'null' instead. +2022-04-22 16:38:14,158 INFO o.a.j.r.c.ReportGeneratorConfiguration: apdex_per_transaction is empty, not APDEX per transaction customization +2022-04-22 16:38:14,158 INFO o.a.j.r.c.ReportGeneratorConfiguration: Property 'jmeter.reportgenerator.sample_filter' not found, using default value 'null' instead. +2022-04-22 16:38:14,158 INFO o.a.j.r.c.ReportGeneratorConfiguration: Property 'jmeter.reportgenerator.report_title' not found, using default value 'null' instead. +2022-04-22 16:38:14,158 INFO o.a.j.r.c.ReportGeneratorConfiguration: Property 'jmeter.reportgenerator.start_date' not found, using default value 'null' instead. +2022-04-22 16:38:14,158 INFO o.a.j.r.c.ReportGeneratorConfiguration: Property 'jmeter.reportgenerator.end_date' not found, using default value 'null' instead. +2022-04-22 16:38:14,158 INFO o.a.j.r.c.ReportGeneratorConfiguration: Property 'jmeter.reportgenerator.date_format' not found, using default value 'null' instead. +2022-04-22 16:38:14,158 INFO o.a.j.r.c.ReportGeneratorConfiguration: Will use date range start date: null, end date: null +2022-04-22 16:38:14,162 INFO o.a.j.r.c.ReportGeneratorConfiguration: Property 'jmeter.reportgenerator.graph.totalTPS.exclude_controllers' not found, using default value 'false' instead. +2022-04-22 16:38:14,162 INFO o.a.j.r.c.ReportGeneratorConfiguration: Property 'jmeter.reportgenerator.graph.activeThreadsOverTime.exclude_controllers' not found, using default value 'false' instead. +2022-04-22 16:38:14,162 INFO o.a.j.r.c.ReportGeneratorConfiguration: Property 'jmeter.reportgenerator.graph.timeVsThreads.exclude_controllers' not found, using default value 'false' instead. +2022-04-22 16:38:14,162 INFO o.a.j.r.c.ReportGeneratorConfiguration: Property 'jmeter.reportgenerator.graph.responseTimeDistribution.exclude_controllers' not found, using default value 'false' instead. +2022-04-22 16:38:14,162 INFO o.a.j.r.c.ReportGeneratorConfiguration: Property 'jmeter.reportgenerator.graph.transactionsPerSecond.exclude_controllers' not found, using default value 'false' instead. +2022-04-22 16:38:14,163 INFO o.a.j.r.c.ReportGeneratorConfiguration: Property 'jmeter.reportgenerator.graph.responseTimePercentiles.exclude_controllers' not found, using default value 'false' instead. +2022-04-22 16:38:14,163 INFO o.a.j.r.c.ReportGeneratorConfiguration: Property 'jmeter.reportgenerator.graph.responseTimePercentilesOverTime.exclude_controllers' not found, using default value 'false' instead. +2022-04-22 16:38:14,163 INFO o.a.j.r.c.ReportGeneratorConfiguration: Property 'jmeter.reportgenerator.graph.responseTimesOverTime.exclude_controllers' not found, using default value 'false' instead. +2022-04-22 16:38:14,164 INFO o.a.j.r.c.ReportGeneratorConfiguration: Property 'jmeter.reportgenerator.graph.connectTimeOverTime.exclude_controllers' not found, using default value 'false' instead. +2022-04-22 16:38:14,164 INFO o.a.j.r.c.ReportGeneratorConfiguration: Property 'jmeter.reportgenerator.graph.latenciesOverTime.exclude_controllers' not found, using default value 'false' instead. +2022-04-22 16:38:14,164 INFO o.a.j.r.c.ReportGeneratorConfiguration: Property 'jmeter.reportgenerator.exporter.json.filters_only_sample_series' not found, using default value 'true' instead. +2022-04-22 16:38:14,164 INFO o.a.j.r.c.ReportGeneratorConfiguration: Property 'jmeter.reportgenerator.exporter.json.series_filter' not found, using default value '' instead. +2022-04-22 16:38:14,165 INFO o.a.j.r.c.ReportGeneratorConfiguration: Property 'jmeter.reportgenerator.exporter.json.show_controllers_only' not found, using default value 'false' instead. +2022-04-22 16:38:14,165 INFO o.a.j.r.c.ReportGeneratorConfiguration: Property 'jmeter.reportgenerator.exporter.html.filters_only_sample_series' not found, using default value 'true' instead. +2022-04-22 16:38:14,165 INFO o.a.j.r.c.ReportGeneratorConfiguration: Property 'jmeter.reportgenerator.exporter.html.series_filter' not found, using default value '' instead. +2022-04-22 16:38:14,165 INFO o.a.j.r.c.ReportGeneratorConfiguration: Property 'jmeter.reportgenerator.exporter.html.show_controllers_only' not found, using default value 'false' instead. +2022-04-22 16:38:14,169 INFO o.a.j.e.StandardJMeterEngine: Running the test! +2022-04-22 16:38:14,184 INFO o.a.j.s.SampleEvent: List of sample_variables: [] +2022-04-22 16:38:14,184 INFO o.a.j.s.SampleEvent: List of sample_variables: [] +2022-04-22 16:38:14,189 INFO o.a.j.e.u.CompoundVariable: Note: Function class names must contain the string: '.functions.' +2022-04-22 16:38:14,189 INFO o.a.j.e.u.CompoundVariable: Note: Function class names must not contain the string: '.gui.' +2022-04-22 16:38:14,474 INFO o.a.j.JMeter: Running test (1650634694474) +2022-04-22 16:38:14,541 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : Edge Devices +2022-04-22 16:38:14,541 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group Edge Devices. +2022-04-22 16:38:14,541 INFO o.a.j.e.StandardJMeterEngine: Thread will start next loop on error +2022-04-22 16:38:14,542 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=2 delayedStart=false +2022-04-22 16:38:14,545 INFO o.a.j.t.ThreadGroup: Started thread group number 1 +2022-04-22 16:38:14,545 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started +2022-04-22 16:38:14,548 INFO o.a.j.t.JMeterThread: Thread started: Edge Devices 1-1 +2022-04-22 16:38:14,552 INFO o.a.j.s.SampleResult: Note: Sample TimeStamps are START times +2022-04-22 16:38:14,552 INFO o.a.j.s.SampleResult: sampleresult.default.encoding is set to ISO-8859-1 +2022-04-22 16:38:14,552 INFO o.a.j.s.SampleResult: sampleresult.useNanoTime=true +2022-04-22 16:38:14,552 INFO o.a.j.s.SampleResult: sampleresult.nanoThreadSleep=5000 +2022-04-22 16:38:14,791 INFO o.a.j.p.h.s.HTTPHCAbstractImpl: Local host = helios05.lab.eng.tlv2.redhat.com +2022-04-22 16:38:14,796 INFO o.a.j.p.h.s.HTTPHC4Impl: HTTP request retry count = 1 +2022-04-22 16:38:14,869 INFO o.a.j.p.h.s.h.LazyLayeredConnectionSocketFactory: Setting up HTTPS TrustAll Socket Factory +2022-04-22 16:38:14,873 INFO o.a.j.u.JsseSSLManager: Using default SSL protocol: TLS +2022-04-22 16:38:14,873 INFO o.a.j.u.JsseSSLManager: SSL session context: per-thread +2022-04-22 16:38:14,919 INFO o.a.j.u.SSLManager: JmeterKeyStore Location: type JKS +2022-04-22 16:38:14,922 INFO o.a.j.u.SSLManager: KeyStore created OK +2022-04-22 16:38:14,922 WARN o.a.j.u.SSLManager: Keystore file not found, loading empty keystore +2022-04-22 16:38:30,144 INFO o.a.j.r.Summariser: summary + 4 in 00:00:16 = 0.3/s Avg: 124 Min: 14 Max: 249 Err: 0 (0.00%) Active: 1 Started: 1 Finished: 0 +2022-04-22 16:39:00,218 INFO o.a.j.r.Summariser: summary + 2 in 00:00:30 = 0.1/s Avg: 35 Min: 34 Max: 36 Err: 0 (0.00%) Active: 1 Started: 1 Finished: 0 +2022-04-22 16:39:00,219 INFO o.a.j.r.Summariser: summary = 6 in 00:00:46 = 0.1/s Avg: 94 Min: 14 Max: 249 Err: 0 (0.00%) +2022-04-22 16:39:15,318 INFO o.a.j.t.JMeterThread: Thread is done: Edge Devices 1-1 +2022-04-22 16:39:15,318 INFO o.a.j.t.JMeterThread: Thread finished: Edge Devices 1-1 +2022-04-22 16:39:15,322 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test +2022-04-22 16:39:15,323 INFO o.a.j.r.Summariser: summary + 3 in 00:00:15 = 0.2/s Avg: 31 Min: 23 Max: 36 Err: 0 (0.00%) Active: 0 Started: 1 Finished: 1 +2022-04-22 16:39:15,324 INFO o.a.j.r.Summariser: summary = 9 in 00:01:01 = 0.1/s Avg: 73 Min: 14 Max: 249 Err: 0 (0.00%) +2022-04-22 16:39:15,325 INFO o.a.j.JMeter: Generating Dashboard +2022-04-22 16:39:15,325 INFO o.a.j.r.d.ReportGenerator: Flushing result collector before report Generation +2022-04-22 16:39:15,341 INFO o.a.j.r.p.NormalizerSampleConsumer: Using format, 'ms', to parse timeStamp field +2022-04-22 16:39:15,391 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.AggregateConsumer#stopProducing(): beginDate produced 0 samples +2022-04-22 16:39:15,391 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.AggregateConsumer#stopProducing(): endDate produced 0 samples +2022-04-22 16:39:15,392 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.ApdexSummaryConsumer#stopProducing(): apdexSummary produced 0 samples +2022-04-22 16:39:15,393 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.RequestsSummaryConsumer#stopProducing(): requestsSummary produced 0 samples +2022-04-22 16:39:15,398 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.StatisticsSummaryConsumer#stopProducing(): statisticsSummary produced 0 samples +2022-04-22 16:39:15,401 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.Top5ErrorsBySamplerConsumer#stopProducing(): top5ErrorsBySampler produced 0 samples +2022-04-22 16:39:15,401 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.ErrorsSummaryConsumer#stopProducing(): errorsSummary produced 0 samples +2022-04-22 16:39:15,401 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.graph.impl.HitsPerSecondGraphConsumer#stopProducing(): hitsPerSecond produced 0 samples +2022-04-22 16:39:15,406 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.graph.impl.LatencyVSRequestGraphConsumer#stopProducing(): latencyVsRequest produced 0 samples +2022-04-22 16:39:15,406 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.graph.impl.SyntheticResponseTimeDistributionGraphConsumer#stopProducing(): syntheticResponseTimeDistribution produced 0 samples +2022-04-22 16:39:15,407 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.graph.impl.BytesThroughputGraphConsumer#stopProducing(): bytesThroughputOverTime produced 0 samples +2022-04-22 16:39:15,407 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.graph.impl.CodesPerSecondGraphConsumer#stopProducing(): codesPerSecond produced 0 samples +2022-04-22 16:39:15,408 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.graph.impl.ResponseTimeVSRequestGraphConsumer#stopProducing(): responseTimeVsRequest produced 0 samples +2022-04-22 16:39:15,408 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.FilterConsumer#stopProducing(): startIntervalControlerFilter produced 70 samples +2022-04-22 16:39:15,408 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.graph.impl.TotalTPSGraphConsumer#stopProducing(): totalTPS produced 0 samples +2022-04-22 16:39:15,408 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.graph.impl.ActiveThreadsGraphConsumer#stopProducing(): activeThreadsOverTime produced 0 samples +2022-04-22 16:39:15,408 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.graph.impl.TimeVSThreadGraphConsumer#stopProducing(): timeVsThreads produced 0 samples +2022-04-22 16:39:15,409 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.graph.impl.ResponseTimeDistributionGraphConsumer#stopProducing(): responseTimeDistribution produced 0 samples +2022-04-22 16:39:15,409 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.graph.impl.TransactionsPerSecondGraphConsumer#stopProducing(): transactionsPerSecond produced 0 samples +2022-04-22 16:39:15,409 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.graph.impl.ResponseTimePercentilesGraphConsumer#stopProducing(): responseTimePercentiles produced 0 samples +2022-04-22 16:39:15,411 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.graph.impl.ResponseTimePercentilesOverTimeGraphConsumer#stopProducing(): responseTimePercentilesOverTime produced 0 samples +2022-04-22 16:39:15,411 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.graph.impl.ResponseTimeOverTimeGraphConsumer#stopProducing(): responseTimesOverTime produced 0 samples +2022-04-22 16:39:15,411 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.graph.impl.ConnectTimeOverTimeGraphConsumer#stopProducing(): connectTimeOverTime produced 0 samples +2022-04-22 16:39:15,411 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.graph.impl.LatencyOverTimeGraphConsumer#stopProducing(): latenciesOverTime produced 0 samples +2022-04-22 16:39:15,411 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.FilterConsumer#stopProducing(): nameFilter produced 150 samples +2022-04-22 16:39:15,411 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.FilterConsumer#stopProducing(): dateRangeFilter produced 30 samples +2022-04-22 16:39:15,411 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.NormalizerSampleConsumer#stopProducing(): normalizer produced 10 samples +2022-04-22 16:39:15,412 INFO o.a.j.r.p.CsvFileSampleSource: produce(): 10 samples produced in 50ms on channel 0 +2022-04-22 16:39:15,412 INFO o.a.j.r.d.ReportGenerator: Exporting data using exporter:'json' of className:'org.apache.jmeter.report.dashboard.JsonExporter' +2022-04-22 16:39:15,500 INFO o.a.j.r.d.JsonExporter: Found data for consumer statisticsSummary in context +2022-04-22 16:39:15,500 INFO o.a.j.r.d.JsonExporter: Creating statistics for overall +2022-04-22 16:39:15,500 INFO o.a.j.r.d.JsonExporter: Creating statistics for other transactions +2022-04-22 16:39:15,501 INFO o.a.j.r.d.JsonExporter: Checking output folder +2022-04-22 16:39:15,501 INFO o.a.j.r.d.JsonExporter: Writing statistics JSON to /root/gabriel-folder/flotta-scale-tests/scripts/test-run-delete_me/results/statistics.json +2022-04-22 16:39:15,531 INFO o.a.j.r.d.ReportGenerator: Exporting data using exporter:'html' of className:'org.apache.jmeter.report.dashboard.HtmlTemplateExporter' +2022-04-22 16:39:15,533 INFO o.a.j.r.d.HtmlTemplateExporter: Will generate dashboard in folder: /root/gabriel-folder/flotta-scale-tests/scripts/test-run-delete_me/results +2022-04-22 16:39:15,611 INFO o.a.j.r.d.HtmlTemplateExporter: Report will be generated in: /root/gabriel-folder/flotta-scale-tests/scripts/test-run-delete_me/results, creating folder structure +2022-04-22 16:39:15,613 INFO o.a.j.r.d.TemplateVisitor: Copying folder from '/home/test/apache-jmeter-5.4.1/bin/report-template' to '/root/gabriel-folder/flotta-scale-tests/scripts/test-run-delete_me/results', got message: /root/gabriel-folder/flotta-scale-tests/scripts/test-run-delete_me/results, found non empty folder with following content [/root/gabriel-folder/flotta-scale-tests/scripts/test-run-delete_me/results/statistics.json], will be ignored +2022-04-22 16:39:15,767 INFO o.a.j.JMeter: Dashboard generated diff --git a/scripts/register_device.sh b/scripts/register_device.sh new file mode 100755 index 0000000..6f8f712 --- /dev/null +++ b/scripts/register_device.sh @@ -0,0 +1,50 @@ +#!/bin/bash +openssl ecparam -name prime256v1 -genkey -noout -out ${test_dir}/${DEVICE_ID}.key +openssl req -new -subj '/CN=${DEVICE_ID}' -key ${test_dir}/${DEVICE_ID}.key -out ${test_dir}/${DEVICE_ID}.csr +export CERTIFICATE_REQUEST=$(cat ${test_dir}/${DEVICE_ID}.csr | sed 's/$/\\n/' | tr -d '\n') +UUID=$(uuidgen) +echo "${PAYLOAD}" | sed -e 's/"content": {/"content": {\n "certificate_request": "$CERTIFICATE_REQUEST",/g' | envsubst > ${test_dir}/${DEVICE_ID}_payload.json + +#Verify! +cat ${test_dir}/${DEVICE_ID}_payload.json | jq . + +if [ $? -ne 0 ]; then + echo "Error when checking ${test_dir}/${DEVICE_ID}_payload.json" + exit -1 +fi +echo "curl \ + --cacert ${test_dir}/default_ca.pem \\ + --cert ${test_dir}/default_cert.pem \\ + --key ${test_dir}/default_key.pem -v \\ + -d @${test_dir}/${DEVICE_ID}_payload.json \\ + -X POST \\ + -H \"Content-Type: application/json\" \ + -o ${test_dir}/${DEVICE_ID}_response.json \\ + https://${HTTP_SERVER}:${HTTP_SERVER_PORT}/api/flotta-management/v1/data/${DEVICE_ID}/out" + +curl \ + --cacert ${test_dir}/default_ca.pem \ + --cert ${test_dir}/default_cert.pem \ + --key ${test_dir}/default_key.pem -v \ + -d @${test_dir}/${DEVICE_ID}_payload.json \ + -X POST \ + -H "Content-Type: application/json" \ + -o ${test_dir}/${DEVICE_ID}_response.json \ + https://${HTTP_SERVER}:${HTTP_SERVER_PORT}/api/flotta-management/v1/data/${DEVICE_ID}/out +if [ $? -ne 0 ]; then + echo "Error when sending registration request, see ${test_dir}/${DEVICE_ID}_register.out" + exit -1 +fi + +cat ${test_dir}/${DEVICE_ID}_response.json | jq '.content.certificate' | sed -e 's/\\n/\n/g' | sed -e 's/"//g' > ${test_dir}/${DEVICE_ID}.pem + + +#openssl x509 -in ${test_dir}/${DEVICE_ID}.pem --text + +if [ $? -ne 0 ]; then + echo "Error when extracting ${test_dir}/${DEVICE_ID}_response.json to ${test_dir}/${DEVICE_ID}.pem" + exit -1 +fi + +exit 0 + diff --git a/scripts/request_operator.sh b/scripts/request_operator.sh new file mode 100755 index 0000000..0d5553a --- /dev/null +++ b/scripts/request_operator.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +echo "curl -XPOST \\ + --cacert ${test_dir}/default_ca.pem \\ + --cert ${test_dir}/${DEVICE_ID}.pem \\ + --key ${test_dir}/${DEVICE_ID}.key -v \\ + -H \"Content-Type: application/json\" \\ + --data ${POST_BODY} \\ + https://${HTTP_SERVER}:${HTTP_SERVER_PORT}/${REQUEST_PATH}" + +curl -XPOST \ + --cacert ${test_dir}/default_ca.pem \ + --cert ${test_dir}/${DEVICE_ID}.pem \ + --key ${test_dir}/${DEVICE_ID}.key -v \ + -H "Content-Type: application/json" \ + --data ${POST_BODY} \ + https://${HTTP_SERVER}:${HTTP_SERVER_PORT}/${REQUEST_PATH} + +if [ $? -ne 0 ]; then + echo "Error posting device" + exit -1 +fi; + +exit 0 diff --git a/scripts/run_test_plan.sh b/scripts/run_test_plan.sh index 59ebc1d..20be33e 100755 --- a/scripts/run_test_plan.sh +++ b/scripts/run_test_plan.sh @@ -20,7 +20,7 @@ OPTIONS: -m Run must-gather to collect logs (default: false) -n Test run ID -o Edge deployment updates concurrency (default: 5) - -p Total of edge deployments per device + -p Total of edge workloads per device -q Number of namespaces (default: 10). Requires hacked version of flotta-operator and specific test plan. -r Ramp-up time in seconds to create all edge devices -s Address of OCP API server @@ -57,7 +57,7 @@ while getopts "c:d:e:f:g:h:i:j:k:l:m:n:o:p:q:r:s:t:u:v" option; do l) LOG_LEVEL=${OPTARG};; m) MUST_GATHER=${OPTARG};; n) TEST_ID=${OPTARG};; - o) EDGEDEPLOYMENT_CONCURRENCY=${OPTARG};; + o) edgeworkloadMENT_CONCURRENCY=${OPTARG};; p) EDGE_DEPLOYMENTS_PER_DEVICE=${OPTARG};; q) NAMESPACES_COUNT=${OPTARG};; r) RAMP_UP_TIME=${OPTARG};; @@ -86,9 +86,9 @@ if [[ -z $REPLICAS ]]; then echo "INFO: Number of replicas not specified. Using default value: $REPLICAS" fi -if [[ -z $EDGEDEPLOYMENT_CONCURRENCY ]]; then - EDGEDEPLOYMENT_CONCURRENCY=5 - echo "INFO: Edge deployment concurrency not specified. Using default value: $EDGEDEPLOYMENT_CONCURRENCY" +if [[ -z $edgeworkloadMENT_CONCURRENCY ]]; then + edgeworkloadMENT_CONCURRENCY=5 + echo "INFO: Edge deployment concurrency not specified. Using default value: $edgeworkloadMENT_CONCURRENCY" fi if [[ -z $TEST_ID ]]; then @@ -104,7 +104,7 @@ if [[ -z $EDGE_DEVICES_COUNT ]]; then fi if [[ -z $EDGE_DEPLOYMENTS_PER_DEVICE ]]; then - echo "ERROR: Edge deployments per device is required" + echo "ERROR: edge workloads per device is required" usage exit 1 fi @@ -189,7 +189,7 @@ if [[ -n $VERBOSE ]]; then set -xv fi -test_dir="./test-run-${TEST_ID}" +export test_dir="$(pwd)/test-run-${TEST_ID}" if [ -d "$test_dir" ]; then echo "ERROR: Test directory $test_dir already exists" exit 1 @@ -209,7 +209,7 @@ echo "Target folder: $test_dir" echo "Test ID: ${TEST_ID}" echo "Test plan: ${TEST_PLAN}" echo "Total of edge devices: ${EDGE_DEVICES_COUNT}" -echo "Edge deployments per device: ${EDGE_DEPLOYMENTS_PER_DEVICE}" +echo "edge workloads per device: ${EDGE_DEPLOYMENTS_PER_DEVICE}" echo "Ramp-up time: ${RAMP_UP_TIME}" echo "Iterations: ${ITERATIONS}" echo "OCP API server: ${OCP_API_SERVER}" @@ -223,8 +223,8 @@ echo "----------------------------------------------------" cp $TEST_PLAN $test_dir/ edgedevices=$(kubectl get edgedevices --all-namespaces | wc -l) -edgedeploy=$(kubectl get edgedeployments --all-namespaces | wc -l) -echo "Before test: There are $edgedevices edge devices and $edgedeploy edge deployments" >> $test_dir/summary.txt +edgeworkload=$(kubectl get edgeworkloads --all-namespaces | wc -l) +echo "Before test: There are $edgedevices edge devices and $edgeworkload edge workloads" >> $test_dir/summary.txt } run_test() @@ -240,6 +240,8 @@ JVM_ARGS="-Xms4g -Xmx64g -Xss250k -XX:MaxMetaspaceSize=1g" $JMETER_HOME/bin/jmet -JK8S_BEARER_TOKEN=$K8S_BEARER_TOKEN \ -JHTTP_SERVER=$HTTP_SERVER \ -JHTTP_SERVER_PORT=$HTTP_SERVER_PORT \ + -JTEST_DIR=$test_dir \ + -JSCRIPTS_DIR=`pwd` \ -JNAMESPACES_COUNT=$NAMESPACES_COUNT|& tee -a $test_dir/summary.txt } @@ -253,13 +255,13 @@ echo "After test:" >> $test_dir/summary.txt if [[ -z $RUN_WITHOUT_NAMESPACES ]]; then edgedevices=$(kubectl get edgedevices --all-namespaces | wc -l) - edgedeploy=$(kubectl get edgedeployments --all-namespaces | wc -l) - echo "There are $edgedevices edge devices and $edgedeploy edge deployments" >> $test_dir/summary.txt + edgeworkload=$(kubectl get edgeworkloads --all-namespaces | wc -l) + echo "There are $edgedevices edge devices and $edgeworkload edge workloads" >> $test_dir/summary.txt else for i in $(seq 1 $NAMESPACES_COUNT); do edgedevices=$(kubectl get edgedevices -n $i | wc -l) - edgedeploy=$(kubectl get edgedeployments -n $i | wc -l) - echo "There are $edgedevices edge devices and $edgedeploy edge deployments in namespace $i" >> $test_dir/summary.txt + edgeworkload=$(kubectl get edgeworkloads -n $i | wc -l) + echo "There are $edgedevices edge devices and $edgeworkload edge workloads in namespace $i" >> $test_dir/summary.txt done fi @@ -297,7 +299,7 @@ kubectl patch cm -n flotta flotta-operator-manager-config --type merge --patch ' "LOG_LEVEL": "'$LOG_LEVEL'", "OBC_AUTO_CREATE": "false", "MAX_CONCURRENT_RECONCILES": "'$MAX_CONCURRENT_RECONCILES'", - "EDGEDEPLOYMENT_CONCURRENCY": "'$EDGEDEPLOYMENT_CONCURRENCY'", + "edgeworkloadMENT_CONCURRENCY": "'$edgeworkloadMENT_CONCURRENCY'", "NAMESPACES_COUNT": "'$NAMESPACES_COUNT'"} }' @@ -392,11 +394,17 @@ kubectl scale --replicas=$REPLICAS deployment flotta-operator-controller-manager kubectl wait --for=condition=available -n flotta deployment.apps/flotta-operator-controller-manager count=0 - +DEVICE_ID='default' +DEVICE_ID=$DEVICE_ID sh generate_certs.sh echo "Waiting for HTTP server to be ready at $HTTP_SERVER" until [[ count -gt 100 ]] do - curl -m 5 -s -i "$HTTP_SERVER":"$HTTP_SERVER_PORT" | grep 404 > /dev/null + curl \ + --cacert ${test_dir}/${DEVICE_ID}_ca.pem \ + --cert ${test_dir}/${DEVICE_ID}_cert.pem \ + --key ${test_dir}/${DEVICE_ID}_key.pem -v \ + -m 5 -s -i \ + https://${HTTP_SERVER}:${HTTP_SERVER_PORT} | grep 404 > /dev/null if [ "$?" == "1" ]; then echo -n "." count=$((count+1)) @@ -422,8 +430,35 @@ kubectl top pods -n flotta --use-protocol-buffers } >> $test_dir/summary.txt } +setup() +{ + sysctl -w net.core.somaxconn=50000 + sysctl -w net.core.netdev_max_backlog=50000 + sysctl -w net.ipv4.tcp_max_syn_backlog=50000 + sysctl -w net.ipv4.ip_local_port_range="15000 65000" + sysctl -w net.ipv4.tcp_fin_timeout=10 + sysctl -w vm.max_map_count=999999 + sysctl -w kernel.threads-max=4113992 + + if [ -z $(grep "* soft nofile 999999" "/etc/security/limits.conf") ]; then + cat "* soft nofile 999999" >> /etc/security/limits.conf + fi + + if [ -z $(grep "* hard nofile 999999" "/etc/security/limits.conf") ]; then + cat "* hard nofile 999999" >> /etc/security/limits.conf + fi + + + ifconfig br-ex txqueuelen 5000 + ifconfig cni-podman0 txqueuelen 5000 + ifconfig ens3 txqueuelen 5000 + ifconfig ens4 txqueuelen 5000 + ifconfig ovn-k8s-mp0 txqueuelen 5000 +} + parse_args "$@" log_run_details +setup patch_flotta_operator log_pods_details run_test diff --git a/scripts/service.yaml b/scripts/service.yaml new file mode 100644 index 0000000..c453c02 --- /dev/null +++ b/scripts/service.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + name: flotta-svc + namespace: flotta +spec: + type: NodePort + selector: + control-plane: controller-manager + ports: + # By default and for convenience, the `targetPort` is set to the same value as the `port` field. + - port: 8043 + targetPort: 8043 + # Optional field + # By default and for convenience, the Kubernetes control plane will allocate a port from a range (default: 30000-32767) + nodePort: 30043 diff --git a/scripts/setup.sh b/scripts/setup.sh new file mode 100755 index 0000000..b68ee09 --- /dev/null +++ b/scripts/setup.sh @@ -0,0 +1,22 @@ +sysctl -w net.core.somaxconn=50000 +sysctl -w net.core.netdev_max_backlog=50000 +sysctl -w net.ipv4.tcp_max_syn_backlog=50000 +sysctl -w net.ipv4.ip_local_port_range="15000 65000" +sysctl -w net.ipv4.tcp_fin_timeout=10 +sysctl -w vm.max_map_count=999999 +sysctl -w kernel.threads-max=4113992 + +if [ -z $(grep "* soft nofile 999999" "/etc/security/limits.conf") ]; then + cat "* soft nofile 999999" >> /etc/security/limits.conf +fi + +if [ -z $(grep "* hard nofile 999999" "/etc/security/limits.conf") ]; then + cat "* hard nofile 999999" >> /etc/security/limits.conf +fi + + +ifconfig br-ex txqueuelen 5000 +ifconfig cni-podman0 txqueuelen 5000 +ifconfig ens3 txqueuelen 5000 +ifconfig ens4 txqueuelen 5000 +ifconfig ovn-k8s-mp0 txqueuelen 5000 \ No newline at end of file diff --git a/scripts/teardown.sh b/scripts/teardown.sh index f10c7a6..bca618f 100755 --- a/scripts/teardown.sh +++ b/scripts/teardown.sh @@ -5,15 +5,15 @@ if [ $# -eq 1 ]; then do NS=$((i - 1)) kubectl get edgedevices -n $NS --no-headers | awk -v ns=$NS '{print $1 " --namespace=" ns}' | xargs -P 20 -n 2 kubectl patch edgedevice -p '{"metadata":{"finalizers":null}}' --type=merge - kubectl get edgedeployment -n $NS --no-headers | awk -v ns=$NS '{print $1 " --namespace=" ns}' | xargs -P 20 -n 2 kubectl patch edgedeployment -p '{"metadata":{"finalizers":null}}' --type=merge + kubectl get edgeworkload -n $NS --no-headers | awk -v ns=$NS '{print $1 " --namespace=" ns}' | xargs -P 20 -n 2 kubectl patch edgeworkload -p '{"metadata":{"finalizers":null}}' --type=merge kubectl delete edgedevice --all -n $NS - kubectl delete edgedeployments --all -n $NS + kubectl delete edgeworkloads --all -n $NS kubectl delete ns $NS done exit 0 fi kubectl get edgedevices --all-namespaces --no-headers | awk '{print $2 " --namespace=" $1}' | xargs -P 20 -n 2 kubectl patch edgedevice -p '{"metadata":{"finalizers":null}}' --type=merge -kubectl get edgedeployment --all-namespaces --no-headers | awk '{print $2 " --namespace=" $1}' | xargs -P 20 -n 2 kubectl patch edgedeployment -p '{"metadata":{"finalizers":null}}' --type=merge +kubectl get edgeworkload --all-namespaces --no-headers | awk '{print $2 " --namespace=" $1}' | xargs -P 20 -n 2 kubectl patch edgeworkload -p '{"metadata":{"finalizers":null}}' --type=merge kubectl delete edgedevice --all --all-namespaces -kubectl delete edgedeployments --all --all-namespaces +kubectl delete edgeworkloads --all --all-namespaces diff --git a/test_plans/flotta_test_plan.jmx b/test_plans/flotta_test_plan.jmx index 64b2f0a..2d25c27 100644 --- a/test_plans/flotta_test_plan.jmx +++ b/test_plans/flotta_test_plan.jmx @@ -1,5 +1,5 @@ - + @@ -10,7 +10,7 @@ HTTP_SERVER - localhost:8888 + localhost:8084 = @@ -28,17 +28,21 @@ LABEL_VALUE NAMESPACE DEPLOYMENTS_PER_DEVICE + TEST_DIR + SCRIPTS_DIR - - ${__P(HTTP_SERVER,flotta-operator-controller-manager-flotta-operator-system.apps.mycluster.redhat.com)} + + ${__P(HTTP_SERVER,flotta-operator-controller-manager-flotta-operator-system.apps.mycluster.redhat.com)} ${__P(HTTP_SERVER_PORT,80)} ${__P(OCP_API_SERVER,api.mycluster.redhat.com)} - ${__P(OCP_API_PORT,6443)} + ${__P(OCP_API_PORT,6443)} region emea default ${__P(DEPLOYMENTS_PER_DEVICE,5)} + ${__P(TEST_DIR,test_dir_delete_me)} + ${__P(SCRIPTS_DIR,.)} false @@ -58,6 +62,30 @@ true + + true + 0 + /bin/bash + + + + + -c + = + + + + ${SCRIPTS_DIR}/create_output_streams.sh + = + + + + + + + + + @@ -83,7 +111,64 @@ The device ID to be used for the entire scenario of a specific device and additional device properties - + + true + 0 + /bin/bash + + + + + -c + = + + + + ${SCRIPTS_DIR}/register_device.sh + = + + + + + + + DEVICE_ID + ${DEVICE_ID} + = + + + HTTP_SERVER + ${HTTP_SERVER} + = + + + HTTP_SERVER_PORT + ${HTTP_SERVER_PORT} + = + + + PRODUCT_NAME + ${PRODUCT_NAME} + = + + + SERIAL_NAME + ${SERIAL_NAME} + = + + + PAYLOAD + { "content": { "hardware": { "cpu": { "architecture": "x86_64", "flags": [], "model_name": "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz" }, "hostname": "${HOSTNAME}", "system_vendor": { "manufacturer": "LENOVO", "product_name": "${PRODUCT_NAME}", "serial_number": "${SERIAL_NAME}" } }, "os_image_id": "unknown" }, "directive": "registration", "message_id": "${__UUID()}", "sent": "2021-11-21T14:45:25.271+02:00", "type": "data", "version": 1 } + = + + + + + ${TEST_DIR}/${DEVICE_ID}_register.out + ${TEST_DIR}/${DEVICE_ID}_register.err + + + true @@ -218,9 +303,9 @@ - + - + true ${DEPLOYMENTS_PER_DEVICE} @@ -235,7 +320,7 @@ true - + true @@ -243,7 +328,7 @@ false { "apiVersion": "management.project-flotta.io/v1alpha1", - "kind": "EdgeDeployment", + "kind": "EdgeWorkload", "metadata": { "name": "${DEVICE_ID}-${NameSuffix}", "namespace": "default" @@ -290,7 +375,7 @@ ${OCP_API_PORT} https UTF-8 - /apis/management.project-flotta.io/v1alpha1/namespaces/${NAMESPACE}/edgedeployments + /apis/management.project-flotta.io/v1alpha1/namespaces/${NAMESPACE}/edgeworkloads POST true false @@ -300,7 +385,7 @@ HttpClient4 - Create Edge Deployment with labels matching for device + Create Edge Workload with labels matching for device @@ -328,8 +413,8 @@ - - Add delays between edgedeployments creation of the same device + + Add delays between edgeworkloads creation of the same device 1000 @@ -340,7 +425,7 @@ 4 - + @@ -360,13 +445,112 @@ + + true + 0 + /bin/bash + + + + + -c + = + + + + ${SCRIPTS_DIR}/get_device_update.sh + = + + + + + + + REQUEST_PATH + api/flotta-management/v1/data/${DEVICE_ID}/in + = + + + DEVICE_ID + ${DEVICE_ID} + = + + + HTTP_SERVER + ${HTTP_SERVER} + = + + + HTTP_SERVER_PORT + ${HTTP_SERVER_PORT} + = + + + + + ${TEST_DIR}/${DEVICE_ID}_get_updates.out + ${TEST_DIR}/${DEVICE_ID}_get_updates.err + + Add delays between Get Updates requests 15000 - + + true + 0 + /bin/bash + + + + + -c + = + + + + ${SCRIPTS_DIR}/request_operator.sh + = + + + + + + + REQUEST_PATH + api/flotta-management/v1/data/${DEVICE_ID}/out + = + + + POST_BODY + { "content": { "events": [ { "message": "error starting container f8433cc4b0c963ce95625ab3b1811382f852432f61a2d087422210e9d34bc2bc: cannot listen on the TCP port: listen tcp4 :11000: bind: address already in use,error starting container 7cd64802bde9d6b9dd425d79ea68eb49546e5fc87d0dce474c7515e81f448d50: a dependency of container 7cd64802bde9d6b9dd425d79ea68eb49546e5fc87d0dce474c7515e81f448d50 failed to start: container state improper", "reason": "Failed", "type": "warn" }, { "message": "error starting container f8433cc4b0c963ce95625ab3b1811382f852432f61a2d087422210e9d34bc2bc: cannot listen on the TCP port: listen tcp4 :11000: bind: address already in use,error starting container 7cd64802bde9d6b9dd425d79ea68eb49546e5fc87d0dce474c7515e81f448d50: a dependency of container 7cd64802bde9d6b9dd425d79ea68eb49546e5fc87d0dce474c7515e81f448d50 failed to start: container state improper", "reason": "Failed", "type": "warn" }, { "message": "error starting container f8433cc4b0c963ce95625ab3b1811382f852432f61a2d087422210e9d34bc2bc: cannot listen on the TCP port: listen tcp4 :11000: bind: address already in use,error starting container 7cd64802bde9d6b9dd425d79ea68eb49546e5fc87d0dce474c7515e81f448d50: a dependency of container 7cd64802bde9d6b9dd425d79ea68eb49546e5fc87d0dce474c7515e81f448d50 failed to start: container state improper", "reason": "Failed", "type": "warn" }, { "message": "error starting container f8433cc4b0c963ce95625ab3b1811382f852432f61a2d087422210e9d34bc2bc: cannot listen on the TCP port: listen tcp4 :11000: bind: address already in use,error starting container 7cd64802bde9d6b9dd425d79ea68eb49546e5fc87d0dce474c7515e81f448d50: a dependency of container 7cd64802bde9d6b9dd425d79ea68eb49546e5fc87d0dce474c7515e81f448d50 failed to start: container state improper", "reason": "Failed", "type": "warn" } ], "status": "up", "time": "${__time(yyyy-MM-dd'T'HH:mm:ss.SSS'Z')}", "version": "278650", "workloads": [ { "last_data_upload": "0001-01-01T00:00:00.000Z", "name": "${DEVICE_ID}-1", "status": "Running" }, { "last_data_upload": "0001-01-01T00:00:00.000Z", "name": "${DEVICE_ID}-2", "status": "Created" }, { "last_data_upload": "0001-01-01T00:00:00.000Z", "name": "${DEVICE_ID}-3", "status": "Running" }, { "last_data_upload": "0001-01-01T00:00:00.000Z", "name": "${DEVICE_ID}-4", "status": "Created" }, { "last_data_upload": "0001-01-01T00:00:00.000Z", "name": "${DEVICE_ID}-5", "status": "Running" }, { "last_data_upload": "0001-01-01T00:00:00.000Z", "name": "${DEVICE_ID}-6", "status": "Created" }, { "last_data_upload": "0001-01-01T00:00:00.000Z", "name": "${DEVICE_ID}-7", "status": "Running" }, { "last_data_upload": "0001-01-01T00:00:00.000Z", "name": "${DEVICE_ID}-8", "status": "Created" }, { "last_data_upload": "0001-01-01T00:00:00.000Z", "name": "${DEVICE_ID}-9", "status": "Running" } ] }, "directive": "heartbeat", "message_id": "${__UUID()}", "type": "data", "version": 1 } + = + + + DEVICE_ID + ${DEVICE_ID} + = + + + HTTP_SERVER + ${HTTP_SERVER} + = + + + HTTP_SERVER_PORT + ${HTTP_SERVER_PORT} + = + + + + + ${TEST_DIR}/${DEVICE_ID}_hearthbeat.out + ${TEST_DIR}/${DEVICE_ID}_hearthbeat.err + + + true diff --git a/test_plans/flotta_test_plan_edge_devices_only.jmx b/test_plans/flotta_test_plan_edge_devices_only.jmx index 3ddac93..ad8c987 100644 --- a/test_plans/flotta_test_plan_edge_devices_only.jmx +++ b/test_plans/flotta_test_plan_edge_devices_only.jmx @@ -1,5 +1,5 @@ - + The test plan will not include edge deployments creation @@ -10,7 +10,7 @@ HTTP_SERVER - localhost:8888 + localhost:8084 = @@ -28,17 +28,21 @@ LABEL_VALUE NAMESPACE DEPLOYMENTS_PER_DEVICE + TEST_DIR + SCRIPTS_DIR - - flotta-operator-controller-manager-flotta-operator-system.apps.mycluster.redhat.com - + + ${__P(HTTP_SERVER,flotta-operator-controller-manager-flotta-operator-system.apps.mycluster.redhat.com)} + ${__P(HTTP_SERVER_PORT,80)} ${__P(OCP_API_SERVER,api.mycluster.redhat.com)} - 6443 + ${__P(OCP_API_PORT,6443)} region emea default - 10 + ${__P(DEPLOYMENTS_PER_DEVICE,10)} + ${__P(TEST_DIR,test_dir_delete_me)} + ${__P(SCRIPTS_DIR,.)} false @@ -58,6 +62,30 @@ true + + true + 0 + /bin/bash + + + + + -c + = + + + + ${SCRIPTS_DIR}/create_output_streams.sh + = + + + + + + + + + @@ -70,7 +98,7 @@ MAC_ADDRESS2 - + ${__UUID()} ${__RandomString(10,abcdefg)} ${__RandomString(10,abcdefg)} @@ -83,7 +111,59 @@ The device ID to be used for the entire scenario of a specific device and additional device properties - + + true + 0 + /bin/bash + + + + + -c + = + + + + ${SCRIPTS_DIR}/register_device.sh + = + + + + + + + REQUEST_PATH + api/flotta-management/v1/data/${DEVICE_ID}/in + = + + + DEVICE_ID + ${DEVICE_ID} + = + + + HTTP_SERVER + ${HTTP_SERVER} + = + + + HTTP_SERVER_PORT + ${HTTP_SERVER_PORT} + = + + + PAYLOAD + { "content": { "hardware": { "boot": { "current_boot_mode": "bios" }, "cpu": { "architecture": "x86_64", "count": 8, "flags": [ "fpu", "vme", "de", "pse", "tsc", "msr", "pae", "mce", "cx8", "apic", "sep", "mtrr", "pge", "mca", "cmov", "pat", "pse36", "clflush", "dts", "acpi", "mmx", "fxsr", "sse", "sse2", "ss", "ht", "tm", "pbe", "syscall", "nx", "pdpe1gb", "rdtscp", "lm", "constant_tsc", "art", "arch_perfmon", "pebs", "bts", "rep_good", "nopl", "xtopology", "nonstop_tsc", "cpuid", "aperfmperf", "pni", "pclmulqdq", "dtes64", "monitor", "ds_cpl", "vmx", "smx", "est", "tm2", "ssse3", "sdbg", "fma", "cx16", "xtpr", "pdcm", "pcid", "sse4_1", "sse4_2", "x2apic", "movbe", "popcnt", "tsc_deadline_timer", "aes", "xsave", "avx", "f16c", "rdrand", "lahf_lm", "abm", "3dnowprefetch", "cpuid_fault", "epb", "invpcid_single", "pti", "ssbd", "ibrs", "ibpb", "stibp", "tpr_shadow", "vnmi", "flexpriority", "ept", "vpid", "ept_ad", "fsgsbase", "tsc_adjust", "bmi1", "hle", "avx2", "smep", "bmi2", "erms", "invpcid", "rtm", "mpx", "rdseed", "adx", "smap", "clflushopt", "intel_pt", "xsaveopt", "xsavec", "xgetbv1", "xsaves", "dtherm", "ida", "arat", "pln", "pts", "hwp", "hwp_notify", "hwp_act_window", "hwp_epp", "md_clear", "flush_l1d" ], "frequency": 3600, "model_name": "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz" }, "disks": [ { "drive_type": "SSD", "id": "/dev/dm-0", "name": "dm-0", "path": "/dev/dm-0", "size_bytes": 511032950784, "smart": "{\"json_format_version\":[1,0],\"smartctl\":{\"version\":[7,2],\"svn_revision\":\"5155\",\"platform_info\":\"x86_64-linux-5.13.14-100.fc33.x86_64\",\"build_info\":\"(local build)\",\"argv\":[\"smartctl\",\"--xall\",\"--json=c\",\"/dev/dm-0\"],\"messages\":[{\"string\":\"/dev/dm-0: Unable to detect device type\",\"severity\":\"error\"}],\"exit_status\":1}}" }, { "drive_type": "SSD", "id": "/dev/dm-1", "name": "dm-1", "path": "/dev/dm-1", "size_bytes": 117440512, "smart": "{\"json_format_version\":[1,0],\"smartctl\":{\"version\":[7,2],\"svn_revision\":\"5155\",\"platform_info\":\"x86_64-linux-5.13.14-100.fc33.x86_64\",\"build_info\":\"(local build)\",\"argv\":[\"smartctl\",\"--xall\",\"--json=c\",\"/dev/dm-1\"],\"messages\":[{\"string\":\"/dev/dm-1: Unable to detect device type\",\"severity\":\"error\"}],\"exit_status\":1}}" }, { "drive_type": "SSD", "id": "/dev/dm-10", "name": "dm-10", "path": "/dev/dm-10", "size_bytes": 6576668672, "smart": "{\"json_format_version\":[1,0],\"smartctl\":{\"version\":[7,2],\"svn_revision\":\"5155\",\"platform_info\":\"x86_64-linux-5.13.14-100.fc33.x86_64\",\"build_info\":\"(local build)\",\"argv\":[\"smartctl\",\"--xall\",\"--json=c\",\"/dev/dm-10\"],\"messages\":[{\"string\":\"/dev/dm-10: Unable to detect device type\",\"severity\":\"error\"}],\"exit_status\":1}}" }, { "drive_type": "SSD", "id": "/dev/dm-2", "name": "dm-2", "path": "/dev/dm-2", "size_bytes": 477232103424, "smart": "{\"json_format_version\":[1,0],\"smartctl\":{\"version\":[7,2],\"svn_revision\":\"5155\",\"platform_info\":\"x86_64-linux-5.13.14-100.fc33.x86_64\",\"build_info\":\"(local build)\",\"argv\":[\"smartctl\",\"--xall\",\"--json=c\",\"/dev/dm-2\"],\"messages\":[{\"string\":\"/dev/dm-2: Unable to detect device type\",\"severity\":\"error\"}],\"exit_status\":1}}" }, { "drive_type": "SSD", "id": "/dev/dm-3", "name": "dm-3", "path": "/dev/dm-3", "size_bytes": 477232103424, "smart": "{\"json_format_version\":[1,0],\"smartctl\":{\"version\":[7,2],\"svn_revision\":\"5155\",\"platform_info\":\"x86_64-linux-5.13.14-100.fc33.x86_64\",\"build_info\":\"(local build)\",\"argv\":[\"smartctl\",\"--xall\",\"--json=c\",\"/dev/dm-3\"],\"messages\":[{\"string\":\"/dev/dm-3: Unable to detect device type\",\"severity\":\"error\"}],\"exit_status\":1}}" }, { "drive_type": "SSD", "id": "/dev/dm-4", "name": "dm-4", "path": "/dev/dm-4", "size_bytes": 107374182400, "smart": "{\"json_format_version\":[1,0],\"smartctl\":{\"version\":[7,2],\"svn_revision\":\"5155\",\"platform_info\":\"x86_64-linux-5.13.14-100.fc33.x86_64\",\"build_info\":\"(local build)\",\"argv\":[\"smartctl\",\"--xall\",\"--json=c\",\"/dev/dm-4\"],\"messages\":[{\"string\":\"/dev/dm-4: Unable to detect device type\",\"severity\":\"error\"}],\"exit_status\":1}}" }, { "drive_type": "SSD", "id": "/dev/dm-5", "name": "dm-5", "path": "/dev/dm-5", "size_bytes": 16609443840, "smart": "{\"json_format_version\":[1,0],\"smartctl\":{\"version\":[7,2],\"svn_revision\":\"5155\",\"platform_info\":\"x86_64-linux-5.13.14-100.fc33.x86_64\",\"build_info\":\"(local build)\",\"argv\":[\"smartctl\",\"--xall\",\"--json=c\",\"/dev/dm-5\"],\"messages\":[{\"string\":\"/dev/dm-5: Unable to detect device type\",\"severity\":\"error\"}],\"exit_status\":1}}" }, { "drive_type": "SSD", "id": "/dev/dm-6", "name": "dm-6", "path": "/dev/dm-6", "size_bytes": 477232103424, "smart": "{\"json_format_version\":[1,0],\"smartctl\":{\"version\":[7,2],\"svn_revision\":\"5155\",\"platform_info\":\"x86_64-linux-5.13.14-100.fc33.x86_64\",\"build_info\":\"(local build)\",\"argv\":[\"smartctl\",\"--xall\",\"--json=c\",\"/dev/dm-6\"],\"messages\":[{\"string\":\"/dev/dm-6: Unable to detect device type\",\"severity\":\"error\"}],\"exit_status\":1}}" }, { "drive_type": "SSD", "id": "/dev/dm-7", "name": "dm-7", "path": "/dev/dm-7", "size_bytes": 369857921024, "smart": "{\"json_format_version\":[1,0],\"smartctl\":{\"version\":[7,2],\"svn_revision\":\"5155\",\"platform_info\":\"x86_64-linux-5.13.14-100.fc33.x86_64\",\"build_info\":\"(local build)\",\"argv\":[\"smartctl\",\"--xall\",\"--json=c\",\"/dev/dm-7\"],\"messages\":[{\"string\":\"/dev/dm-7: Unable to detect device type\",\"severity\":\"error\"}],\"exit_status\":1}}" }, { "drive_type": "SSD", "id": "/dev/dm-8", "name": "dm-8", "path": "/dev/dm-8", "size_bytes": 511705088, "smart": "{\"json_format_version\":[1,0],\"smartctl\":{\"version\":[7,2],\"svn_revision\":\"5155\",\"platform_info\":\"x86_64-linux-5.13.14-100.fc33.x86_64\",\"build_info\":\"(local build)\",\"argv\":[\"smartctl\",\"--xall\",\"--json=c\",\"/dev/dm-8\"],\"messages\":[{\"string\":\"/dev/dm-8: Unable to detect device type\",\"severity\":\"error\"}],\"exit_status\":1}}" }, { "drive_type": "SSD", "id": "/dev/dm-9", "name": "dm-9", "path": "/dev/dm-9", "size_bytes": 6576668672, "smart": "{\"json_format_version\":[1,0],\"smartctl\":{\"version\":[7,2],\"svn_revision\":\"5155\",\"platform_info\":\"x86_64-linux-5.13.14-100.fc33.x86_64\",\"build_info\":\"(local build)\",\"argv\":[\"smartctl\",\"--xall\",\"--json=c\",\"/dev/dm-9\"],\"messages\":[{\"string\":\"/dev/dm-9: Unable to detect device type\",\"severity\":\"error\"}],\"exit_status\":1}}" }, { "bootable": true, "by_id": "/dev/disk/by-id/nvme-eui.002538c571b05d4b", "by_path": "/dev/disk/by-path/pci-0000:3e:00.0-nvme-1", "drive_type": "SSD", "id": "/dev/disk/by-id/nvme-eui.002538c571b05d4b", "model": "SAMSUNG MZVKW512HMJP-000L7", "name": "nvme0n1", "path": "/dev/nvme0n1", "serial": "S35BNX0J505918", "size_bytes": 512110190592, "smart": "{\"json_format_version\":[1,0],\"smartctl\":{\"version\":[7,2],\"svn_revision\":\"5155\",\"platform_info\":\"x86_64-linux-5.13.14-100.fc33.x86_64\",\"build_info\":\"(local build)\",\"argv\":[\"smartctl\",\"--xall\",\"--json=c\",\"/dev/nvme0n1\"],\"exit_status\":0},\"device\":{\"name\":\"/dev/nvme0n1\",\"info_name\":\"/dev/nvme0n1\",\"type\":\"nvme\",\"protocol\":\"NVMe\"},\"model_name\":\"SAMSUNG MZVKW512HMJP-000L7\",\"serial_number\":\"S35BNX0J505918\",\"firmware_version\":\"7L6QCXA7\",\"nvme_pci_vendor\":{\"id\":5197,\"subsystem_id\":5197},\"nvme_ieee_oui_identifier\":9528,\"nvme_total_capacity\":512110190592,\"nvme_unallocated_capacity\":0,\"nvme_controller_id\":2,\"nvme_version\":{\"string\":\"1.2\",\"value\":66048},\"nvme_number_of_namespaces\":1,\"nvme_namespaces\":[{\"id\":1,\"size\":{\"blocks\":1000215216,\"bytes\":512110190592},\"capacity\":{\"blocks\":1000215216,\"bytes\":512110190592},\"utilization\":{\"blocks\":1000215216,\"bytes\":512110190592},\"formatted_lba_size\":512,\"eui64\":{\"oui\":9528,\"ext_id\":848015940939}}],\"user_capacity\":{\"blocks\":1000215216,\"bytes\":512110190592},\"logical_block_size\":512,\"local_time\":{\"time_t\":1637498725,\"asctime\":\"Sun Nov 21 14:45:25 2021 IST\"},\"smart_status\":{\"passed\":true,\"nvme\":{\"value\":0}},\"nvme_smart_health_information_log\":{\"critical_warning\":0,\"temperature\":27,\"available_spare\":100,\"available_spare_threshold\":10,\"percentage_used\":15,\"data_units_read\":17934599,\"data_units_written\":97148210,\"host_reads\":463356329,\"host_writes\":2453263768,\"controller_busy_time\":15671,\"power_cycles\":1517,\"power_on_hours\":11110,\"unsafe_shutdowns\":261,\"media_errors\":0,\"num_err_log_entries\":495,\"warning_temp_time\":0,\"critical_comp_time\":0,\"temperature_sensors\":[27,40]},\"temperature\":{\"current\":27},\"power_cycle_count\":1517,\"power_on_time\":{\"hours\":11110}}", "wwn": "eui.002538c571b05d4b" }, { "drive_type": "SSD", "id": "/dev/zram0", "name": "zram0", "path": "/dev/zram0", "size_bytes": 4294967296, "smart": "{\"json_format_version\":[1,0],\"smartctl\":{\"version\":[7,2],\"svn_revision\":\"5155\",\"platform_info\":\"x86_64-linux-5.13.14-100.fc33.x86_64\",\"build_info\":\"(local build)\",\"argv\":[\"smartctl\",\"--xall\",\"--json=c\",\"/dev/zram0\"],\"messages\":[{\"string\":\"/dev/zram0: Unable to detect device type\",\"severity\":\"error\"}],\"exit_status\":1}}" } ], "gpus": [ { "address": "0000:01:00.0", "device_id": "13b1", "name": "GM107GLM [Quadro M1000M]", "vendor": "NVIDIA Corporation", "vendor_id": "10de" } ], "hostname": "${HOSTNAME}", "interfaces": [ { "biosdevname": "em1", "flags": [ "up", "broadcast", "multicast" ], "has_carrier": true, "ipv4_addresses": [ "10.100.102.22/24" ], "ipv6_addresses": [], "mac_address": "${MAC_ADDRESS2}", "mtu": 1500, "name": "enp0s31f6", "product": "0x15b7", "speed_mbps": 1000, "vendor": "0x8086" }, { "biosdevname": "p2p1", "flags": [ "broadcast", "multicast" ], "ipv4_addresses": [], "ipv6_addresses": [], "mac_address": "${MAC_ADDRESS2}", "mtu": 1500, "name": "wlp4s0", "product": "0x24f3", "vendor": "0x8086" } ], "memory": { "physical_bytes": 34359738368, "usable_bytes": 33084645376 }, "system_vendor": { "manufacturer": "LENOVO", "product_name": "${PRODUCT_NAME}", "serial_number": "${SERIAL_NAME}" } }, "os_image_id": "unknown" }, "directive": "registration", "message_id": "${__UUID()}", "sent": "2021-11-21T14:45:25.271+02:00", "type": "data", "version": 1 } + = + + + + + ${TEST_DIR}/${DEVICE_ID}_register.out + ${TEST_DIR}/${DEVICE_ID}_register.err + + + true @@ -507,7 +587,54 @@ 4 - + + true + 0 + /bin/bash + + + + + -c + = + + + + ${SCRIPTS_DIR}/get_device_update.sh + = + + + + + + + REQUEST_PATH + api/flotta-management/v1/data/${DEVICE_ID}/in + = + + + DEVICE_ID + ${DEVICE_ID} + = + + + HTTP_SERVER + ${HTTP_SERVER} + = + + + HTTP_SERVER_PORT + ${HTTP_SERVER_PORT} + = + + + + + ${TEST_DIR}/${DEVICE_ID}_get_updates.out + ${TEST_DIR}/${DEVICE_ID}_get_updates.err + + + @@ -532,7 +659,59 @@ - + + true + 0 + /bin/bash + + + + + -c + = + + + + ${SCRIPTS_DIR}/request_operator.sh + = + + + + + + + REQUEST_PATH + api/flotta-management/v1/data/${DEVICE_ID}/out + = + + + POST_BODY + { "content": { "events": [], "status": "up", "time": "2021-11-23T02:16:37.697+02:00", "version": "278650", "workloads": [] }, "directive": "heartbeat", "message_id": "${__UUID()}", "type": "data", "version": 1 } + = + + + DEVICE_ID + ${DEVICE_ID} + = + + + HTTP_SERVER + ${HTTP_SERVER} + = + + + HTTP_SERVER_PORT + ${HTTP_SERVER_PORT} + = + + + + + ${TEST_DIR}/${DEVICE_ID}_hearthbeat.out + ${TEST_DIR}/${DEVICE_ID}_hearthbeat.err + + + true diff --git a/test_plans/flotta_test_plan_multiple_namespaces.jmx b/test_plans/flotta_test_plan_multiple_namespaces.jmx index 2e8d8a0..6b632d2 100644 --- a/test_plans/flotta_test_plan_multiple_namespaces.jmx +++ b/test_plans/flotta_test_plan_multiple_namespaces.jmx @@ -1,5 +1,5 @@ - + @@ -23,10 +23,11 @@ DEFAULT_NAMESPACE DEPLOYMENTS_PER_DEVICE NAMESPACES_COUNT - + TEST_DIR + SCRIPTS_DIR - + ${__P(HTTP_SERVER,flotta-operator-controller-manager-flotta-operator-system.apps.mycluster.redhat.com)} ${__P(HTTP_SERVER_PORT,80)} ${__P(OCP_API_SERVER,api.mycluster.redhat.com)} @@ -36,7 +37,8 @@ default ${__P(DEPLOYMENTS_PER_DEVICE,5)} ${__P(NAMESPACES_COUNT,5)} - + ${__P(TEST_DIR,test_dir_delete_me)} + ${__P(SCRIPTS_DIR,.)} false @@ -90,7 +92,7 @@ HttpClient4 - Create Edge Deployment with labels matching for device + Create Edge Workload with labels matching for device @@ -133,6 +135,30 @@ true + + true + 0 + /bin/bash + + + + + -c + = + + + + ${SCRIPTS_DIR}/create_output_streams.sh + = + + + + + + + + + @@ -182,7 +208,64 @@ vars.put("NAMESPACE", ns); The device ID to be used for the entire scenario of a specific device and additional device properties - + + true + 0 + /bin/bash + + + + + -c + = + + + + ${SCRIPTS_DIR}/register_device.sh + = + + + + + + + DEVICE_ID + ${DEVICE_ID} + = + + + HTTP_SERVER + ${HTTP_SERVER} + = + + + HTTP_SERVER_PORT + ${HTTP_SERVER_PORT} + = + + + PRODUCT_NAME + ${PRODUCT_NAME} + = + + + SERIAL_NAME + ${SERIAL_NAME} + = + + + PAYLOAD + { "content": { "hardware": { "cpu": { "architecture": "x86_64", "flags": [], "model_name": "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz" }, "hostname": "${HOSTNAME}", "system_vendor": { "manufacturer": "LENOVO", "product_name": "${PRODUCT_NAME}", "serial_number": "${SERIAL_NAME}" } }, "os_image_id": "unknown" }, "directive": "registration", "message_id": "${__UUID()}", "sent": "2021-11-21T14:45:25.271+02:00", "type": "data", "version": 1 } + = + + + + + ${TEST_DIR}/${DEVICE_ID}_register.out + ${TEST_DIR}/${DEVICE_ID}_register.err + + + true @@ -327,9 +410,9 @@ vars.put("NAMESPACE", ns); - + - + true ${DEPLOYMENTS_PER_DEVICE} @@ -344,7 +427,7 @@ vars.put("NAMESPACE", ns); true - + true @@ -352,7 +435,7 @@ vars.put("NAMESPACE", ns); false { "apiVersion": "management.project-flotta.io/v1alpha1", - "kind": "EdgeDeployment", + "kind": "EdgeWorkload", "metadata": { "name": "${DEVICE_ID}-${NameSuffix}", "namespace": "${NAMESPACE}" @@ -399,7 +482,7 @@ vars.put("NAMESPACE", ns); ${OCP_API_PORT} https UTF-8 - /apis/management.project-flotta.io/v1alpha1/namespaces/${NAMESPACE}/edgedeployments + /apis/management.project-flotta.io/v1alpha1/namespaces/${NAMESPACE}/edgeworkloads POST true false @@ -409,7 +492,7 @@ vars.put("NAMESPACE", ns); HttpClient4 - Create Edge Deployment with labels matching for device + Create Edge Workload with labels matching for device @@ -437,8 +520,8 @@ vars.put("NAMESPACE", ns); - - Add delays between edgedeployments creation of the same device + + Add delays between edgeworkloads creation of the same device 1000 @@ -454,7 +537,54 @@ vars.put("NAMESPACE", ns); 4 - + + true + 0 + /bin/bash + + + + + -c + = + + + + ${SCRIPTS_DIR}/get_device_update.sh + = + + + + + + + REQUEST_PATH + api/flotta-management/v1/data/${DEVICE_ID}/in + = + + + DEVICE_ID + ${DEVICE_ID} + = + + + HTTP_SERVER + ${HTTP_SERVER} + = + + + HTTP_SERVER_PORT + ${HTTP_SERVER_PORT} + = + + + + + ${TEST_DIR}/${DEVICE_ID}_get_updates.out + ${TEST_DIR}/${DEVICE_ID}_get_updates.err + + + @@ -480,7 +610,59 @@ vars.put("NAMESPACE", ns); - + + true + 0 + /bin/bash + + + + + -c + = + + + + ${SCRIPTS_DIR}/request_operator.sh + = + + + + + + + REQUEST_PATH + api/flotta-management/v1/data/${DEVICE_ID}/out + = + + + POST_BODY + { "content": { "events": [ { "message": "error starting container f8433cc4b0c963ce95625ab3b1811382f852432f61a2d087422210e9d34bc2bc: cannot listen on the TCP port: listen tcp4 :11000: bind: address already in use,error starting container 7cd64802bde9d6b9dd425d79ea68eb49546e5fc87d0dce474c7515e81f448d50: a dependency of container 7cd64802bde9d6b9dd425d79ea68eb49546e5fc87d0dce474c7515e81f448d50 failed to start: container state improper", "reason": "Failed", "type": "warn" }, { "message": "error starting container f8433cc4b0c963ce95625ab3b1811382f852432f61a2d087422210e9d34bc2bc: cannot listen on the TCP port: listen tcp4 :11000: bind: address already in use,error starting container 7cd64802bde9d6b9dd425d79ea68eb49546e5fc87d0dce474c7515e81f448d50: a dependency of container 7cd64802bde9d6b9dd425d79ea68eb49546e5fc87d0dce474c7515e81f448d50 failed to start: container state improper", "reason": "Failed", "type": "warn" }, { "message": "error starting container f8433cc4b0c963ce95625ab3b1811382f852432f61a2d087422210e9d34bc2bc: cannot listen on the TCP port: listen tcp4 :11000: bind: address already in use,error starting container 7cd64802bde9d6b9dd425d79ea68eb49546e5fc87d0dce474c7515e81f448d50: a dependency of container 7cd64802bde9d6b9dd425d79ea68eb49546e5fc87d0dce474c7515e81f448d50 failed to start: container state improper", "reason": "Failed", "type": "warn" }, { "message": "error starting container f8433cc4b0c963ce95625ab3b1811382f852432f61a2d087422210e9d34bc2bc: cannot listen on the TCP port: listen tcp4 :11000: bind: address already in use,error starting container 7cd64802bde9d6b9dd425d79ea68eb49546e5fc87d0dce474c7515e81f448d50: a dependency of container 7cd64802bde9d6b9dd425d79ea68eb49546e5fc87d0dce474c7515e81f448d50 failed to start: container state improper", "reason": "Failed", "type": "warn" } ], "status": "up", "time": "${__time(yyyy-MM-dd'T'HH:mm:ss.SSS'Z')}", "version": "278650", "workloads": [ { "last_data_upload": "0001-01-01T00:00:00.000Z", "name": "${DEVICE_ID}-1", "status": "Running" }, { "last_data_upload": "0001-01-01T00:00:00.000Z", "name": "${DEVICE_ID}-2", "status": "Created" }, { "last_data_upload": "0001-01-01T00:00:00.000Z", "name": "${DEVICE_ID}-3", "status": "Running" }, { "last_data_upload": "0001-01-01T00:00:00.000Z", "name": "${DEVICE_ID}-4", "status": "Created" }, { "last_data_upload": "0001-01-01T00:00:00.000Z", "name": "${DEVICE_ID}-5", "status": "Running" }, { "last_data_upload": "0001-01-01T00:00:00.000Z", "name": "${DEVICE_ID}-6", "status": "Created" }, { "last_data_upload": "0001-01-01T00:00:00.000Z", "name": "${DEVICE_ID}-7", "status": "Running" }, { "last_data_upload": "0001-01-01T00:00:00.000Z", "name": "${DEVICE_ID}-8", "status": "Created" }, { "last_data_upload": "0001-01-01T00:00:00.000Z", "name": "${DEVICE_ID}-9", "status": "Running" } ] }, "directive": "heartbeat", "message_id": "${__UUID()}", "type": "data", "version": 1 } + = + + + DEVICE_ID + ${DEVICE_ID} + = + + + HTTP_SERVER + ${HTTP_SERVER} + = + + + HTTP_SERVER_PORT + ${HTTP_SERVER_PORT} + = + + + + + ${TEST_DIR}/${DEVICE_ID}_hearthbeat.out + ${TEST_DIR}/${DEVICE_ID}_hearthbeat.err + + + true From 601e0db53ed2bdeb57e6c91b134a21f0ef77001e Mon Sep 17 00:00:00 2001 From: gabriel-farache Date: Mon, 25 Apr 2022 08:50:45 +0200 Subject: [PATCH 02/11] FIX after review --- .gitignore | 1 + .../edgedevice-registration-simple.json.in | 0 scripts/create_output_streams.sh | 16 +- scripts/generate_certs.sh | 11 +- scripts/get_device_update.sh | 12 +- scripts/jmeter.log | 149 ------------------ scripts/register_device.sh | 41 ++--- scripts/request_operator.sh | 12 +- scripts/run_test_plan.sh | 54 +++---- scripts/service.yaml | 16 -- test_plans/flotta_test_plan.jmx | 67 ++++++-- .../flotta_test_plan_edge_devices_only.jmx | 67 ++++++-- .../flotta_test_plan_multiple_namespaces.jmx | 63 +++++++- 13 files changed, 243 insertions(+), 266 deletions(-) rename payload.json => samples/edgedevice-registration-simple.json.in (100%) delete mode 100644 scripts/jmeter.log delete mode 100644 scripts/service.yaml diff --git a/.gitignore b/.gitignore index 66fd13c..cba6286 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ # Dependency directories (remove the comment below to include it) # vendor/ +*.log \ No newline at end of file diff --git a/payload.json b/samples/edgedevice-registration-simple.json.in similarity index 100% rename from payload.json rename to samples/edgedevice-registration-simple.json.in diff --git a/scripts/create_output_streams.sh b/scripts/create_output_streams.sh index 4af8d62..4d33b8c 100755 --- a/scripts/create_output_streams.sh +++ b/scripts/create_output_streams.sh @@ -1,7 +1,11 @@ #!/bin/bash -touch ${TEST_DIR}/${DEVICE_ID}_register.out -touch ${TEST_DIR}/${DEVICE_ID}_register.err -touch ${TEST_DIR}/${DEVICE_ID}_get_updates.err -touch ${TEST_DIR}/${DEVICE_ID}_get_updates.out -touch ${TEST_DIR}/${DEVICE_ID}_hearthbeat.out -touch ${TEST_DIR}/${DEVICE_ID}_hearthbeat.err \ No newline at end of file +mkdir -p ${REGISTRATION_FOLDER} +mkdir -p ${GET_UPDATES_FOLDER} +mkdir -p ${HEARTBEAT_FOLDER} + +touch ${REGISTRATION_FOLDER}/${DEVICE_ID}_register.out +touch ${REGISTRATION_FOLDER}/${DEVICE_ID}_register.err +touch ${GET_UPDATES_FOLDER}/${DEVICE_ID}_get_updates.err +touch ${GET_UPDATES_FOLDER}/${DEVICE_ID}_get_updates.out +touch ${HEARTBEAT_FOLDER}/${DEVICE_ID}_heartbeat.out +touch ${HEARTBEAT_FOLDER}/${DEVICE_ID}_heartbeat.err \ No newline at end of file diff --git a/scripts/generate_certs.sh b/scripts/generate_certs.sh index ea026aa..3ad62a7 100755 --- a/scripts/generate_certs.sh +++ b/scripts/generate_certs.sh @@ -1,8 +1,13 @@ #!/bin/bash +if [[ -z "${CERTS_FOLDER}" ]]; then + export CERTS_FOLDER="${test_dir}/certs" + echo "CERTS_FOLDER no defined, setting it to ${CERTS_FOLDER}" +fi +mkdir -p $CERTS_FOLDER # make get-certs -kubectl -n flotta get secrets flotta-ca --template="{{index .data \"ca.crt\" | base64decode}}" >${test_dir}/${DEVICE_ID}_ca.pem +kubectl -n flotta get secrets flotta-ca --template="{{index .data \"ca.crt\" | base64decode}}" > ${CERTS_FOLDER}/${DEVICE_ID}_ca.pem export REG_SECRET_NAME=$(kubectl get secrets -n flotta -l reg-client-ca=true --sort-by=.metadata.creationTimestamp | tail -1 | awk '{print $1}') -kubectl -n flotta get secret ${REG_SECRET_NAME} --template="{{index .data \"client.crt\" | base64decode}}" > ${test_dir}/${DEVICE_ID}_cert.pem -kubectl -n flotta get secret ${REG_SECRET_NAME} --template="{{index .data \"client.key\" | base64decode}}" > ${test_dir}/${DEVICE_ID}_key.pem +kubectl -n flotta get secret ${REG_SECRET_NAME} --template="{{index .data \"client.crt\" | base64decode}}" > ${CERTS_FOLDER}/${DEVICE_ID}_cert.pem +kubectl -n flotta get secret ${REG_SECRET_NAME} --template="{{index .data \"client.key\" | base64decode}}" > ${CERTS_FOLDER}/${DEVICE_ID}_key.pem # make get-certs END diff --git a/scripts/get_device_update.sh b/scripts/get_device_update.sh index ddb012c..3a1bb01 100755 --- a/scripts/get_device_update.sh +++ b/scripts/get_device_update.sh @@ -1,17 +1,17 @@ #!/bin/bash echo "curl -XGET \\ - --cacert ${test_dir}/default_ca.pem \\ - --cert ${test_dir}/${DEVICE_ID}.pem \\ - --key ${test_dir}/${DEVICE_ID}.key -v \\ + --cacert ${CERTS_FOLDER}/default_ca.pem \\ + --cert ${CERTS_FOLDER}/${DEVICE_ID}.pem \\ + --key ${CERTS_FOLDER}/${DEVICE_ID}.key -v \\ -H \"Content-Type: application/json\" \\ -H \"Cache-Control: no-cache\" \\ https://${HTTP_SERVER}:${HTTP_SERVER_PORT}/${REQUEST_PATH}" curl -XGET \ - --cacert ${test_dir}/default_ca.pem \ - --cert ${test_dir}/${DEVICE_ID}.pem \ - --key ${test_dir}/${DEVICE_ID}.key -v \ + --cacert ${CERTS_FOLDER}/default_ca.pem \ + --cert ${CERTS_FOLDER}/${DEVICE_ID}.pem \ + --key ${CERTS_FOLDER}/${DEVICE_ID}.key -v \ -H "Content-Type: application/json" \ -H "Cache-Control: no-cache" \ https://${HTTP_SERVER}:${HTTP_SERVER_PORT}/${REQUEST_PATH} diff --git a/scripts/jmeter.log b/scripts/jmeter.log deleted file mode 100644 index 2258c08..0000000 --- a/scripts/jmeter.log +++ /dev/null @@ -1,149 +0,0 @@ -2022-04-22 16:38:13,913 INFO o.a.j.u.JMeterUtils: Setting Locale to en_GB -2022-04-22 16:38:13,925 INFO o.a.j.JMeter: Loading user properties from: /home/test/apache-jmeter-5.4.1/bin/user.properties -2022-04-22 16:38:13,925 INFO o.a.j.JMeter: Loading system properties from: /home/test/apache-jmeter-5.4.1/bin/system.properties -2022-04-22 16:38:13,925 INFO o.a.j.JMeter: Setting JMeter property: EDGE_DEVICES_COUNT=1 -2022-04-22 16:38:13,925 INFO o.a.j.JMeter: Setting JMeter property: EDGE_DEPLOYMENTS_PER_DEVICE=5 -2022-04-22 16:38:13,925 INFO o.a.j.JMeter: Setting JMeter property: RAMP_UP_TIME=2 -2022-04-22 16:38:13,925 INFO o.a.j.JMeter: Setting JMeter property: ITERATIONS=1 -2022-04-22 16:38:13,925 INFO o.a.j.JMeter: Setting JMeter property: OCP_API_SERVER=api.mycluster.redhat.com -2022-04-22 16:38:13,925 INFO o.a.j.JMeter: Setting JMeter property: K8S_BEARER_TOKEN=eyJhbGciOiJSUzI1NiIsImtpZCI6IlhscnBTQjdRcXo0UjhWN01IZ05zdVh2WnFFajh5UTAzTk5uTjNDdnR3N0kifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJkZWZhdWx0Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZWNyZXQubmFtZSI6ImZsb3R0YS1zY2FsZS10b2tlbi1ybmR6diIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50Lm5hbWUiOiJmbG90dGEtc2NhbGUiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC51aWQiOiJiMWRhNzRmZi1jNzYzLTRkMDktODVlNS1hMjNhYmEwNjU2MWQiLCJzdWIiOiJzeXN0ZW06c2VydmljZWFjY291bnQ6ZGVmYXVsdDpmbG90dGEtc2NhbGUifQ.oR3nTYDlV0b-kghIJK3wKLei6KpGLYq1bPZei6jQDI8j76wiTbxso8O75xhele30Ss8sbRimMV3qj9QJhIcupVlBlWit7U8ENVr_7RHrh9O6F4KwNJTiW9TetOSOt7puS7hx7eDTRLIzyMbf6pfNXUUiBhIvALxnHyn2mkXoApYxkVvM7s0nWeVECx4JXJHnSh9vUje3imphOcz1hkm1H1r6vdZpjefBJPBC7ip0Ypoheud2ijKJf81cZI40FnPzny0Vl1hnPdHMtt4_sHWD_zGJIjuRbwo5h-rB7iXfAXxTf1ZpDvgbMn0p-D1AbybsIcyoHKxXZki9uG5hfOSoz1QZmvVYOEXSaHQ8tV60DJtKZfeXfyItkqvSuzl6t-ulxTJp2S5it9r_v-NIWO5CUyjsQDkYMcsA2hZqv_TGcR70bz_BjQa91dawb1b1Tj9eavmMreDqAStCQSjSB0pea5ju2D999gvYxxddUpyqOzsBfw5qMPg84JwQVrKKl5KmboQtlRqdmwyT7VJupge6HR_DhYoa7yg9hGbPdz4ZUSTje2DrqRGSfbtalYDk3vESIiHjlg2Uri9bm4K5in0Z5Dr5S95ik2SDoJmub5fATWTETMqGmzGfi0FPqkLtoMU34kCWLAi-4aHzZO8XCLlObWB0e0falK3n_o7c_I7itg4 -2022-04-22 16:38:13,926 INFO o.a.j.JMeter: Setting JMeter property: HTTP_SERVER=project-flotta.io -2022-04-22 16:38:13,926 INFO o.a.j.JMeter: Setting JMeter property: HTTP_SERVER_PORT=30043 -2022-04-22 16:38:13,926 INFO o.a.j.JMeter: Setting JMeter property: TEST_DIR=/root/gabriel-folder/flotta-scale-tests/scripts/test-run-delete_me -2022-04-22 16:38:13,926 INFO o.a.j.JMeter: Setting JMeter property: SCRIPTS_DIR=/root/gabriel-folder/flotta-scale-tests/scripts -2022-04-22 16:38:13,926 INFO o.a.j.JMeter: Setting JMeter property: NAMESPACES_COUNT=10 -2022-04-22 16:38:13,932 INFO o.a.j.JMeter: Copyright (c) 1998-2021 The Apache Software Foundation -2022-04-22 16:38:13,932 INFO o.a.j.JMeter: Version 5.4.1 -2022-04-22 16:38:13,932 INFO o.a.j.JMeter: java.version=1.8.0_302 -2022-04-22 16:38:13,932 INFO o.a.j.JMeter: java.vm.name=OpenJDK 64-Bit Server VM -2022-04-22 16:38:13,932 INFO o.a.j.JMeter: os.name=Linux -2022-04-22 16:38:13,932 INFO o.a.j.JMeter: os.arch=amd64 -2022-04-22 16:38:13,932 INFO o.a.j.JMeter: os.version=4.18.0-339.el8.x86_64 -2022-04-22 16:38:13,932 INFO o.a.j.JMeter: file.encoding=UTF-8 -2022-04-22 16:38:13,932 INFO o.a.j.JMeter: java.awt.headless=true -2022-04-22 16:38:13,933 INFO o.a.j.JMeter: Max memory =61084270592 -2022-04-22 16:38:13,933 INFO o.a.j.JMeter: Available Processors =40 -2022-04-22 16:38:13,936 INFO o.a.j.JMeter: Default Locale=English (United Kingdom) -2022-04-22 16:38:13,937 INFO o.a.j.JMeter: JMeter Locale=English (United Kingdom) -2022-04-22 16:38:13,937 INFO o.a.j.JMeter: JMeterHome=/home/test/apache-jmeter-5.4.1 -2022-04-22 16:38:13,937 INFO o.a.j.JMeter: user.dir =/root/gabriel-folder/flotta-scale-tests/scripts -2022-04-22 16:38:13,937 INFO o.a.j.JMeter: PWD =/root/gabriel-folder/flotta-scale-tests/scripts -2022-04-22 16:38:13,938 INFO o.a.j.JMeter: IP: 10.46.41.62 Name: helios05.lab.eng.tlv2.redhat.com FullName: helios05.lab.eng.tlv2.redhat.com -2022-04-22 16:38:13,941 INFO o.a.j.JMeter: Setting property 'jmeter.reportgenerator.outputdir' to:'/root/gabriel-folder/flotta-scale-tests/scripts/test-run-delete_me/results' -2022-04-22 16:38:13,943 INFO o.a.j.s.FileServer: Default base='/root/gabriel-folder/flotta-scale-tests/scripts' -2022-04-22 16:38:13,944 INFO o.a.j.s.FileServer: Set new base='/root/gabriel-folder/flotta-scale-tests/scripts/../test_plans' -2022-04-22 16:38:14,041 INFO o.a.j.s.SaveService: Testplan (JMX) version: 2.2. Testlog (JTL) version: 2.2 -2022-04-22 16:38:14,057 INFO o.a.j.s.SaveService: Using SaveService properties file encoding UTF-8 -2022-04-22 16:38:14,061 INFO o.a.j.s.SaveService: Using SaveService properties version 5.0 -2022-04-22 16:38:14,066 INFO o.a.j.s.SaveService: Loading file: ../test_plans/flotta_test_plan_edge_devices_only.jmx -2022-04-22 16:38:14,114 INFO o.a.j.p.h.s.HTTPSamplerBase: Parser for text/html is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser -2022-04-22 16:38:14,114 INFO o.a.j.p.h.s.HTTPSamplerBase: Parser for application/xhtml+xml is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser -2022-04-22 16:38:14,114 INFO o.a.j.p.h.s.HTTPSamplerBase: Parser for application/xml is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser -2022-04-22 16:38:14,114 INFO o.a.j.p.h.s.HTTPSamplerBase: Parser for text/xml is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser -2022-04-22 16:38:14,114 INFO o.a.j.p.h.s.HTTPSamplerBase: Parser for text/vnd.wap.wml is org.apache.jmeter.protocol.http.parser.RegexpHTMLParser -2022-04-22 16:38:14,114 INFO o.a.j.p.h.s.HTTPSamplerBase: Parser for text/css is org.apache.jmeter.protocol.http.parser.CssParser -2022-04-22 16:38:14,146 INFO o.a.j.JMeter: Creating summariser -2022-04-22 16:38:14,150 INFO o.a.j.r.d.ReportGenerator: ReportGenerator will use for Parsing the separator: ',' -2022-04-22 16:38:14,150 INFO o.a.j.r.d.ReportGenerator: Will generate report at end of test from results file: /root/gabriel-folder/flotta-scale-tests/scripts/test-run-delete_me/results.csv -2022-04-22 16:38:14,150 INFO o.a.j.r.d.ReportGenerator: Reading report generator properties from: /home/test/apache-jmeter-5.4.1/bin/reportgenerator.properties -2022-04-22 16:38:14,150 INFO o.a.j.r.d.ReportGenerator: Merging with JMeter properties -2022-04-22 16:38:14,154 INFO o.a.j.r.c.ReportGeneratorConfiguration: Property 'jmeter.reportgenerator.temp_dir' not found, using default value 'temp' instead. -2022-04-22 16:38:14,157 INFO o.a.j.r.c.ReportGeneratorConfiguration: Property 'jmeter.reportgenerator.apdex_per_transaction' not found, using default value 'null' instead. -2022-04-22 16:38:14,158 INFO o.a.j.r.c.ReportGeneratorConfiguration: apdex_per_transaction is empty, not APDEX per transaction customization -2022-04-22 16:38:14,158 INFO o.a.j.r.c.ReportGeneratorConfiguration: Property 'jmeter.reportgenerator.sample_filter' not found, using default value 'null' instead. -2022-04-22 16:38:14,158 INFO o.a.j.r.c.ReportGeneratorConfiguration: Property 'jmeter.reportgenerator.report_title' not found, using default value 'null' instead. -2022-04-22 16:38:14,158 INFO o.a.j.r.c.ReportGeneratorConfiguration: Property 'jmeter.reportgenerator.start_date' not found, using default value 'null' instead. -2022-04-22 16:38:14,158 INFO o.a.j.r.c.ReportGeneratorConfiguration: Property 'jmeter.reportgenerator.end_date' not found, using default value 'null' instead. -2022-04-22 16:38:14,158 INFO o.a.j.r.c.ReportGeneratorConfiguration: Property 'jmeter.reportgenerator.date_format' not found, using default value 'null' instead. -2022-04-22 16:38:14,158 INFO o.a.j.r.c.ReportGeneratorConfiguration: Will use date range start date: null, end date: null -2022-04-22 16:38:14,162 INFO o.a.j.r.c.ReportGeneratorConfiguration: Property 'jmeter.reportgenerator.graph.totalTPS.exclude_controllers' not found, using default value 'false' instead. -2022-04-22 16:38:14,162 INFO o.a.j.r.c.ReportGeneratorConfiguration: Property 'jmeter.reportgenerator.graph.activeThreadsOverTime.exclude_controllers' not found, using default value 'false' instead. -2022-04-22 16:38:14,162 INFO o.a.j.r.c.ReportGeneratorConfiguration: Property 'jmeter.reportgenerator.graph.timeVsThreads.exclude_controllers' not found, using default value 'false' instead. -2022-04-22 16:38:14,162 INFO o.a.j.r.c.ReportGeneratorConfiguration: Property 'jmeter.reportgenerator.graph.responseTimeDistribution.exclude_controllers' not found, using default value 'false' instead. -2022-04-22 16:38:14,162 INFO o.a.j.r.c.ReportGeneratorConfiguration: Property 'jmeter.reportgenerator.graph.transactionsPerSecond.exclude_controllers' not found, using default value 'false' instead. -2022-04-22 16:38:14,163 INFO o.a.j.r.c.ReportGeneratorConfiguration: Property 'jmeter.reportgenerator.graph.responseTimePercentiles.exclude_controllers' not found, using default value 'false' instead. -2022-04-22 16:38:14,163 INFO o.a.j.r.c.ReportGeneratorConfiguration: Property 'jmeter.reportgenerator.graph.responseTimePercentilesOverTime.exclude_controllers' not found, using default value 'false' instead. -2022-04-22 16:38:14,163 INFO o.a.j.r.c.ReportGeneratorConfiguration: Property 'jmeter.reportgenerator.graph.responseTimesOverTime.exclude_controllers' not found, using default value 'false' instead. -2022-04-22 16:38:14,164 INFO o.a.j.r.c.ReportGeneratorConfiguration: Property 'jmeter.reportgenerator.graph.connectTimeOverTime.exclude_controllers' not found, using default value 'false' instead. -2022-04-22 16:38:14,164 INFO o.a.j.r.c.ReportGeneratorConfiguration: Property 'jmeter.reportgenerator.graph.latenciesOverTime.exclude_controllers' not found, using default value 'false' instead. -2022-04-22 16:38:14,164 INFO o.a.j.r.c.ReportGeneratorConfiguration: Property 'jmeter.reportgenerator.exporter.json.filters_only_sample_series' not found, using default value 'true' instead. -2022-04-22 16:38:14,164 INFO o.a.j.r.c.ReportGeneratorConfiguration: Property 'jmeter.reportgenerator.exporter.json.series_filter' not found, using default value '' instead. -2022-04-22 16:38:14,165 INFO o.a.j.r.c.ReportGeneratorConfiguration: Property 'jmeter.reportgenerator.exporter.json.show_controllers_only' not found, using default value 'false' instead. -2022-04-22 16:38:14,165 INFO o.a.j.r.c.ReportGeneratorConfiguration: Property 'jmeter.reportgenerator.exporter.html.filters_only_sample_series' not found, using default value 'true' instead. -2022-04-22 16:38:14,165 INFO o.a.j.r.c.ReportGeneratorConfiguration: Property 'jmeter.reportgenerator.exporter.html.series_filter' not found, using default value '' instead. -2022-04-22 16:38:14,165 INFO o.a.j.r.c.ReportGeneratorConfiguration: Property 'jmeter.reportgenerator.exporter.html.show_controllers_only' not found, using default value 'false' instead. -2022-04-22 16:38:14,169 INFO o.a.j.e.StandardJMeterEngine: Running the test! -2022-04-22 16:38:14,184 INFO o.a.j.s.SampleEvent: List of sample_variables: [] -2022-04-22 16:38:14,184 INFO o.a.j.s.SampleEvent: List of sample_variables: [] -2022-04-22 16:38:14,189 INFO o.a.j.e.u.CompoundVariable: Note: Function class names must contain the string: '.functions.' -2022-04-22 16:38:14,189 INFO o.a.j.e.u.CompoundVariable: Note: Function class names must not contain the string: '.gui.' -2022-04-22 16:38:14,474 INFO o.a.j.JMeter: Running test (1650634694474) -2022-04-22 16:38:14,541 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : Edge Devices -2022-04-22 16:38:14,541 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group Edge Devices. -2022-04-22 16:38:14,541 INFO o.a.j.e.StandardJMeterEngine: Thread will start next loop on error -2022-04-22 16:38:14,542 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=2 delayedStart=false -2022-04-22 16:38:14,545 INFO o.a.j.t.ThreadGroup: Started thread group number 1 -2022-04-22 16:38:14,545 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started -2022-04-22 16:38:14,548 INFO o.a.j.t.JMeterThread: Thread started: Edge Devices 1-1 -2022-04-22 16:38:14,552 INFO o.a.j.s.SampleResult: Note: Sample TimeStamps are START times -2022-04-22 16:38:14,552 INFO o.a.j.s.SampleResult: sampleresult.default.encoding is set to ISO-8859-1 -2022-04-22 16:38:14,552 INFO o.a.j.s.SampleResult: sampleresult.useNanoTime=true -2022-04-22 16:38:14,552 INFO o.a.j.s.SampleResult: sampleresult.nanoThreadSleep=5000 -2022-04-22 16:38:14,791 INFO o.a.j.p.h.s.HTTPHCAbstractImpl: Local host = helios05.lab.eng.tlv2.redhat.com -2022-04-22 16:38:14,796 INFO o.a.j.p.h.s.HTTPHC4Impl: HTTP request retry count = 1 -2022-04-22 16:38:14,869 INFO o.a.j.p.h.s.h.LazyLayeredConnectionSocketFactory: Setting up HTTPS TrustAll Socket Factory -2022-04-22 16:38:14,873 INFO o.a.j.u.JsseSSLManager: Using default SSL protocol: TLS -2022-04-22 16:38:14,873 INFO o.a.j.u.JsseSSLManager: SSL session context: per-thread -2022-04-22 16:38:14,919 INFO o.a.j.u.SSLManager: JmeterKeyStore Location: type JKS -2022-04-22 16:38:14,922 INFO o.a.j.u.SSLManager: KeyStore created OK -2022-04-22 16:38:14,922 WARN o.a.j.u.SSLManager: Keystore file not found, loading empty keystore -2022-04-22 16:38:30,144 INFO o.a.j.r.Summariser: summary + 4 in 00:00:16 = 0.3/s Avg: 124 Min: 14 Max: 249 Err: 0 (0.00%) Active: 1 Started: 1 Finished: 0 -2022-04-22 16:39:00,218 INFO o.a.j.r.Summariser: summary + 2 in 00:00:30 = 0.1/s Avg: 35 Min: 34 Max: 36 Err: 0 (0.00%) Active: 1 Started: 1 Finished: 0 -2022-04-22 16:39:00,219 INFO o.a.j.r.Summariser: summary = 6 in 00:00:46 = 0.1/s Avg: 94 Min: 14 Max: 249 Err: 0 (0.00%) -2022-04-22 16:39:15,318 INFO o.a.j.t.JMeterThread: Thread is done: Edge Devices 1-1 -2022-04-22 16:39:15,318 INFO o.a.j.t.JMeterThread: Thread finished: Edge Devices 1-1 -2022-04-22 16:39:15,322 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test -2022-04-22 16:39:15,323 INFO o.a.j.r.Summariser: summary + 3 in 00:00:15 = 0.2/s Avg: 31 Min: 23 Max: 36 Err: 0 (0.00%) Active: 0 Started: 1 Finished: 1 -2022-04-22 16:39:15,324 INFO o.a.j.r.Summariser: summary = 9 in 00:01:01 = 0.1/s Avg: 73 Min: 14 Max: 249 Err: 0 (0.00%) -2022-04-22 16:39:15,325 INFO o.a.j.JMeter: Generating Dashboard -2022-04-22 16:39:15,325 INFO o.a.j.r.d.ReportGenerator: Flushing result collector before report Generation -2022-04-22 16:39:15,341 INFO o.a.j.r.p.NormalizerSampleConsumer: Using format, 'ms', to parse timeStamp field -2022-04-22 16:39:15,391 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.AggregateConsumer#stopProducing(): beginDate produced 0 samples -2022-04-22 16:39:15,391 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.AggregateConsumer#stopProducing(): endDate produced 0 samples -2022-04-22 16:39:15,392 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.ApdexSummaryConsumer#stopProducing(): apdexSummary produced 0 samples -2022-04-22 16:39:15,393 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.RequestsSummaryConsumer#stopProducing(): requestsSummary produced 0 samples -2022-04-22 16:39:15,398 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.StatisticsSummaryConsumer#stopProducing(): statisticsSummary produced 0 samples -2022-04-22 16:39:15,401 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.Top5ErrorsBySamplerConsumer#stopProducing(): top5ErrorsBySampler produced 0 samples -2022-04-22 16:39:15,401 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.ErrorsSummaryConsumer#stopProducing(): errorsSummary produced 0 samples -2022-04-22 16:39:15,401 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.graph.impl.HitsPerSecondGraphConsumer#stopProducing(): hitsPerSecond produced 0 samples -2022-04-22 16:39:15,406 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.graph.impl.LatencyVSRequestGraphConsumer#stopProducing(): latencyVsRequest produced 0 samples -2022-04-22 16:39:15,406 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.graph.impl.SyntheticResponseTimeDistributionGraphConsumer#stopProducing(): syntheticResponseTimeDistribution produced 0 samples -2022-04-22 16:39:15,407 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.graph.impl.BytesThroughputGraphConsumer#stopProducing(): bytesThroughputOverTime produced 0 samples -2022-04-22 16:39:15,407 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.graph.impl.CodesPerSecondGraphConsumer#stopProducing(): codesPerSecond produced 0 samples -2022-04-22 16:39:15,408 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.graph.impl.ResponseTimeVSRequestGraphConsumer#stopProducing(): responseTimeVsRequest produced 0 samples -2022-04-22 16:39:15,408 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.FilterConsumer#stopProducing(): startIntervalControlerFilter produced 70 samples -2022-04-22 16:39:15,408 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.graph.impl.TotalTPSGraphConsumer#stopProducing(): totalTPS produced 0 samples -2022-04-22 16:39:15,408 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.graph.impl.ActiveThreadsGraphConsumer#stopProducing(): activeThreadsOverTime produced 0 samples -2022-04-22 16:39:15,408 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.graph.impl.TimeVSThreadGraphConsumer#stopProducing(): timeVsThreads produced 0 samples -2022-04-22 16:39:15,409 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.graph.impl.ResponseTimeDistributionGraphConsumer#stopProducing(): responseTimeDistribution produced 0 samples -2022-04-22 16:39:15,409 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.graph.impl.TransactionsPerSecondGraphConsumer#stopProducing(): transactionsPerSecond produced 0 samples -2022-04-22 16:39:15,409 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.graph.impl.ResponseTimePercentilesGraphConsumer#stopProducing(): responseTimePercentiles produced 0 samples -2022-04-22 16:39:15,411 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.graph.impl.ResponseTimePercentilesOverTimeGraphConsumer#stopProducing(): responseTimePercentilesOverTime produced 0 samples -2022-04-22 16:39:15,411 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.graph.impl.ResponseTimeOverTimeGraphConsumer#stopProducing(): responseTimesOverTime produced 0 samples -2022-04-22 16:39:15,411 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.graph.impl.ConnectTimeOverTimeGraphConsumer#stopProducing(): connectTimeOverTime produced 0 samples -2022-04-22 16:39:15,411 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.graph.impl.LatencyOverTimeGraphConsumer#stopProducing(): latenciesOverTime produced 0 samples -2022-04-22 16:39:15,411 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.FilterConsumer#stopProducing(): nameFilter produced 150 samples -2022-04-22 16:39:15,411 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.FilterConsumer#stopProducing(): dateRangeFilter produced 30 samples -2022-04-22 16:39:15,411 INFO o.a.j.r.p.AbstractSampleConsumer: class org.apache.jmeter.report.processor.NormalizerSampleConsumer#stopProducing(): normalizer produced 10 samples -2022-04-22 16:39:15,412 INFO o.a.j.r.p.CsvFileSampleSource: produce(): 10 samples produced in 50ms on channel 0 -2022-04-22 16:39:15,412 INFO o.a.j.r.d.ReportGenerator: Exporting data using exporter:'json' of className:'org.apache.jmeter.report.dashboard.JsonExporter' -2022-04-22 16:39:15,500 INFO o.a.j.r.d.JsonExporter: Found data for consumer statisticsSummary in context -2022-04-22 16:39:15,500 INFO o.a.j.r.d.JsonExporter: Creating statistics for overall -2022-04-22 16:39:15,500 INFO o.a.j.r.d.JsonExporter: Creating statistics for other transactions -2022-04-22 16:39:15,501 INFO o.a.j.r.d.JsonExporter: Checking output folder -2022-04-22 16:39:15,501 INFO o.a.j.r.d.JsonExporter: Writing statistics JSON to /root/gabriel-folder/flotta-scale-tests/scripts/test-run-delete_me/results/statistics.json -2022-04-22 16:39:15,531 INFO o.a.j.r.d.ReportGenerator: Exporting data using exporter:'html' of className:'org.apache.jmeter.report.dashboard.HtmlTemplateExporter' -2022-04-22 16:39:15,533 INFO o.a.j.r.d.HtmlTemplateExporter: Will generate dashboard in folder: /root/gabriel-folder/flotta-scale-tests/scripts/test-run-delete_me/results -2022-04-22 16:39:15,611 INFO o.a.j.r.d.HtmlTemplateExporter: Report will be generated in: /root/gabriel-folder/flotta-scale-tests/scripts/test-run-delete_me/results, creating folder structure -2022-04-22 16:39:15,613 INFO o.a.j.r.d.TemplateVisitor: Copying folder from '/home/test/apache-jmeter-5.4.1/bin/report-template' to '/root/gabriel-folder/flotta-scale-tests/scripts/test-run-delete_me/results', got message: /root/gabriel-folder/flotta-scale-tests/scripts/test-run-delete_me/results, found non empty folder with following content [/root/gabriel-folder/flotta-scale-tests/scripts/test-run-delete_me/results/statistics.json], will be ignored -2022-04-22 16:39:15,767 INFO o.a.j.JMeter: Dashboard generated diff --git a/scripts/register_device.sh b/scripts/register_device.sh index 6f8f712..0f417be 100755 --- a/scripts/register_device.sh +++ b/scripts/register_device.sh @@ -1,48 +1,49 @@ #!/bin/bash -openssl ecparam -name prime256v1 -genkey -noout -out ${test_dir}/${DEVICE_ID}.key -openssl req -new -subj '/CN=${DEVICE_ID}' -key ${test_dir}/${DEVICE_ID}.key -out ${test_dir}/${DEVICE_ID}.csr -export CERTIFICATE_REQUEST=$(cat ${test_dir}/${DEVICE_ID}.csr | sed 's/$/\\n/' | tr -d '\n') +openssl ecparam -name prime256v1 -genkey -noout -out ${CERTS_FOLDER}/${DEVICE_ID}.key +openssl req -new -subj '/CN=${DEVICE_ID}' -key ${CERTS_FOLDER}/${DEVICE_ID}.key -out ${CERTS_FOLDER}/${DEVICE_ID}.csr +export CERTIFICATE_REQUEST=$(cat ${CERTS_FOLDER}/${DEVICE_ID}.csr | sed 's/$/\\n/' | tr -d '\n') UUID=$(uuidgen) -echo "${PAYLOAD}" | sed -e 's/"content": {/"content": {\n "certificate_request": "$CERTIFICATE_REQUEST",/g' | envsubst > ${test_dir}/${DEVICE_ID}_payload.json + +echo "${PAYLOAD}" | sed -e 's/"content": {/"content": {\n "certificate_request": "$CERTIFICATE_REQUEST",/g' | envsubst > ${REGISTRATION_FOLDER}/${DEVICE_ID}_payload.json #Verify! -cat ${test_dir}/${DEVICE_ID}_payload.json | jq . +cat ${REGISTRATION_FOLDER}/${DEVICE_ID}_payload.json | jq . if [ $? -ne 0 ]; then - echo "Error when checking ${test_dir}/${DEVICE_ID}_payload.json" + echo "Error when checking ${REGISTRATION_FOLDER}/${DEVICE_ID}_payload.json" exit -1 fi echo "curl \ - --cacert ${test_dir}/default_ca.pem \\ - --cert ${test_dir}/default_cert.pem \\ - --key ${test_dir}/default_key.pem -v \\ - -d @${test_dir}/${DEVICE_ID}_payload.json \\ + --cacert ${CERTS_FOLDER}/default_ca.pem \\ + --cert ${CERTS_FOLDER}/default_cert.pem \\ + --key ${CERTS_FOLDER}/default_key.pem -v \\ + -d @${REGISTRATION_FOLDER}/${DEVICE_ID}_payload.json \\ -X POST \\ -H \"Content-Type: application/json\" \ - -o ${test_dir}/${DEVICE_ID}_response.json \\ + -o ${REGISTRATION_FOLDER}/${DEVICE_ID}_response.json \\ https://${HTTP_SERVER}:${HTTP_SERVER_PORT}/api/flotta-management/v1/data/${DEVICE_ID}/out" curl \ - --cacert ${test_dir}/default_ca.pem \ - --cert ${test_dir}/default_cert.pem \ - --key ${test_dir}/default_key.pem -v \ - -d @${test_dir}/${DEVICE_ID}_payload.json \ + --cacert ${CERTS_FOLDER}/default_ca.pem \ + --cert ${CERTS_FOLDER}/default_cert.pem \ + --key ${CERTS_FOLDER}/default_key.pem -v \ + -d @${REGISTRATION_FOLDER}/${DEVICE_ID}_payload.json \ -X POST \ -H "Content-Type: application/json" \ - -o ${test_dir}/${DEVICE_ID}_response.json \ + -o ${REGISTRATION_FOLDER}/${DEVICE_ID}_response.json \ https://${HTTP_SERVER}:${HTTP_SERVER_PORT}/api/flotta-management/v1/data/${DEVICE_ID}/out if [ $? -ne 0 ]; then - echo "Error when sending registration request, see ${test_dir}/${DEVICE_ID}_register.out" + echo "Error when sending registration request, see ${REGISTRATION_FOLDER_dir}/${DEVICE_ID}_register.out" exit -1 fi -cat ${test_dir}/${DEVICE_ID}_response.json | jq '.content.certificate' | sed -e 's/\\n/\n/g' | sed -e 's/"//g' > ${test_dir}/${DEVICE_ID}.pem +cat ${REGISTRATION_FOLDER}/${DEVICE_ID}_response.json | jq '.content.certificate' | sed -e 's/\\n/\n/g' | sed -e 's/"//g' > ${CERTS_FOLDER}/${DEVICE_ID}.pem -#openssl x509 -in ${test_dir}/${DEVICE_ID}.pem --text +#openssl x509 -in ${CERTS_FOLDER}/${DEVICE_ID}.pem --text if [ $? -ne 0 ]; then - echo "Error when extracting ${test_dir}/${DEVICE_ID}_response.json to ${test_dir}/${DEVICE_ID}.pem" + echo "Error when extracting ${REGISTRATION_FOLDER}/${DEVICE_ID}_response.json to ${CERTS_FOLDER}/${DEVICE_ID}.pem" exit -1 fi diff --git a/scripts/request_operator.sh b/scripts/request_operator.sh index 0d5553a..94b7a20 100755 --- a/scripts/request_operator.sh +++ b/scripts/request_operator.sh @@ -1,17 +1,17 @@ #!/bin/bash echo "curl -XPOST \\ - --cacert ${test_dir}/default_ca.pem \\ - --cert ${test_dir}/${DEVICE_ID}.pem \\ - --key ${test_dir}/${DEVICE_ID}.key -v \\ + --cacert ${CERTS_FOLDER}/default_ca.pem \\ + --cert ${CERTS_FOLDER}/${DEVICE_ID}.pem \\ + --key ${CERTS_FOLDER}/${DEVICE_ID}.key -v \\ -H \"Content-Type: application/json\" \\ --data ${POST_BODY} \\ https://${HTTP_SERVER}:${HTTP_SERVER_PORT}/${REQUEST_PATH}" curl -XPOST \ - --cacert ${test_dir}/default_ca.pem \ - --cert ${test_dir}/${DEVICE_ID}.pem \ - --key ${test_dir}/${DEVICE_ID}.key -v \ + --cacert ${CERTS_FOLDER}/default_ca.pem \ + --cert ${CERTS_FOLDER}/${DEVICE_ID}.pem \ + --key ${CERTS_FOLDER}/${DEVICE_ID}.key -v \ -H "Content-Type: application/json" \ --data ${POST_BODY} \ https://${HTTP_SERVER}:${HTTP_SERVER_PORT}/${REQUEST_PATH} diff --git a/scripts/run_test_plan.sh b/scripts/run_test_plan.sh index 20be33e..c85e1c8 100755 --- a/scripts/run_test_plan.sh +++ b/scripts/run_test_plan.sh @@ -57,7 +57,7 @@ while getopts "c:d:e:f:g:h:i:j:k:l:m:n:o:p:q:r:s:t:u:v" option; do l) LOG_LEVEL=${OPTARG};; m) MUST_GATHER=${OPTARG};; n) TEST_ID=${OPTARG};; - o) edgeworkloadMENT_CONCURRENCY=${OPTARG};; + o) EDGEWORKLOAD_CONCURRENCY=${OPTARG};; p) EDGE_DEPLOYMENTS_PER_DEVICE=${OPTARG};; q) NAMESPACES_COUNT=${OPTARG};; r) RAMP_UP_TIME=${OPTARG};; @@ -86,9 +86,9 @@ if [[ -z $REPLICAS ]]; then echo "INFO: Number of replicas not specified. Using default value: $REPLICAS" fi -if [[ -z $edgeworkloadMENT_CONCURRENCY ]]; then - edgeworkloadMENT_CONCURRENCY=5 - echo "INFO: Edge deployment concurrency not specified. Using default value: $edgeworkloadMENT_CONCURRENCY" +if [[ -z $EDGEWORKLOAD_CONCURRENCY ]]; then + EDGEWORKLOAD_CONCURRENCY=5 + echo "INFO: Edge deployment concurrency not specified. Using default value: $EDGEWORKLOAD_CONCURRENCY" fi if [[ -z $TEST_ID ]]; then @@ -229,7 +229,10 @@ echo "Before test: There are $edgedevices edge devices and $edgeworkload edge wo run_test() { -echo "INFO: Running test" +SCRIPT=$(readlink -f "$0") +SCRIPT_DIR=$(dirname "$SCRIPT") + +echo "INFO: Running test located in ${SCRIPT_DIR}" JVM_ARGS="-Xms4g -Xmx64g -Xss250k -XX:MaxMetaspaceSize=1g" $JMETER_HOME/bin/jmeter.sh -n -l $test_dir/results.csv \ -f -e -o $test_dir/results/ -t $TEST_PLAN \ -JEDGE_DEVICES_COUNT=$EDGE_DEVICES_COUNT \ @@ -241,7 +244,11 @@ JVM_ARGS="-Xms4g -Xmx64g -Xss250k -XX:MaxMetaspaceSize=1g" $JMETER_HOME/bin/jmet -JHTTP_SERVER=$HTTP_SERVER \ -JHTTP_SERVER_PORT=$HTTP_SERVER_PORT \ -JTEST_DIR=$test_dir \ - -JSCRIPTS_DIR=`pwd` \ + -JSCRIPTS_DIR=$SCRIPT_DIR \ + -JCERTS_FOLDER=$CERTS_FOLDER \ + -JREGISTRATION_FOLDER="${logs_dir}/registration" \ + -JGET_UPDATES_FOLDER="${logs_dir}/get_updates" \ + -JHEARTBEAT_FOLDER="${logs_dir}/heartbeat" \ -JNAMESPACES_COUNT=$NAMESPACES_COUNT|& tee -a $test_dir/summary.txt } @@ -299,7 +306,7 @@ kubectl patch cm -n flotta flotta-operator-manager-config --type merge --patch ' "LOG_LEVEL": "'$LOG_LEVEL'", "OBC_AUTO_CREATE": "false", "MAX_CONCURRENT_RECONCILES": "'$MAX_CONCURRENT_RECONCILES'", - "edgeworkloadMENT_CONCURRENCY": "'$edgeworkloadMENT_CONCURRENCY'", + "EDGEWORKLOAD_CONCURRENCY": "'$EDGEWORKLOAD_CONCURRENCY'", "NAMESPACES_COUNT": "'$NAMESPACES_COUNT'"} }' @@ -394,15 +401,16 @@ kubectl scale --replicas=$REPLICAS deployment flotta-operator-controller-manager kubectl wait --for=condition=available -n flotta deployment.apps/flotta-operator-controller-manager count=0 +export CERTS_FOLDER="${test_dir}/certs" DEVICE_ID='default' DEVICE_ID=$DEVICE_ID sh generate_certs.sh echo "Waiting for HTTP server to be ready at $HTTP_SERVER" until [[ count -gt 100 ]] do curl \ - --cacert ${test_dir}/${DEVICE_ID}_ca.pem \ - --cert ${test_dir}/${DEVICE_ID}_cert.pem \ - --key ${test_dir}/${DEVICE_ID}_key.pem -v \ + --cacert ${CERTS_FOLDER}/${DEVICE_ID}_ca.pem \ + --cert ${CERTS_FOLDER}/${DEVICE_ID}_cert.pem \ + --key ${CERTS_FOLDER}/${DEVICE_ID}_key.pem -v \ -m 5 -s -i \ https://${HTTP_SERVER}:${HTTP_SERVER_PORT} | grep 404 > /dev/null if [ "$?" == "1" ]; then @@ -430,35 +438,11 @@ kubectl top pods -n flotta --use-protocol-buffers } >> $test_dir/summary.txt } -setup() -{ - sysctl -w net.core.somaxconn=50000 - sysctl -w net.core.netdev_max_backlog=50000 - sysctl -w net.ipv4.tcp_max_syn_backlog=50000 - sysctl -w net.ipv4.ip_local_port_range="15000 65000" - sysctl -w net.ipv4.tcp_fin_timeout=10 - sysctl -w vm.max_map_count=999999 - sysctl -w kernel.threads-max=4113992 - - if [ -z $(grep "* soft nofile 999999" "/etc/security/limits.conf") ]; then - cat "* soft nofile 999999" >> /etc/security/limits.conf - fi - if [ -z $(grep "* hard nofile 999999" "/etc/security/limits.conf") ]; then - cat "* hard nofile 999999" >> /etc/security/limits.conf - fi - - - ifconfig br-ex txqueuelen 5000 - ifconfig cni-podman0 txqueuelen 5000 - ifconfig ens3 txqueuelen 5000 - ifconfig ens4 txqueuelen 5000 - ifconfig ovn-k8s-mp0 txqueuelen 5000 -} parse_args "$@" log_run_details -setup +sh setup patch_flotta_operator log_pods_details run_test diff --git a/scripts/service.yaml b/scripts/service.yaml deleted file mode 100644 index c453c02..0000000 --- a/scripts/service.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: flotta-svc - namespace: flotta -spec: - type: NodePort - selector: - control-plane: controller-manager - ports: - # By default and for convenience, the `targetPort` is set to the same value as the `port` field. - - port: 8043 - targetPort: 8043 - # Optional field - # By default and for convenience, the Kubernetes control plane will allocate a port from a range (default: 30000-32767) - nodePort: 30043 diff --git a/test_plans/flotta_test_plan.jmx b/test_plans/flotta_test_plan.jmx index 2d25c27..a0fba88 100644 --- a/test_plans/flotta_test_plan.jmx +++ b/test_plans/flotta_test_plan.jmx @@ -10,7 +10,7 @@ HTTP_SERVER - localhost:8084 + localhost:8083 = @@ -30,9 +30,13 @@ DEPLOYMENTS_PER_DEVICE TEST_DIR SCRIPTS_DIR + REGISTRATION_FOLDER + GET_UPDATES_FOLDER + HEARTBEAT_FOLDER + CERTS_FOLDER - + ${__P(HTTP_SERVER,flotta-operator-controller-manager-flotta-operator-system.apps.mycluster.redhat.com)} ${__P(HTTP_SERVER_PORT,80)} ${__P(OCP_API_SERVER,api.mycluster.redhat.com)} @@ -43,6 +47,10 @@ ${__P(DEPLOYMENTS_PER_DEVICE,5)} ${__P(TEST_DIR,test_dir_delete_me)} ${__P(SCRIPTS_DIR,.)} + ${__P(REGISTRATION_FOLDER,./registration)} + ${__P(GET_UPDATES_FOLDER,./get_updates)} + ${__P(HEARTBEAT_FOLDER,./heartbeat)} + ${__P(CERTS_FOLDER,./certs)} false @@ -81,7 +89,28 @@ - + + + REGISTRATION_FOLDER + ${REGISTRATION_FOLDER} + = + + + GET_UPDATES_FOLDER + ${GET_UPDATES_FOLDER} + = + + + HEARTBEAT_FOLDER + ${HEARTBEAT_FOLDER} + = + + + DEVICE_ID + ${DEVICE_ID} + = + + @@ -161,11 +190,21 @@ { "content": { "hardware": { "cpu": { "architecture": "x86_64", "flags": [], "model_name": "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz" }, "hostname": "${HOSTNAME}", "system_vendor": { "manufacturer": "LENOVO", "product_name": "${PRODUCT_NAME}", "serial_number": "${SERIAL_NAME}" } }, "os_image_id": "unknown" }, "directive": "registration", "message_id": "${__UUID()}", "sent": "2021-11-21T14:45:25.271+02:00", "type": "data", "version": 1 } = + + REGISTRATION_FOLDER + ${REGISTRATION_FOLDER} + = + + + CERTS_FOLDER + ${CERTS_FOLDER} + = + - ${TEST_DIR}/${DEVICE_ID}_register.out - ${TEST_DIR}/${DEVICE_ID}_register.err + ${REGISTRATION_FOLDER}/${DEVICE_ID}_register.out + ${REGISTRATION_FOLDER}/${DEVICE_ID}_register.err @@ -485,11 +524,16 @@ ${HTTP_SERVER_PORT} = + + CERTS_FOLDER + ${CERTS_FOLDER} + = + - ${TEST_DIR}/${DEVICE_ID}_get_updates.out - ${TEST_DIR}/${DEVICE_ID}_get_updates.err + ${GET_UPDATES_FOLDER}/${DEVICE_ID}_get_updates.out + ${GET_UPDATES_FOLDER}/${DEVICE_ID}_get_updates.err @@ -543,11 +587,16 @@ ${HTTP_SERVER_PORT} = + + CERTS_FOLDER + ${CERTS_FOLDER} + = + - ${TEST_DIR}/${DEVICE_ID}_hearthbeat.out - ${TEST_DIR}/${DEVICE_ID}_hearthbeat.err + ${HEARTBEAT_FOLDER}/${DEVICE_ID}_heartbeat.out + ${HEARTBEAT_FOLDER}/${DEVICE_ID}_heartbeat.err diff --git a/test_plans/flotta_test_plan_edge_devices_only.jmx b/test_plans/flotta_test_plan_edge_devices_only.jmx index ad8c987..3174388 100644 --- a/test_plans/flotta_test_plan_edge_devices_only.jmx +++ b/test_plans/flotta_test_plan_edge_devices_only.jmx @@ -30,9 +30,13 @@ DEPLOYMENTS_PER_DEVICE TEST_DIR SCRIPTS_DIR + REGISTRATION_FOLDER + GET_UPDATES_FOLDER + HEARTBEAT_FOLDER + CERTS_FOLDER - + ${__P(HTTP_SERVER,flotta-operator-controller-manager-flotta-operator-system.apps.mycluster.redhat.com)} ${__P(HTTP_SERVER_PORT,80)} ${__P(OCP_API_SERVER,api.mycluster.redhat.com)} @@ -43,6 +47,10 @@ ${__P(DEPLOYMENTS_PER_DEVICE,10)} ${__P(TEST_DIR,test_dir_delete_me)} ${__P(SCRIPTS_DIR,.)} + ${__P(REGISTRATION_FOLDER,./registration)} + ${__P(GET_UPDATES_FOLDER,./get_updates)} + ${__P(HEARTBEAT_FOLDER,./heartbeat)} + ${__P(CERTS_FOLDER,./certs)} false @@ -81,7 +89,28 @@ - + + + REGISTRATION_FOLDER + ${REGISTRATION_FOLDER} + = + + + GET_UPDATES_FOLDER + ${GET_UPDATES_FOLDER} + = + + + HEARTBEAT_FOLDER + ${HEARTBEAT_FOLDER} + = + + + DEVICE_ID + ${DEVICE_ID} + = + + @@ -156,11 +185,21 @@ { "content": { "hardware": { "boot": { "current_boot_mode": "bios" }, "cpu": { "architecture": "x86_64", "count": 8, "flags": [ "fpu", "vme", "de", "pse", "tsc", "msr", "pae", "mce", "cx8", "apic", "sep", "mtrr", "pge", "mca", "cmov", "pat", "pse36", "clflush", "dts", "acpi", "mmx", "fxsr", "sse", "sse2", "ss", "ht", "tm", "pbe", "syscall", "nx", "pdpe1gb", "rdtscp", "lm", "constant_tsc", "art", "arch_perfmon", "pebs", "bts", "rep_good", "nopl", "xtopology", "nonstop_tsc", "cpuid", "aperfmperf", "pni", "pclmulqdq", "dtes64", "monitor", "ds_cpl", "vmx", "smx", "est", "tm2", "ssse3", "sdbg", "fma", "cx16", "xtpr", "pdcm", "pcid", "sse4_1", "sse4_2", "x2apic", "movbe", "popcnt", "tsc_deadline_timer", "aes", "xsave", "avx", "f16c", "rdrand", "lahf_lm", "abm", "3dnowprefetch", "cpuid_fault", "epb", "invpcid_single", "pti", "ssbd", "ibrs", "ibpb", "stibp", "tpr_shadow", "vnmi", "flexpriority", "ept", "vpid", "ept_ad", "fsgsbase", "tsc_adjust", "bmi1", "hle", "avx2", "smep", "bmi2", "erms", "invpcid", "rtm", "mpx", "rdseed", "adx", "smap", "clflushopt", "intel_pt", "xsaveopt", "xsavec", "xgetbv1", "xsaves", "dtherm", "ida", "arat", "pln", "pts", "hwp", "hwp_notify", "hwp_act_window", "hwp_epp", "md_clear", "flush_l1d" ], "frequency": 3600, "model_name": "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz" }, "disks": [ { "drive_type": "SSD", "id": "/dev/dm-0", "name": "dm-0", "path": "/dev/dm-0", "size_bytes": 511032950784, "smart": "{\"json_format_version\":[1,0],\"smartctl\":{\"version\":[7,2],\"svn_revision\":\"5155\",\"platform_info\":\"x86_64-linux-5.13.14-100.fc33.x86_64\",\"build_info\":\"(local build)\",\"argv\":[\"smartctl\",\"--xall\",\"--json=c\",\"/dev/dm-0\"],\"messages\":[{\"string\":\"/dev/dm-0: Unable to detect device type\",\"severity\":\"error\"}],\"exit_status\":1}}" }, { "drive_type": "SSD", "id": "/dev/dm-1", "name": "dm-1", "path": "/dev/dm-1", "size_bytes": 117440512, "smart": "{\"json_format_version\":[1,0],\"smartctl\":{\"version\":[7,2],\"svn_revision\":\"5155\",\"platform_info\":\"x86_64-linux-5.13.14-100.fc33.x86_64\",\"build_info\":\"(local build)\",\"argv\":[\"smartctl\",\"--xall\",\"--json=c\",\"/dev/dm-1\"],\"messages\":[{\"string\":\"/dev/dm-1: Unable to detect device type\",\"severity\":\"error\"}],\"exit_status\":1}}" }, { "drive_type": "SSD", "id": "/dev/dm-10", "name": "dm-10", "path": "/dev/dm-10", "size_bytes": 6576668672, "smart": "{\"json_format_version\":[1,0],\"smartctl\":{\"version\":[7,2],\"svn_revision\":\"5155\",\"platform_info\":\"x86_64-linux-5.13.14-100.fc33.x86_64\",\"build_info\":\"(local build)\",\"argv\":[\"smartctl\",\"--xall\",\"--json=c\",\"/dev/dm-10\"],\"messages\":[{\"string\":\"/dev/dm-10: Unable to detect device type\",\"severity\":\"error\"}],\"exit_status\":1}}" }, { "drive_type": "SSD", "id": "/dev/dm-2", "name": "dm-2", "path": "/dev/dm-2", "size_bytes": 477232103424, "smart": "{\"json_format_version\":[1,0],\"smartctl\":{\"version\":[7,2],\"svn_revision\":\"5155\",\"platform_info\":\"x86_64-linux-5.13.14-100.fc33.x86_64\",\"build_info\":\"(local build)\",\"argv\":[\"smartctl\",\"--xall\",\"--json=c\",\"/dev/dm-2\"],\"messages\":[{\"string\":\"/dev/dm-2: Unable to detect device type\",\"severity\":\"error\"}],\"exit_status\":1}}" }, { "drive_type": "SSD", "id": "/dev/dm-3", "name": "dm-3", "path": "/dev/dm-3", "size_bytes": 477232103424, "smart": "{\"json_format_version\":[1,0],\"smartctl\":{\"version\":[7,2],\"svn_revision\":\"5155\",\"platform_info\":\"x86_64-linux-5.13.14-100.fc33.x86_64\",\"build_info\":\"(local build)\",\"argv\":[\"smartctl\",\"--xall\",\"--json=c\",\"/dev/dm-3\"],\"messages\":[{\"string\":\"/dev/dm-3: Unable to detect device type\",\"severity\":\"error\"}],\"exit_status\":1}}" }, { "drive_type": "SSD", "id": "/dev/dm-4", "name": "dm-4", "path": "/dev/dm-4", "size_bytes": 107374182400, "smart": "{\"json_format_version\":[1,0],\"smartctl\":{\"version\":[7,2],\"svn_revision\":\"5155\",\"platform_info\":\"x86_64-linux-5.13.14-100.fc33.x86_64\",\"build_info\":\"(local build)\",\"argv\":[\"smartctl\",\"--xall\",\"--json=c\",\"/dev/dm-4\"],\"messages\":[{\"string\":\"/dev/dm-4: Unable to detect device type\",\"severity\":\"error\"}],\"exit_status\":1}}" }, { "drive_type": "SSD", "id": "/dev/dm-5", "name": "dm-5", "path": "/dev/dm-5", "size_bytes": 16609443840, "smart": "{\"json_format_version\":[1,0],\"smartctl\":{\"version\":[7,2],\"svn_revision\":\"5155\",\"platform_info\":\"x86_64-linux-5.13.14-100.fc33.x86_64\",\"build_info\":\"(local build)\",\"argv\":[\"smartctl\",\"--xall\",\"--json=c\",\"/dev/dm-5\"],\"messages\":[{\"string\":\"/dev/dm-5: Unable to detect device type\",\"severity\":\"error\"}],\"exit_status\":1}}" }, { "drive_type": "SSD", "id": "/dev/dm-6", "name": "dm-6", "path": "/dev/dm-6", "size_bytes": 477232103424, "smart": "{\"json_format_version\":[1,0],\"smartctl\":{\"version\":[7,2],\"svn_revision\":\"5155\",\"platform_info\":\"x86_64-linux-5.13.14-100.fc33.x86_64\",\"build_info\":\"(local build)\",\"argv\":[\"smartctl\",\"--xall\",\"--json=c\",\"/dev/dm-6\"],\"messages\":[{\"string\":\"/dev/dm-6: Unable to detect device type\",\"severity\":\"error\"}],\"exit_status\":1}}" }, { "drive_type": "SSD", "id": "/dev/dm-7", "name": "dm-7", "path": "/dev/dm-7", "size_bytes": 369857921024, "smart": "{\"json_format_version\":[1,0],\"smartctl\":{\"version\":[7,2],\"svn_revision\":\"5155\",\"platform_info\":\"x86_64-linux-5.13.14-100.fc33.x86_64\",\"build_info\":\"(local build)\",\"argv\":[\"smartctl\",\"--xall\",\"--json=c\",\"/dev/dm-7\"],\"messages\":[{\"string\":\"/dev/dm-7: Unable to detect device type\",\"severity\":\"error\"}],\"exit_status\":1}}" }, { "drive_type": "SSD", "id": "/dev/dm-8", "name": "dm-8", "path": "/dev/dm-8", "size_bytes": 511705088, "smart": "{\"json_format_version\":[1,0],\"smartctl\":{\"version\":[7,2],\"svn_revision\":\"5155\",\"platform_info\":\"x86_64-linux-5.13.14-100.fc33.x86_64\",\"build_info\":\"(local build)\",\"argv\":[\"smartctl\",\"--xall\",\"--json=c\",\"/dev/dm-8\"],\"messages\":[{\"string\":\"/dev/dm-8: Unable to detect device type\",\"severity\":\"error\"}],\"exit_status\":1}}" }, { "drive_type": "SSD", "id": "/dev/dm-9", "name": "dm-9", "path": "/dev/dm-9", "size_bytes": 6576668672, "smart": "{\"json_format_version\":[1,0],\"smartctl\":{\"version\":[7,2],\"svn_revision\":\"5155\",\"platform_info\":\"x86_64-linux-5.13.14-100.fc33.x86_64\",\"build_info\":\"(local build)\",\"argv\":[\"smartctl\",\"--xall\",\"--json=c\",\"/dev/dm-9\"],\"messages\":[{\"string\":\"/dev/dm-9: Unable to detect device type\",\"severity\":\"error\"}],\"exit_status\":1}}" }, { "bootable": true, "by_id": "/dev/disk/by-id/nvme-eui.002538c571b05d4b", "by_path": "/dev/disk/by-path/pci-0000:3e:00.0-nvme-1", "drive_type": "SSD", "id": "/dev/disk/by-id/nvme-eui.002538c571b05d4b", "model": "SAMSUNG MZVKW512HMJP-000L7", "name": "nvme0n1", "path": "/dev/nvme0n1", "serial": "S35BNX0J505918", "size_bytes": 512110190592, "smart": "{\"json_format_version\":[1,0],\"smartctl\":{\"version\":[7,2],\"svn_revision\":\"5155\",\"platform_info\":\"x86_64-linux-5.13.14-100.fc33.x86_64\",\"build_info\":\"(local build)\",\"argv\":[\"smartctl\",\"--xall\",\"--json=c\",\"/dev/nvme0n1\"],\"exit_status\":0},\"device\":{\"name\":\"/dev/nvme0n1\",\"info_name\":\"/dev/nvme0n1\",\"type\":\"nvme\",\"protocol\":\"NVMe\"},\"model_name\":\"SAMSUNG MZVKW512HMJP-000L7\",\"serial_number\":\"S35BNX0J505918\",\"firmware_version\":\"7L6QCXA7\",\"nvme_pci_vendor\":{\"id\":5197,\"subsystem_id\":5197},\"nvme_ieee_oui_identifier\":9528,\"nvme_total_capacity\":512110190592,\"nvme_unallocated_capacity\":0,\"nvme_controller_id\":2,\"nvme_version\":{\"string\":\"1.2\",\"value\":66048},\"nvme_number_of_namespaces\":1,\"nvme_namespaces\":[{\"id\":1,\"size\":{\"blocks\":1000215216,\"bytes\":512110190592},\"capacity\":{\"blocks\":1000215216,\"bytes\":512110190592},\"utilization\":{\"blocks\":1000215216,\"bytes\":512110190592},\"formatted_lba_size\":512,\"eui64\":{\"oui\":9528,\"ext_id\":848015940939}}],\"user_capacity\":{\"blocks\":1000215216,\"bytes\":512110190592},\"logical_block_size\":512,\"local_time\":{\"time_t\":1637498725,\"asctime\":\"Sun Nov 21 14:45:25 2021 IST\"},\"smart_status\":{\"passed\":true,\"nvme\":{\"value\":0}},\"nvme_smart_health_information_log\":{\"critical_warning\":0,\"temperature\":27,\"available_spare\":100,\"available_spare_threshold\":10,\"percentage_used\":15,\"data_units_read\":17934599,\"data_units_written\":97148210,\"host_reads\":463356329,\"host_writes\":2453263768,\"controller_busy_time\":15671,\"power_cycles\":1517,\"power_on_hours\":11110,\"unsafe_shutdowns\":261,\"media_errors\":0,\"num_err_log_entries\":495,\"warning_temp_time\":0,\"critical_comp_time\":0,\"temperature_sensors\":[27,40]},\"temperature\":{\"current\":27},\"power_cycle_count\":1517,\"power_on_time\":{\"hours\":11110}}", "wwn": "eui.002538c571b05d4b" }, { "drive_type": "SSD", "id": "/dev/zram0", "name": "zram0", "path": "/dev/zram0", "size_bytes": 4294967296, "smart": "{\"json_format_version\":[1,0],\"smartctl\":{\"version\":[7,2],\"svn_revision\":\"5155\",\"platform_info\":\"x86_64-linux-5.13.14-100.fc33.x86_64\",\"build_info\":\"(local build)\",\"argv\":[\"smartctl\",\"--xall\",\"--json=c\",\"/dev/zram0\"],\"messages\":[{\"string\":\"/dev/zram0: Unable to detect device type\",\"severity\":\"error\"}],\"exit_status\":1}}" } ], "gpus": [ { "address": "0000:01:00.0", "device_id": "13b1", "name": "GM107GLM [Quadro M1000M]", "vendor": "NVIDIA Corporation", "vendor_id": "10de" } ], "hostname": "${HOSTNAME}", "interfaces": [ { "biosdevname": "em1", "flags": [ "up", "broadcast", "multicast" ], "has_carrier": true, "ipv4_addresses": [ "10.100.102.22/24" ], "ipv6_addresses": [], "mac_address": "${MAC_ADDRESS2}", "mtu": 1500, "name": "enp0s31f6", "product": "0x15b7", "speed_mbps": 1000, "vendor": "0x8086" }, { "biosdevname": "p2p1", "flags": [ "broadcast", "multicast" ], "ipv4_addresses": [], "ipv6_addresses": [], "mac_address": "${MAC_ADDRESS2}", "mtu": 1500, "name": "wlp4s0", "product": "0x24f3", "vendor": "0x8086" } ], "memory": { "physical_bytes": 34359738368, "usable_bytes": 33084645376 }, "system_vendor": { "manufacturer": "LENOVO", "product_name": "${PRODUCT_NAME}", "serial_number": "${SERIAL_NAME}" } }, "os_image_id": "unknown" }, "directive": "registration", "message_id": "${__UUID()}", "sent": "2021-11-21T14:45:25.271+02:00", "type": "data", "version": 1 } = + + REGISTRATION_FOLDER + ${REGISTRATION_FOLDER} + = + + + CERTS_FOLDER + ${CERTS_FOLDER} + = + - ${TEST_DIR}/${DEVICE_ID}_register.out - ${TEST_DIR}/${DEVICE_ID}_register.err + ${REGISTRATION_FOLDER}/${DEVICE_ID}_register.out + ${REGISTRATION_FOLDER}/${DEVICE_ID}_register.err @@ -587,7 +626,7 @@ 4 - + true 0 /bin/bash @@ -627,11 +666,16 @@ ${HTTP_SERVER_PORT} = + + CERTS_FOLDER + ${CERTS_FOLDER} + = + - ${TEST_DIR}/${DEVICE_ID}_get_updates.out - ${TEST_DIR}/${DEVICE_ID}_get_updates.err + ${GET_UPDATES_FOLDER}/${DEVICE_ID}_get_updates.out + ${GET_UPDATES_FOLDER}/${DEVICE_ID}_get_updates.err @@ -704,11 +748,16 @@ ${HTTP_SERVER_PORT} = + + CERTS_FOLDER + ${CERTS_FOLDER} + = + - ${TEST_DIR}/${DEVICE_ID}_hearthbeat.out - ${TEST_DIR}/${DEVICE_ID}_hearthbeat.err + ${HEARTBEAT_FOLDER}/${DEVICE_ID}_heartbeat.out + ${HEARTBEAT_FOLDER}/${DEVICE_ID}_heartbeat.err diff --git a/test_plans/flotta_test_plan_multiple_namespaces.jmx b/test_plans/flotta_test_plan_multiple_namespaces.jmx index 6b632d2..07565ae 100644 --- a/test_plans/flotta_test_plan_multiple_namespaces.jmx +++ b/test_plans/flotta_test_plan_multiple_namespaces.jmx @@ -25,6 +25,10 @@ NAMESPACES_COUNT TEST_DIR SCRIPTS_DIR + REGISTRATION_FOLDER + GET_UPDATES_FOLDER + HEARTBEAT_FOLDER + CERTS_FOLDER @@ -39,6 +43,10 @@ ${__P(NAMESPACES_COUNT,5)} ${__P(TEST_DIR,test_dir_delete_me)} ${__P(SCRIPTS_DIR,.)} + ${__P(REGISTRATION_FOLDER,./registration)} + ${__P(GET_UPDATES_FOLDER,./get_updates)} + ${__P(HEARTBEAT_FOLDER,./heartbeat)} + ${__P(CERTS_FOLDER,./certs)} false @@ -154,7 +162,28 @@ - + + + REGISTRATION_FOLDER + ${REGISTRATION_FOLDER} + = + + + GET_UPDATES_FOLDER + ${GET_UPDATES_FOLDER} + = + + + HEARTBEAT_FOLDER + ${HEARTBEAT_FOLDER} + = + + + DEVICE_ID + ${DEVICE_ID} + = + + @@ -258,11 +287,21 @@ vars.put("NAMESPACE", ns); { "content": { "hardware": { "cpu": { "architecture": "x86_64", "flags": [], "model_name": "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz" }, "hostname": "${HOSTNAME}", "system_vendor": { "manufacturer": "LENOVO", "product_name": "${PRODUCT_NAME}", "serial_number": "${SERIAL_NAME}" } }, "os_image_id": "unknown" }, "directive": "registration", "message_id": "${__UUID()}", "sent": "2021-11-21T14:45:25.271+02:00", "type": "data", "version": 1 } = + + REGISTRATION_FOLDER + ${REGISTRATION_FOLDER} + = + + + CERTS_FOLDER + ${CERTS_FOLDER} + = + - ${TEST_DIR}/${DEVICE_ID}_register.out - ${TEST_DIR}/${DEVICE_ID}_register.err + ${REGISTRATION_FOLDER}/${DEVICE_ID}_register.out + ${REGISTRATION_FOLDER}/${DEVICE_ID}_register.err @@ -577,11 +616,16 @@ vars.put("NAMESPACE", ns); ${HTTP_SERVER_PORT} = + + CERTS_FOLDER + ${CERTS_FOLDER} + = + - ${TEST_DIR}/${DEVICE_ID}_get_updates.out - ${TEST_DIR}/${DEVICE_ID}_get_updates.err + ${GET_UPDATES_FOLDER}/${DEVICE_ID}_get_updates.out + ${GET_UPDATES_FOLDER}/${DEVICE_ID}_get_updates.err @@ -655,11 +699,16 @@ vars.put("NAMESPACE", ns); ${HTTP_SERVER_PORT} = + + CERTS_FOLDER + ${CERTS_FOLDER} + = + - ${TEST_DIR}/${DEVICE_ID}_hearthbeat.out - ${TEST_DIR}/${DEVICE_ID}_hearthbeat.err + ${HEARTBEAT_FOLDER}/${DEVICE_ID}_heartbeat.out + ${HEARTBEAT_FOLDER}/${DEVICE_ID}_heartbeat.err From cf7a507ace314168ddff4695b162462d466fdaef Mon Sep 17 00:00:00 2001 From: gabriel-farache Date: Mon, 25 Apr 2022 13:05:21 +0200 Subject: [PATCH 03/11] Add port forwarding --- README.md | 9 +++++++++ scripts/run_test_plan.sh | 20 ++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/README.md b/README.md index 830e9a1..cc4e2e4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,15 @@ # flotta-scale-tests The purpose of this project is to test the scalability and performance of [project-flotta](https://github.com/project-flotta/flotta-operator) using [JMeter](https://jmeter.apache.org). +## Install OCP SNO cluster +Clone https://gitlab.cee.redhat.com/jgil/simple-openshift-cluster-provisioner +Run `CLUSTER_NAME= SNO_MASTER_MEMORY= SNO_MASTER_CPU= make create_sno_cluster`. + +Ex: `CLUSTER_NAME=devicemgmt1 SNO_MASTER_MEMORY=64000 SNO_MASTER_CPU=16 make create_sno_cluster` +## Configure K8S/OCP cluster +Follow https://metallb.universe.tf/installation/ to avoid having to create NodePort service to expose the flotta operator +See https://metallb.universe.tf/configuration/#layer-2-configuration. Use `kubectl get nodes -o` or `oc get nodes -o wide` to get the IP adress. + ## Running the test plan Use [./scripts/run_test_plan.sh](./scripts/run_test_plan.sh) to run the test plan. The script will create the required resources on the cluster for running the test. diff --git a/scripts/run_test_plan.sh b/scripts/run_test_plan.sh index c85e1c8..0ea7100 100755 --- a/scripts/run_test_plan.sh +++ b/scripts/run_test_plan.sh @@ -400,6 +400,25 @@ fi kubectl scale --replicas=$REPLICAS deployment flotta-operator-controller-manager -n flotta kubectl wait --for=condition=available -n flotta deployment.apps/flotta-operator-controller-manager +PORT_FORWARDING_ALREADY_TAKEN=$(ps -eaf | grep "kubectl port-forward service/flotta-operator-controller-manager -n flotta $HTTP_SERVER_PORT --address 0.0.0.0" | wc -l) + +if [ $PORT_FORWARDING_ALREADY_TAKEN -gt 2 ]; then + echo $'\n'"Target port ${HTTP_SERVER_PORT} for port-forward is already taken by another port-forward process" + exit 1 +fi + +echo "Forwarding port to 127.0.0.1" +kubectl port-forward service/flotta-operator-controller-manager -n flotta ${HTTP_SERVER_PORT} --address 0.0.0.0 & +export PORT_FORWARD_PID=$! +ps $PORT_FORWARD_PID +until [[ $? -eq 0 ]] +do + sleep 5 + echo "Forwarding port to 127.0.0.1" + kubectl port-forward service/flotta-operator-controller-manager -n flotta ${HTTP_SERVER_PORT} --address 0.0.0.0 & + export PORT_FORWARD_PID=$! + ps $PORT_FORWARD_PID +done count=0 export CERTS_FOLDER="${test_dir}/certs" DEVICE_ID='default' @@ -448,3 +467,4 @@ log_pods_details run_test log_pods_details collect_results +kill $PORT_FORWARD_PID From 32483461ffea342fd10c315a16c32cfaa5c9ad24 Mon Sep 17 00:00:00 2001 From: gabriel-farache Date: Mon, 25 Apr 2022 14:26:04 +0200 Subject: [PATCH 04/11] Add part providing command to provide an OCP SNO cluster --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index cc4e2e4..74c046e 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,6 @@ Clone https://gitlab.cee.redhat.com/jgil/simple-openshift-cluster-provisioner Run `CLUSTER_NAME= SNO_MASTER_MEMORY= SNO_MASTER_CPU= make create_sno_cluster`. Ex: `CLUSTER_NAME=devicemgmt1 SNO_MASTER_MEMORY=64000 SNO_MASTER_CPU=16 make create_sno_cluster` -## Configure K8S/OCP cluster -Follow https://metallb.universe.tf/installation/ to avoid having to create NodePort service to expose the flotta operator -See https://metallb.universe.tf/configuration/#layer-2-configuration. Use `kubectl get nodes -o` or `oc get nodes -o wide` to get the IP adress. ## Running the test plan Use [./scripts/run_test_plan.sh](./scripts/run_test_plan.sh) to run the test plan. From b0474006cce3c967985fe19941a85eea9748b64e Mon Sep 17 00:00:00 2001 From: root Date: Tue, 26 Apr 2022 10:42:52 +0300 Subject: [PATCH 05/11] Use NodePort service instead of kubect port-forward to expose flotta operator --- scripts/run_test_plan.sh | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/scripts/run_test_plan.sh b/scripts/run_test_plan.sh index 0ea7100..0b0359f 100755 --- a/scripts/run_test_plan.sh +++ b/scripts/run_test_plan.sh @@ -160,8 +160,13 @@ if [[ -z $HTTP_SERVER ]]; then fi if [[ -z $HTTP_SERVER_PORT ]]; then - echo "HTTP port is not specified. Using default value: 80" - HTTP_SERVER_PORT=80 + echo "HTTP port is not specified. Using default value: 3143" + HTTP_SERVER_PORT=3143 +fi + +if [[ $HTTP_SERVER_PORT -lt 30000 ]] || [[ $HTTP_SERVER_PORT -gt 32767 ]]; then + echo "HTTP_SERVER_PORT shall be between 30000 - 32767 to allow NodePort service, given: $HTTP_SERVER_PORT" + exit -1 fi if [[ -z $JMETER_HOME ]]; then @@ -397,28 +402,11 @@ if [[ -n $EXPOSE_PPROF ]]; then }' fi +kubectl patch service flotta-operator-controller-manager -n flotta --type='json' -p "[{\"op\":\"replace\",\"path\":\"/spec/type\",\"value\":\"NodePort\"},{\"op\":\"replace\",\"path\":\"/spec/ports/0/nodePort\",\"value\":${HTTP_SERVER_PORT}}]" + kubectl scale --replicas=$REPLICAS deployment flotta-operator-controller-manager -n flotta kubectl wait --for=condition=available -n flotta deployment.apps/flotta-operator-controller-manager -PORT_FORWARDING_ALREADY_TAKEN=$(ps -eaf | grep "kubectl port-forward service/flotta-operator-controller-manager -n flotta $HTTP_SERVER_PORT --address 0.0.0.0" | wc -l) - -if [ $PORT_FORWARDING_ALREADY_TAKEN -gt 2 ]; then - echo $'\n'"Target port ${HTTP_SERVER_PORT} for port-forward is already taken by another port-forward process" - exit 1 -fi - -echo "Forwarding port to 127.0.0.1" -kubectl port-forward service/flotta-operator-controller-manager -n flotta ${HTTP_SERVER_PORT} --address 0.0.0.0 & -export PORT_FORWARD_PID=$! -ps $PORT_FORWARD_PID -until [[ $? -eq 0 ]] -do - sleep 5 - echo "Forwarding port to 127.0.0.1" - kubectl port-forward service/flotta-operator-controller-manager -n flotta ${HTTP_SERVER_PORT} --address 0.0.0.0 & - export PORT_FORWARD_PID=$! - ps $PORT_FORWARD_PID -done count=0 export CERTS_FOLDER="${test_dir}/certs" DEVICE_ID='default' @@ -467,4 +455,3 @@ log_pods_details run_test log_pods_details collect_results -kill $PORT_FORWARD_PID From 2d66ee95d16efae03b58020dbe0dae0ad327880f Mon Sep 17 00:00:00 2001 From: root Date: Tue, 26 Apr 2022 10:48:09 +0300 Subject: [PATCH 06/11] FIX README link to install SNO cluster --- README.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 74c046e..155d74c 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,13 @@ The purpose of this project is to test the scalability and performance of [project-flotta](https://github.com/project-flotta/flotta-operator) using [JMeter](https://jmeter.apache.org). ## Install OCP SNO cluster -Clone https://gitlab.cee.redhat.com/jgil/simple-openshift-cluster-provisioner -Run `CLUSTER_NAME= SNO_MASTER_MEMORY= SNO_MASTER_CPU= make create_sno_cluster`. +Clone https://github.com/openshift/assisted-test-infra and see https://github.com/openshift/assisted-test-infra#single-node---bootstrap-in-place-with-assisted-service for instructions +Set the KUBECONFIG variable with the path where the kube config file is located. -Ex: `CLUSTER_NAME=devicemgmt1 SNO_MASTER_MEMORY=64000 SNO_MASTER_CPU=16 make create_sno_cluster` +Clone https://github.com/project-flotta/flotta-operator then generate and push docker image to your repository. +Run `TARGET=ocp IMG= make ` to deploy flotta operator to your cluster. + +Add entry to your /etc/hosts file with the IP address of the cluster (`oc get nodes -o wide`) with name project-flotta.io ## Running the test plan Use [./scripts/run_test_plan.sh](./scripts/run_test_plan.sh) to run the test plan. @@ -32,4 +35,4 @@ The [basic test plan](./test_plans/flotta_test_plan.jmx) runs the following scen * In Loop: * Sends heartbeats to the server * Get updates from the server - \ No newline at end of file + From eb91685946bc34b3308706d3a94482e076af68d0 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 28 Apr 2022 16:38:12 +0300 Subject: [PATCH 07/11] Fix and improce --- scripts/request_operator.sh | 4 +++- scripts/run_test_plan.sh | 8 ++++---- scripts/setup.sh | 6 +++--- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/scripts/request_operator.sh b/scripts/request_operator.sh index 94b7a20..06e6ab0 100755 --- a/scripts/request_operator.sh +++ b/scripts/request_operator.sh @@ -1,4 +1,6 @@ #!/bin/bash +#echo "${POST_BODY}" | envsubst > ${ENROL_FOLDER}/${DEVICE_ID}_enrol_payload.json + echo "curl -XPOST \\ --cacert ${CERTS_FOLDER}/default_ca.pem \\ @@ -13,7 +15,7 @@ curl -XPOST \ --cert ${CERTS_FOLDER}/${DEVICE_ID}.pem \ --key ${CERTS_FOLDER}/${DEVICE_ID}.key -v \ -H "Content-Type: application/json" \ - --data ${POST_BODY} \ + --data "${POST_BODY}" \ https://${HTTP_SERVER}:${HTTP_SERVER_PORT}/${REQUEST_PATH} if [ $? -ne 0 ]; then diff --git a/scripts/run_test_plan.sh b/scripts/run_test_plan.sh index 0b0359f..edc6b94 100755 --- a/scripts/run_test_plan.sh +++ b/scripts/run_test_plan.sh @@ -251,9 +251,9 @@ JVM_ARGS="-Xms4g -Xmx64g -Xss250k -XX:MaxMetaspaceSize=1g" $JMETER_HOME/bin/jmet -JTEST_DIR=$test_dir \ -JSCRIPTS_DIR=$SCRIPT_DIR \ -JCERTS_FOLDER=$CERTS_FOLDER \ - -JREGISTRATION_FOLDER="${logs_dir}/registration" \ - -JGET_UPDATES_FOLDER="${logs_dir}/get_updates" \ - -JHEARTBEAT_FOLDER="${logs_dir}/heartbeat" \ + -JREGISTRATION_FOLDER="${SCRIPT_DIR}/test-run-${TEST_ID}/logs/registration" \ + -JGET_UPDATES_FOLDER="${SCRIPT_DIR}/test-run-${TEST_ID}/logs/get_updates" \ + -JHEARTBEAT_FOLDER="${SCRIPT_DIR}/test-run-${TEST_ID}/logs/heartbeat" \ -JNAMESPACES_COUNT=$NAMESPACES_COUNT|& tee -a $test_dir/summary.txt } @@ -449,7 +449,7 @@ kubectl top pods -n flotta --use-protocol-buffers parse_args "$@" log_run_details -sh setup +sh setup.sh patch_flotta_operator log_pods_details run_test diff --git a/scripts/setup.sh b/scripts/setup.sh index b68ee09..b8ce819 100755 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -6,11 +6,11 @@ sysctl -w net.ipv4.tcp_fin_timeout=10 sysctl -w vm.max_map_count=999999 sysctl -w kernel.threads-max=4113992 -if [ -z $(grep "* soft nofile 999999" "/etc/security/limits.conf") ]; then +if [[ -z $(grep "* soft nofile 999999" "/etc/security/limits.conf") ]]; then cat "* soft nofile 999999" >> /etc/security/limits.conf fi -if [ -z $(grep "* hard nofile 999999" "/etc/security/limits.conf") ]; then +if [[ -z $(grep "* hard nofile 999999" "/etc/security/limits.conf") ]]; then cat "* hard nofile 999999" >> /etc/security/limits.conf fi @@ -19,4 +19,4 @@ ifconfig br-ex txqueuelen 5000 ifconfig cni-podman0 txqueuelen 5000 ifconfig ens3 txqueuelen 5000 ifconfig ens4 txqueuelen 5000 -ifconfig ovn-k8s-mp0 txqueuelen 5000 \ No newline at end of file +ifconfig ovn-k8s-mp0 txqueuelen 5000 From 2dcc65c9337eae74e471ef1271fd01f8ea970952 Mon Sep 17 00:00:00 2001 From: gabriel-farache Date: Thu, 28 Apr 2022 15:41:04 +0200 Subject: [PATCH 08/11] Check http status --- scripts/request_operator.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/request_operator.sh b/scripts/request_operator.sh index 06e6ab0..e264c4c 100755 --- a/scripts/request_operator.sh +++ b/scripts/request_operator.sh @@ -7,16 +7,16 @@ echo "curl -XPOST \\ --cert ${CERTS_FOLDER}/${DEVICE_ID}.pem \\ --key ${CERTS_FOLDER}/${DEVICE_ID}.key -v \\ -H \"Content-Type: application/json\" \\ - --data ${POST_BODY} \\ - https://${HTTP_SERVER}:${HTTP_SERVER_PORT}/${REQUEST_PATH}" + --data \"${POST_BODY}\" \\ + https://${HTTP_SERVER}:${HTTP_SERVER_PORT}/${REQUEST_PATH} | grep \"200 OK\"" curl -XPOST \ --cacert ${CERTS_FOLDER}/default_ca.pem \ --cert ${CERTS_FOLDER}/${DEVICE_ID}.pem \ --key ${CERTS_FOLDER}/${DEVICE_ID}.key -v \ -H "Content-Type: application/json" \ - --data "${POST_BODY}" \ - https://${HTTP_SERVER}:${HTTP_SERVER_PORT}/${REQUEST_PATH} + --data "${POST_BODY}" -i \ + https://${HTTP_SERVER}:${HTTP_SERVER_PORT}/${REQUEST_PATH} | grep "200 OK" if [ $? -ne 0 ]; then echo "Error posting device" From 6342a21fa6ff8249aa7734651541438d62eae0de Mon Sep 17 00:00:00 2001 From: gabriel-farache Date: Thu, 28 Apr 2022 15:41:32 +0200 Subject: [PATCH 09/11] Add enrol --- scripts/enrol_device.sh | 49 +++++++ scripts/run_test_plan.sh | 1 + test_plans/flotta_test_plan.jmx | 235 +++++++++++++++++++++++++------- 3 files changed, 233 insertions(+), 52 deletions(-) create mode 100644 scripts/enrol_device.sh diff --git a/scripts/enrol_device.sh b/scripts/enrol_device.sh new file mode 100644 index 0000000..62bb44d --- /dev/null +++ b/scripts/enrol_device.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +echo "${PAYLOAD}" | envsubst > ${ENROL_FOLDER}/${DEVICE_ID}_enrol_payload.json + +#Verify! +cat ${ENROL_FOLDER}/${DEVICE_ID}_enrol_payload.json | jq . + +if [ $? -ne 0 ]; then + echo "Error when checking ${ENROL_FOLDER}/${DEVICE_ID}_enrol_payload.json" + exit -1 +fi +echo "curl \ + --cacert ${CERTS_FOLDER}/default_ca.pem \\ + --cert ${CERTS_FOLDER}/default_cert.pem \\ + --key ${CERTS_FOLDER}/default_key.pem -v \\ + -d @${ENROL_FOLDER}/${DEVICE_ID}_enrol_payload.json \\ + -X POST \\ + -H \"Content-Type: application/json\" \ + -i \\ + https://${HTTP_SERVER}:${HTTP_SERVER_PORT}/api/flotta-management/v1/data/${DEVICE_ID}/out > ${ENROL_FOLDER}/${DEVICE_ID}_enrol_response.json" + +curl \ + --cacert ${CERTS_FOLDER}/default_ca.pem \ + --cert ${CERTS_FOLDER}/default_cert.pem \ + --key ${CERTS_FOLDER}/default_key.pem -v \ + -d @${ENROL_FOLDER}/${DEVICE_ID}_enrol_payload.json \ + -X POST \ + -H "Content-Type: application/json" \ + -i \ + https://${HTTP_SERVER}:${HTTP_SERVER_PORT}/api/flotta-management/v1/data/${DEVICE_ID}/out > ${ENROL_FOLDER}/${DEVICE_ID}_enrol_response.json + +if [ $? -ne 0 ]; then + echo "Error when sending enrol request, see ${ENROL_FOLDER}/${DEVICE_ID}_enrol.out" + exit -1 +fi + +cat ${ENROL_FOLDER}/${DEVICE_ID}_enrol_response.json | grep 208 > /dev/null +if [ $? -eq 0 ]; then + echo "Device ${DEVICE_ID} already enroled" + exit -1 +else + cat ${ENROL_FOLDER}/${DEVICE_ID}_enrol_response.json | grep 200 > /dev/null + if [ $? -ne 0 ]; then + echo "Error when sending enrol request, see ${ENROL_FOLDER}/${DEVICE_ID}_enrol_response.json" + exit -1 + fi +fi + +exit 0 \ No newline at end of file diff --git a/scripts/run_test_plan.sh b/scripts/run_test_plan.sh index edc6b94..b28b198 100755 --- a/scripts/run_test_plan.sh +++ b/scripts/run_test_plan.sh @@ -254,6 +254,7 @@ JVM_ARGS="-Xms4g -Xmx64g -Xss250k -XX:MaxMetaspaceSize=1g" $JMETER_HOME/bin/jmet -JREGISTRATION_FOLDER="${SCRIPT_DIR}/test-run-${TEST_ID}/logs/registration" \ -JGET_UPDATES_FOLDER="${SCRIPT_DIR}/test-run-${TEST_ID}/logs/get_updates" \ -JHEARTBEAT_FOLDER="${SCRIPT_DIR}/test-run-${TEST_ID}/logs/heartbeat" \ + -JENROL_FOLDER="${logs_dir}/enrol" \ -JNAMESPACES_COUNT=$NAMESPACES_COUNT|& tee -a $test_dir/summary.txt } diff --git a/test_plans/flotta_test_plan.jmx b/test_plans/flotta_test_plan.jmx index a0fba88..2f6a175 100644 --- a/test_plans/flotta_test_plan.jmx +++ b/test_plans/flotta_test_plan.jmx @@ -34,9 +34,10 @@ GET_UPDATES_FOLDER HEARTBEAT_FOLDER CERTS_FOLDER + ENROL_FOLDER - + ${__P(HTTP_SERVER,flotta-operator-controller-manager-flotta-operator-system.apps.mycluster.redhat.com)} ${__P(HTTP_SERVER_PORT,80)} ${__P(OCP_API_SERVER,api.mycluster.redhat.com)} @@ -50,7 +51,8 @@ ${__P(REGISTRATION_FOLDER,./registration)} ${__P(GET_UPDATES_FOLDER,./get_updates)} ${__P(HEARTBEAT_FOLDER,./heartbeat)} - ${__P(CERTS_FOLDER,./certs)} + ${__P(CERTS_FOLDER,./certs)} + ${__P(ENROL_FOLDER,./enrol)} false @@ -70,52 +72,7 @@ true - - true - 0 - /bin/bash - - - - - -c - = - - - - ${SCRIPTS_DIR}/create_output_streams.sh - = - - - - - - - REGISTRATION_FOLDER - ${REGISTRATION_FOLDER} - = - - - GET_UPDATES_FOLDER - ${GET_UPDATES_FOLDER} - = - - - HEARTBEAT_FOLDER - ${HEARTBEAT_FOLDER} - = - - - DEVICE_ID - ${DEVICE_ID} - = - - - - - - - + @@ -140,6 +97,180 @@ The device ID to be used for the entire scenario of a specific device and additional device properties + + true + 0 + /bin/bash + + + + + -c + = + + + + ${SCRIPTS_DIR}/create_output_streams.sh + = + + + + + + + REGISTRATION_FOLDER + ${REGISTRATION_FOLDER} + = + + + GET_UPDATES_FOLDER + ${GET_UPDATES_FOLDER} + = + + + HEARTBEAT_FOLDER + ${HEARTBEAT_FOLDER} + = + + + DEVICE_ID + ${DEVICE_ID} + = + + + ENROL_FOLDER + ${ENROL_FOLDER} + = + + + + + + + + true + 0 + /bin/bash + + + + + -c + = + + + + ${SCRIPTS_DIR}/enrol_device.sh + = + + + + + + + DEVICE_ID + ${DEVICE_ID} + = + + + HTTP_SERVER + ${HTTP_SERVER} + = + + + HTTP_SERVER_PORT + ${HTTP_SERVER_PORT} + = + + + PRODUCT_NAME + ${PRODUCT_NAME} + = + + + SERIAL_NAME + ${SERIAL_NAME} + = + + + PAYLOAD + { "content": { "target_namespace": "flotta", "features": { "hardware": { "cpu": { "architecture": "x86_64", "flags": [], "model_name": "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz" }, "hostname": "fedora", "system_vendor": { "manufacturer": "LENOVO", "product_name": "${PRODUCT_NAME}", "serial_number": "${SERIAL_NAME}" } }, "os_image_id": "unknown" } }, "directive": "enrolment", "message_id": "${__UUID()}", "sent": "2021-11-21T14:45:25.271+02:00", "type": "data", "version": 1 } + = + + + ENROL_FOLDER + ${ENROL_FOLDER} + = + + + CERTS_FOLDER + ${CERTS_FOLDER} + = + + + + + ${ENROL_FOLDER}/${DEVICE_ID}_register.out + ${ENROL_FOLDER}/${DEVICE_ID}_register.err + + + + true + + + + false + { + "spec": { + "approved": true + } +} + = + + + + ${OCP_API_SERVER} + ${OCP_API_PORT} + https + UTF-8 + /apis/management.project-flotta.io/v1alpha1/namespaces/default/edgedevicesignedrequest/${DEVICE_ID} + PATCH + true + false + true + false + + HttpClient4 + + + Approve device enrolment + + + + + + Content-Type + application/merge-patch+json + + + Cache-Control + no-cache + + + Authorization + Bearer ${__P(K8S_BEARER_TOKEN)} + + + + + + false + true + true + false + + + true 0 @@ -588,10 +719,10 @@ = - CERTS_FOLDER - ${CERTS_FOLDER} - = - + CERTS_FOLDER + ${CERTS_FOLDER} + = + From 99b459741cfb7d61a95d9e90b762f8bbe06d2cde Mon Sep 17 00:00:00 2001 From: gabriel-farache Date: Thu, 28 Apr 2022 15:45:46 +0200 Subject: [PATCH 10/11] Fix typo --- scripts/register_device.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/register_device.sh b/scripts/register_device.sh index 0f417be..109ab01 100755 --- a/scripts/register_device.sh +++ b/scripts/register_device.sh @@ -33,7 +33,7 @@ curl \ -o ${REGISTRATION_FOLDER}/${DEVICE_ID}_response.json \ https://${HTTP_SERVER}:${HTTP_SERVER_PORT}/api/flotta-management/v1/data/${DEVICE_ID}/out if [ $? -ne 0 ]; then - echo "Error when sending registration request, see ${REGISTRATION_FOLDER_dir}/${DEVICE_ID}_register.out" + echo "Error when sending registration request, see ${REGISTRATION_FOLDER}/${DEVICE_ID}_register.out" exit -1 fi From 1f5735590a4511d49cdaad1a3e5301adb4ed09c6 Mon Sep 17 00:00:00 2001 From: gabriel-farache Date: Thu, 28 Apr 2022 15:48:07 +0200 Subject: [PATCH 11/11] Add script to generate devices and workload and check it --- generate_devices_and_workload.sh | 187 +++++++++++++++++++++++++++++++ 1 file changed, 187 insertions(+) create mode 100755 generate_devices_and_workload.sh diff --git a/generate_devices_and_workload.sh b/generate_devices_and_workload.sh new file mode 100755 index 0000000..62c8a81 --- /dev/null +++ b/generate_devices_and_workload.sh @@ -0,0 +1,187 @@ +#!/bin/bash +NB_DEVICES=$1 +SCRIPT=$(readlink -f "$0") +export SCRIPT_DIR=$(dirname "$SCRIPT") +export CERTS_FOLDER=${SCRIPT_DIR}/certs +export REGISTRATION_FOLDER=${SCRIPT_DIR}/logs/registration +export ENROL_FOLDER=${SCRIPT_DIR}/logs/enrol +rm -rf ${SCRIPT_DIR}/logs $CERTS_FOLDER +mkdir -p $REGISTRATION_FOLDER +mkdir -p $ENROL_FOLDER +mkdir -p $CERTS_FOLDER +export HTTP_SERVER=127.0.0.1 +export HTTP_SERVER_PORT=8043 +for p in $(kubectl -n flotta-test get edgedevices --no-headers | awk '{print $1}'); do kubectl -n flotta-test patch edgedevices $p -p '{"metadata":{"finalizers":null}}' --type=merge >/dev/null; done + +kubectl delete namespace flotta-test +kubectl create namespace flotta-test + +BASE_SERIAL=$(uuidgen) +for i in $(seq 1 $NB_DEVICES); do + DEVICE_ID=$(uuidgen) + PAYLOAD='{ + "content": { + "target_namespace": "flotta-test", + "features": { + "hardware": { + "cpu": { + "architecture": "x86_64", + "flags": [], + "model_name": "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz" + }, + "hostname": "fedora", + "system_vendor": { + "manufacturer": "LENOVO", + "product_name": "azerty'$(expr $i % 2)'", + "serial_number": "'${BASE_SERIAL}_${i}'" + } + }, + "os_image_id": "unknown" + + } + }, + "directive": "enrolment", + "message_id": "${__UUID()}", + "sent": "2021-11-21T14:45:25.271+02:00", + "type": "data", + "version": 1 + + }' + DEVICE_ID=default CERTS_FOLDER=$CERTS_FOLDER sh scripts/generate_certs.sh >> $CERTS_FOLDER/logs.out 2>> $CERTS_FOLDER/logs.err + + DEVICE_ID=$DEVICE_ID PAYLOAD=$PAYLOAD sh scripts/enrol_device.sh >> $ENROL_FOLDER/logs.out 2>> $ENROL_FOLDER/logs.err + + + ## Registration + + PAYLOAD='{ + "content": { + "hardware": { + "cpu": { + "architecture": "x86_64", + "flags": [], + "model_name": "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz" + }, + "hostname": "fedora", + "system_vendor": { + "manufacturer": "LENOVO", + "product_name": "azerty'$(expr $i % 2)'", + "serial_number": "'${BASE_SERIAL}_${i}'" + } + }, + "os_image_id": "unknown" + }, + "directive": "registration", + "message_id": "'$(uuidgen)'", + "sent": "2021-11-21T14:45:25.271+02:00", + "type": "data", + "version": 1 + + }' + + DEVICE_ID=$DEVICE_ID PAYLOAD=$PAYLOAD sh scripts/register_device.sh >> $REGISTRATION_FOLDER/logs.out 2>> $REGISTRATION_FOLDER/logs.err +done +SELECTOR_ALL="device.system-manufacturer: lenovo" +SELECTOR_ODD="device.system-product: azerty1" +SELECTOR_PAIR="device.system-product: azerty0" +SELECTOR_UNIQUE="device.system-serial: ${BASE_SERIAL}_1" + +# A pretend Python dictionary with bash 3 +WORKLOADS_SELECTOR=( "all:$SELECTOR_ALL" + "odd:$SELECTOR_ODD" + "pair:$SELECTOR_PAIR" + "unique:$SELECTOR_UNIQUE" ) + +for WORKLOAD_SELECTOR in "${WORKLOADS_SELECTOR[@]}" ; do + SELECTOR_NAME=${WORKLOAD_SELECTOR%%:*} + SELECTOR=${WORKLOAD_SELECTOR#*:} + printf "%s apply %s.\n" "$SELECTOR_NAME" "$SELECTOR" + WORKLOAD=" +apiVersion: management.project-flotta.io/v1alpha1 +kind: EdgeWorkload +metadata: + name: edgeworkload-sample-${SELECTOR_NAME} + namespace: flotta-test +spec: + deviceSelector: + matchLabels: + $SELECTOR + data: + paths: + - source: . + target: nginx + type: pod + pod: + spec: + containers: + - name: nginx + image: docker.io/nginx:1.14.2 + ports: + - containerPort: 80 + hostPort: 9090 +" + echo "$WORKLOAD" | kubectl apply -f - > /dev/null +done +echo "==================" +if [[ $NB_DEVICES -lt 2 ]]; then + echo "!!! Warn: Amount of device the create is $NB_DEVICES which is lower than 2, tests checking the expected amount of devices matching a workload will fail" +fi +echo -n "Checking if workloads are correctly depoloyed on devices..." + +NB_ODD_EXPTECTED=$(expr $NB_DEVICES / 2) +NB_PAIR_EXPTECTED=$(expr $NB_DEVICES - $NB_ODD_EXPTECTED) +NB_ALL_DEVICES=0 +NB_ODD_DEVICES=0 +NB_PAIR_DEVICES=0 +NB_UNIQUE_DEVICES=0 + +for DEVICE in $(kubectl -n flotta-test get edgedevice --no-headers | awk '{print $1}') +do + kubectl -n flotta-test get edgedevices $DEVICE -o yaml | grep "name: edgeworkload-sample-all" > /dev/null + if [[ $? -ne 0 ]]; then + echo $'\n'"Error: $DEVICE should have workload edgeworkload-sample-all but has not" + else + let "NB_ALL_DEVICES++" + fi +done +if [[ $NB_ALL_DEVICES -ne $NB_DEVICES ]]; then + echo $'\n'"Error: edgeworkload-sample-all is not apply to all devices created: should be $NB_DEVICES get $NB_ALL_DEVICES" +fi + +for ODD_DEVICE in $(kubectl -n flotta-test get edgedevice -l device.system-product=azerty1 --no-headers | awk '{print $1}'); do + kubectl -n flotta-test get edgedevices $ODD_DEVICE -o yaml | grep "name: edgeworkload-sample-odd" > /dev/null + if [[ $? -ne 0 ]]; then + echo $'\n'"Error: $ODD_DEVICE should have workload edgeworkload-sample-odd but has not" + else + let "NB_ODD_DEVICES++" + fi +done +if [[ $NB_ODD_DEVICES -ne $NB_ODD_EXPTECTED ]]; then + echo $'\n'"Error: edgeworkload-sample-odd is not apply to all devices created: should be $NB_ODD_EXPTECTED get $NB_ODD_DEVICES" +fi + +for PAIR_DEVICE in $(kubectl -n flotta-test get edgedevice -l device.system-product=azerty0 --no-headers | awk '{print $1}'); do + kubectl -n flotta-test get edgedevices $PAIR_DEVICE -o yaml | grep "name: edgeworkload-sample-pair" > /dev/null + if [[ $? -ne 0 ]]; then + echo $'\n'"Error: $PAIR_DEVICE should have workload edgeworkload-sample-pair but has not" + else + let "NB_PAIR_DEVICES++" + fi +done +if [[ $NB_PAIR_DEVICES -ne $NB_PAIR_EXPTECTED ]]; then + echo $'\n'"Error: edgeworkload-sample-pair is not apply to all devices created: should be $NB_PAIR_EXPTECTED get $NB_PAIR_DEVICES" +fi + +for UNIQUE_DEVICE in $(kubectl -n flotta-test get edgedevice -l device.system-serial=${BASE_SERIAL}_1 --no-headers | awk '{print $1}'); do + kubectl -n flotta-test get edgedevices $UNIQUE_DEVICE -o yaml | grep "name: edgeworkload-sample-unique" > /dev/null + if [[ $? -ne 0 ]]; then + echo $'\n'"Error: $UNIQUE_DEVICE should have workload edgeworkload-sample-unique but has not" + else + let "NB_UNIQUE_DEVICES++" + fi +done +if [[ $NB_UNIQUE_DEVICES -ne 1 ]]; then + echo "Error: edgeworkload-sample-unique is not apply to all devices created: should be 1 get $NB_UNIQUE_DEVICES" +fi + +echo "Done" \ No newline at end of file