-
Notifications
You must be signed in to change notification settings - Fork 160
/
broker.feature
57 lines (55 loc) · 3.21 KB
/
broker.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
###############################################################################
# Copyright (c) 2019, 2020 Eurotech and/or its affiliates and others
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# Eurotech - initial API and implementation
###############################################################################
@docker
Feature: Testing docker steps
Test that documents functionality of docker steps.
Scenario: Execute possible docker steps to show its usage
For now it only lists docker images
Given List images by name "kapua/kapua-broker:1.3.1-SNAPSHOT"
#And Pull image "kapua/kapua-sql:1.3.1-SNAPSHOT"
And Pull image "elasticsearch:5.4.0"
Then Create network
And Start DB container with name "db"
And Start ES container with name "es"
And Start EventBroker container with name "events-broker"
Then I wait 15 seconds
And Start Message Broker container
| name | brokerAddress | brokerIp | clusterName | mqttPort | mqttHostPort | mqttsPort | mqttsHostPort | webPort | webHostPort | debugPort | debugHostPort | brokerInternalDebugPort| dockerImage |
| broker-1 | broker1 | 0.0.0.0 | test-cluster | 1883 | 1883 | 8883 | 8883 | 8161 | 8161 | 9999 | 9999 | 9991 | kapua/kapua-broker:1.3.1-SNAPSHOT |
And Start Message Broker container
| name | brokerAddress | brokerIp | clusterName | mqttPort | mqttHostPort | mqttsPort | mqttsHostPort | webPort | webHostPort | debugPort | debugHostPort | brokerInternalDebugPort| dockerImage |
| broker-2 | broker2 | 0.0.0.0 | test-cluster | 1883 | 1884 | 8883 | 8884 | 8161 | 8162 | 9999 | 9998 | 9991 | kapua/kapua-broker:1.3.1-SNAPSHOT |
Then I wait 30 seconds
And Create mqtt "client-1" client for broker "0.0.0.0" on port 1883 with user "kapua-sys" and pass "kapua-password"
And Connect to mqtt client "client-1"
And Subscribe mqtt client "client-1" to topic "#"
And Create mqtt "client-2" client for broker "0.0.0.0" on port 1884 with user "kapua-sys" and pass "kapua-password"
And Connect to mqtt client "client-2"
And Subscribe mqtt client "client-2" to topic "#"
And Publish string "foo" to topic "$EDC/kapua-sys/kapua-sys/topic/1" as client "client-1"
And I wait 5 seconds
Then Client "client-1" has 1 message
# Uncomment this step to prove broker cluster is working.
#And Client "client-2" has 1 message
And Disconnect mqtt client "client-1"
And I wait 15 seconds
Then Stop container with name "broker-2"
And Remove container with name "broker-2"
And Stop container with name "broker-1"
And Remove container with name "broker-1"
And Stop container with name "events-broker"
And Remove container with name "events-broker"
And Stop container with name "es"
And Remove container with name "es"
And Stop container with name "db"
And Remove container with name "db"
And Remove network