-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integration tests for MQTT topic parameters with guarded identity
- Loading branch information
Showing
36 changed files
with
1,458 additions
and
0 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
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
48 changes: 48 additions & 0 deletions
48
...rc/main/scripts/io/aklivity/zilla/specs/binding/mqtt/config/server.when.topic.params.yaml
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,48 @@ | ||
# | ||
# Copyright 2021-2024 Aklivity Inc. | ||
# | ||
# Aklivity licenses this file to you under the Apache License, | ||
# version 2.0 (the "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at: | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
|
||
--- | ||
name: test | ||
guards: | ||
test0: | ||
type: test | ||
options: | ||
credentials: TOKEN | ||
lifetime: PT5S | ||
challenge: PT5S | ||
bindings: | ||
net0: | ||
type: mqtt | ||
kind: server | ||
options: | ||
authorization: | ||
test0: | ||
credentials: | ||
connect: | ||
username: Bearer {credentials} | ||
routes: | ||
- exit: app0 | ||
guarded: | ||
test0: [] | ||
when: | ||
- publish: | ||
- topic: device/{id}/data | ||
params: | ||
id: ${guarded['test0'].identity} | ||
- subscribe: | ||
- topic: sensor/{id}/data | ||
params: | ||
id: ${guarded['test0'].identity} |
46 changes: 46 additions & 0 deletions
46
.../binding/mqtt/streams/application/publish.invalid.topic.guarded.identity.param/client.rpt
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,46 @@ | ||
# | ||
# Copyright 2021-2024 Aklivity Inc. | ||
# | ||
# Aklivity licenses this file to you under the Apache License, | ||
# version 2.0 (the "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at: | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
|
||
connect "zilla://streams/app0" | ||
option zilla:window 8192 | ||
option zilla:transmission "duplex" | ||
option zilla:authorization 1L | ||
|
||
write zilla:begin.ext ${mqtt:beginEx() | ||
.typeId(zilla:id("mqtt")) | ||
.session() | ||
.flags("CLEAN_START") | ||
.clientId("client") | ||
.build() | ||
.build()} | ||
|
||
read zilla:begin.ext ${mqtt:matchBeginEx() | ||
.typeId(zilla:id("mqtt")) | ||
.session() | ||
.flags("CLEAN_START") | ||
.subscribeQosMax(2) | ||
.publishQosMax(2) | ||
.packetSizeMax(66560) | ||
.capabilities("RETAIN", "WILDCARD", "SUBSCRIPTION_IDS", "SHARED_SUBSCRIPTIONS") | ||
.clientId("client") | ||
.build() | ||
.build()} | ||
|
||
connected | ||
|
||
read zilla:data.empty | ||
|
||
write abort |
49 changes: 49 additions & 0 deletions
49
.../binding/mqtt/streams/application/publish.invalid.topic.guarded.identity.param/server.rpt
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,49 @@ | ||
# | ||
# Copyright 2021-2024 Aklivity Inc. | ||
# | ||
# Aklivity licenses this file to you under the Apache License, | ||
# version 2.0 (the "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at: | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
|
||
accept "zilla://streams/app0" | ||
option zilla:window 8192 | ||
option zilla:transmission "duplex" | ||
option zilla:authorization 1L | ||
|
||
accepted | ||
|
||
read zilla:begin.ext ${mqtt:matchBeginEx() | ||
.typeId(zilla:id("mqtt")) | ||
.session() | ||
.flags("CLEAN_START") | ||
.clientId("client") | ||
.build() | ||
.build()} | ||
|
||
write zilla:begin.ext ${mqtt:beginEx() | ||
.typeId(zilla:id("mqtt")) | ||
.session() | ||
.flags("CLEAN_START") | ||
.subscribeQosMax(2) | ||
.publishQosMax(2) | ||
.packetSizeMax(66560) | ||
.capabilities("RETAIN", "WILDCARD", "SUBSCRIPTION_IDS", "SHARED_SUBSCRIPTIONS") | ||
.clientId("client") | ||
.build() | ||
.build()} | ||
|
||
connected | ||
|
||
write zilla:data.empty | ||
write flush | ||
|
||
read aborted |
70 changes: 70 additions & 0 deletions
70
...la/specs/binding/mqtt/streams/application/publish.topic.guarded.identity.param/client.rpt
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,70 @@ | ||
# | ||
# Copyright 2021-2024 Aklivity Inc. | ||
# | ||
# Aklivity licenses this file to you under the Apache License, | ||
# version 2.0 (the "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at: | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
|
||
connect "zilla://streams/app0" | ||
option zilla:window 8192 | ||
option zilla:transmission "duplex" | ||
option zilla:authorization 1L | ||
|
||
write zilla:begin.ext ${mqtt:beginEx() | ||
.typeId(zilla:id("mqtt")) | ||
.session() | ||
.flags("CLEAN_START") | ||
.clientId("client") | ||
.build() | ||
.build()} | ||
|
||
read zilla:begin.ext ${mqtt:matchBeginEx() | ||
.typeId(zilla:id("mqtt")) | ||
.session() | ||
.flags("CLEAN_START") | ||
.subscribeQosMax(2) | ||
.publishQosMax(2) | ||
.packetSizeMax(66560) | ||
.capabilities("RETAIN", "WILDCARD", "SUBSCRIPTION_IDS", "SHARED_SUBSCRIPTIONS") | ||
.clientId("client") | ||
.build() | ||
.build()} | ||
|
||
connected | ||
|
||
read zilla:data.empty | ||
read notify RECEIVED_SESSION_STATE | ||
|
||
|
||
connect await RECEIVED_SESSION_STATE | ||
"zilla://streams/app0" | ||
option zilla:window 8192 | ||
option zilla:transmission "duplex" | ||
option zilla:authorization 1L | ||
|
||
write zilla:begin.ext ${mqtt:beginEx() | ||
.typeId(zilla:id("mqtt")) | ||
.publish() | ||
.clientId("client") | ||
.topic("device/test/data") | ||
.build() | ||
.build()} | ||
|
||
connected | ||
|
||
write zilla:data.ext ${mqtt:dataEx() | ||
.typeId(zilla:id("mqtt")) | ||
.publish() | ||
.build() | ||
.build()} | ||
|
||
write "message" |
67 changes: 67 additions & 0 deletions
67
...la/specs/binding/mqtt/streams/application/publish.topic.guarded.identity.param/server.rpt
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,67 @@ | ||
# | ||
# Copyright 2021-2024 Aklivity Inc. | ||
# | ||
# Aklivity licenses this file to you under the Apache License, | ||
# version 2.0 (the "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at: | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
|
||
accept "zilla://streams/app0" | ||
option zilla:window 8192 | ||
option zilla:transmission "duplex" | ||
option zilla:authorization 1L | ||
|
||
accepted | ||
|
||
read zilla:begin.ext ${mqtt:matchBeginEx() | ||
.typeId(zilla:id("mqtt")) | ||
.session() | ||
.flags("CLEAN_START") | ||
.clientId("client") | ||
.build() | ||
.build()} | ||
|
||
write zilla:begin.ext ${mqtt:beginEx() | ||
.typeId(zilla:id("mqtt")) | ||
.session() | ||
.flags("CLEAN_START") | ||
.subscribeQosMax(2) | ||
.publishQosMax(2) | ||
.packetSizeMax(66560) | ||
.capabilities("RETAIN", "WILDCARD", "SUBSCRIPTION_IDS", "SHARED_SUBSCRIPTIONS") | ||
.clientId("client") | ||
.build() | ||
.build()} | ||
|
||
connected | ||
|
||
write zilla:data.empty | ||
write flush | ||
|
||
accepted | ||
|
||
read zilla:begin.ext ${mqtt:matchBeginEx() | ||
.typeId(zilla:id("mqtt")) | ||
.publish() | ||
.clientId("client") | ||
.topic("device/test/data") | ||
.build() | ||
.build()} | ||
|
||
connected | ||
|
||
read zilla:data.ext ${mqtt:matchDataEx() | ||
.typeId(zilla:id("mqtt")) | ||
.publish() | ||
.build() | ||
.build()} | ||
|
||
read "message" |
Oops, something went wrong.