forked from RedHatInsights/insights-behavioral-spec
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BDD test added for compression in sha extractro
- Loading branch information
Jakub Drobena
committed
Feb 13, 2024
1 parent
b95f541
commit d0dc8ef
Showing
8 changed files
with
194 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
plugins: | ||
packages: | ||
- insights.specs.default | ||
- pythonjsonlogger | ||
- pythonjsonlogger.jsonlogger | ||
configs: | ||
- name: ccx_ocp_core.config.telemeter.TelemeterServiceConfig | ||
enabled: false | ||
service: | ||
extract_timeout: | ||
extract_tmp_dir: | ||
format: insights.formats._json.JsonFormat | ||
target_components: [] | ||
consumer: | ||
name: ccx_messaging.consumers.kafka_consumer.KafkaConsumer | ||
kwargs: | ||
incoming_topic: platform.upload.announce | ||
dead_letter_queue_topic: dead.letter.queue | ||
platform_service: testareno | ||
processing_timeout_s: 0 | ||
group.id: ${CDP_GROUP_ID:insights_sha_extractor_app} | ||
bootstrap.servers: kafka:9092 | ||
security.protocol: PLAINTEXT | ||
max.poll.interval.ms: 30000 | ||
heartbeat.interval.ms: 50000 | ||
session.timeout.ms: 10000 | ||
auto.offset.reset: earliest | ||
downloader: | ||
name: ccx_messaging.downloaders.http_downloader.HTTPDownloader | ||
kwargs: | ||
max_archive_size: 100 MiB | ||
allow_unsafe_links: true | ||
engine: | ||
name: ccx_messaging.engines.sha_extractor_engine.SHAExtractorEngine | ||
kwargs: | ||
extract_timeout: 10 | ||
publisher: | ||
name: ccx_messaging.publishers.workloads_info_publisher.WorkloadInfoPublisher | ||
kwargs: | ||
outgoing_topic: archive-results | ||
bootstrap.servers: kafka:9092 | ||
compression: gzip | ||
|
||
logging: | ||
version: 1 | ||
disable_existing_loggers: false | ||
handlers: | ||
default: | ||
level: DEBUG | ||
class: logging.StreamHandler | ||
stream: ext://sys.stdout | ||
formatter: json | ||
formatters: | ||
brief: | ||
format: "%(message)s" | ||
json: | ||
(): "pythonjsonlogger.jsonlogger.JsonFormatter" | ||
format: "%(filename)s %(lineno)d %(process)d %(levelname)s %(asctime)s %(name)s %(message)s" | ||
cloudwatch: | ||
format: "%(filename)s %(levelname)s %(asctime)s %(name)s %(hostname)s %(mac_address)s %(message)s" | ||
root: | ||
handlers: | ||
- default | ||
loggers: | ||
insights_messaging: | ||
level: DEBUG | ||
ccx_messaging: | ||
level: DEBUG | ||
insights: | ||
level: WARNING | ||
insights_sha_extractor: | ||
level: DEBUG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
@sha_extractor | ||
|
||
|
||
Feature: SHA Extractor | ||
|
||
|
||
Background: | ||
Given Kafka broker is started on host and port specified in configuration "compressed" | ||
And Kafka topic specified in configuration variable "incoming_topic" is created | ||
And Kafka topic specified in configuration variable "dead_letter_queue_topic" is created | ||
And Kafka topic specified in configuration variable "outgoing_topic" is created | ||
|
||
|
||
Scenario: Check that SHA extractor service has all the information and interfaces it needs to work properly | ||
Given SHA extractor service is not started | ||
When SHA extractor service is started in group "check_info" | ||
Then SHA extractor service does not exit with an error code | ||
And SHA extractor service should be registered to topic "incoming_topic" | ||
|
||
Scenario: Check if SHA extractor compresion works properly | ||
Given SHA extractor service is started with compresion | ||
When S3 and Kafka are populated with an archive with workload_info | ||
Then SHA extractor should consume message about this event | ||
And this message should contain following attributes | ||
| Attribute | Description | Type | | ||
| account | account ID | unsigned int | | ||
| principal | principal ID | unsigned int | | ||
| size | tarball size | unsigned int | | ||
| url | URL to S3 | string | | ||
| b64_identity | identity encoded by BASE64 | string | | ||
| timestamp | timestamp of event | string | | ||
Then SHA extractor retrieve the "url" attribute from the message | ||
And SHA extractor should download tarball from given URL attribute | ||
When the file "config/workload_info.json" is found | ||
Then the content of this file needs to be sent into topic "archive_results" | ||
When compresion is enabled | ||
Then Published message have to be compressed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
../features/SHA_Extractor/sha_extractor.feature | ||
../features/SHA_Extractor/sha_extractor.feature | ||
../features/SHA_Extractor/sha_extractor_compressed.feature |