[ROBOT] Clean up 5gbulkpm
[testsuite.git] / robot / resources / strimzi_kafka.robot
1 *** Settings ***
2 Documentation    Template for interfacing with strimzi kafka.
3 Library    OperatingSystem
4 Library    RequestsLibrary
5 Library    BuiltIn
6 Library    Collections
7 Library    ONAPLibrary.Utilities
8 Library    String
9 Library    ONAPLibrary.Kafka
10
11 *** Variables ***
12 ${KAFKA_GET_PASSWORD}      kubectl -n onap get secret strimzi-kafka-admin -o jsonpath="{.data.password}" | base64 -d
13
14 *** Keywords ***
15 Get Last Message From Topic
16     [Documentation]     Decode last message from Kafka topic.
17     [Arguments]     ${kafka_server}   ${kafka_topic}    ${username}
18     ${command_output} =                 Run And Return Rc And Output        ${KAFKA_GET_PASSWORD}
19     Should Be Equal As Integers         ${command_output[0]}                0
20     ${password}   Set Variable  ${command_output[1]}
21     Connect    kafka    ${kafka_server}    ${username}    ${password}   SCRAM-SHA-512
22     ${msg}=     Consume    kafka    ${kafka_topic}
23     [Return]    ${msg}