Skip to content

Commit

Permalink
edge-testnet / add container registry
Browse files Browse the repository at this point in the history
We are not testing the container registry address. We should.
  • Loading branch information
JanneKiiskila committed Oct 5, 2023
1 parent 90d5005 commit 1b196b5
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/pr-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,11 @@ jobs:
- run: git clone [email protected]:PelionIoT/scripts-internal.git
#- run: git clone https://github.com/PelionIoT/scripts-internal.git
- run: echo "." >scripts-internal/.nopyshcheck
- run: .github/workflows/pysh-checker.sh ${{ github.event.repository.default_branch }} ${{ github.ref_name }}
- run: .github/workflows/pysh-checker.sh ${{ github.event.repository.default_branch }} ${{ github.ref_name }}

run-edge-testnet:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Run edge-testnet
run: fw-tools/edge-testnet
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## Izuma Edge utilities 2.3.0
1. [edge-testnet] - add support for container registry.

## Izuma Edge utilities 2.2.2
1. Version number bump from 2.2.0 to 2.2.2.

Expand Down
28 changes: 28 additions & 0 deletions fw-tools/edge-testnet
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ gwT=$temp/gateway.txt
LWT=$temp/test-lwm2m.txt
L3T=$temp/layer3.txt
L4T=$temp/layer4.txt
gwR=$temp/registry.txt

# For faster testing w/o actually building the whole snap
#SNAP="snap-test"
Expand Down Expand Up @@ -158,6 +159,31 @@ test_gateway() {
fi
}

test_registry() {
verbose "Test container registry server connection (port $port)"
verbose "------------------------------------------------------"
verbose "Uses openssl to connect to container registry."
verbose "Write openssl output to $gwR."
echo | openssl s_client -connect containers.us-east-1.mbedcloud.com:"$port" 2>"$gwR" >"$gwR"

# get openssl return code
RESULT=$(grep 'Verify return code' "$gwR")
if [ -z "$RESULT" ]; then
clihelp::failure "openssl failed with: $(cat "$gwR")"
fi
# print result
CODE=$(echo "$RESULT" | awk -F' ' '{print $4}')
if [ "$CODE" = 0 ]; then
clihelp::success "TLS to registry server (port $port)"
else
clihelp::failure "TLS to registry server (port $port)"
echo "--------------"
echo "$RESULT"
echo "--------------"
fi
}


test_L3() {
_url() {
if [[ $(ping -q -c 1 "$1" >>"$L3T" 2>&1) -eq 0 ]]; then
Expand Down Expand Up @@ -199,6 +225,7 @@ test_L4() {
_nc lwm2m.us-east-1.mbedcloud.com 5684
_nc k8s.us-east-1.mbedcloud.com 443
_nc gateways.us-east-1.mbedcloud.com 443
_nc containers.us-east-1.mbedcloud.com 443
if [[ -n "${SNAP}" ]]; then
# https://snapcraft.io/docs/network-requirements
_nc api.snapcraft.io 443
Expand All @@ -224,6 +251,7 @@ main() {
# K8S and Gateway server only operate on port 443
test_k8s
test_gateway
test_registry
if [[ "$DONTDELETE" -eq 0 ]]; then
rm -rf "$temp"
else
Expand Down

0 comments on commit 1b196b5

Please sign in to comment.