write reservation ID to file (#333)

Signed-off-by: Max Brenner <xamrennerb@gmail.com>
This commit is contained in:
Max
2021-12-20 14:26:37 +01:00
committed by GitHub
parent 108ceb8773
commit 259820571c
4 changed files with 38 additions and 33 deletions

View File

@@ -116,14 +116,15 @@ jobs:
run: pip install -r wlan-testing/.quali/requirements.txt
- name: start reservation
id: start
run: |
RES_ID=$(python wlan-testing/.quali/start_reservation.py --openwifi-version "${{ needs.vars.outputs.openwifi_revision }}" --ap-model "${{ matrix.ap_model }}" --blueprint "Advance Lab")
echo ::set-output name=res_id::"$RES_ID"
python wlan-testing/.quali/start_reservation.py --openwifi-version "${{ needs.vars.outputs.openwifi_revision }}" --ap-model "${{ matrix.ap_model }}" --blueprint "Advance Lab"
- name: set reservation identifier
- name: set reservation outputs
if: always()
id: reservation
run: echo ::set-output name=identifier::$(echo ${{ steps.start.outputs.res_id }} | cut -d "-" -f 1)
run: |
echo ::set-output name=identifier::"$(cat ./reservation_id.txt)"
echo ::set-output name=namespace::"$(cat ./reservation_id.txt | cut -d "-" -f 1)"
- name: get EKS access credentials
run: aws eks update-kubeconfig --name ${{ env.AWS_EKS_NAME }}
@@ -151,7 +152,7 @@ jobs:
Customer = ""
server = ""
CONFIGURATION = {
"advanced": $(python wlan-testing/.quali/get_configuration.py ${{ steps.start.outputs.res_id }})
"advanced": $(python wlan-testing/.quali/get_configuration.py ${{ steps.reservation.outputs.identifier }})
}
open_flow = {}
@@ -470,7 +471,7 @@ jobs:
- -x
- -c
- |
HOSTS="sec-${{ steps.reservation.outputs.identifier }}.cicd.lab.wlan.tip.build gw-${{ steps.reservation.outputs.identifier }}.cicd.lab.wlan.tip.build fms-${{ steps.reservation.outputs.identifier }}.cicd.lab.wlan.tip.build"
HOSTS="sec-${{ steps.reservation.outputs.namespace }}.cicd.lab.wlan.tip.build gw-${{ steps.reservation.outputs.namespace }}.cicd.lab.wlan.tip.build fms-${{ steps.reservation.outputs.namespace }}.cicd.lab.wlan.tip.build"
for HOST in \$HOSTS; do
HOST_ENTRY=""
until [[ ! -z "\$HOST_ENTRY" ]]; do sleep 1; HOST_ENTRY=\$(getent hosts \$HOST); done;
@@ -527,19 +528,19 @@ jobs:
- name: show gw logs
if: failure()
run: kubectl -n openwifi-${{ steps.reservation.outputs.identifier }} logs deployment/owgw
run: kubectl -n openwifi-${{ steps.reservation.outputs.namespace }} logs deployment/owgw
- name: show fms logs
if: failure()
run: kubectl -n openwifi-${{ steps.reservation.outputs.identifier }} logs deployment/owfms
run: kubectl -n openwifi-${{ steps.reservation.outputs.namespace }} logs deployment/owfms
- name: show prov logs
if: failure()
run: kubectl -n openwifi-${{ steps.reservation.outputs.identifier }} logs deployment/owprov
run: kubectl -n openwifi-${{ steps.reservation.outputs.namespace }} logs deployment/owprov
- name: show sec logs
if: failure()
run: kubectl -n openwifi-${{ steps.reservation.outputs.identifier }} logs deployment/owsec
run: kubectl -n openwifi-${{ steps.reservation.outputs.namespace }} logs deployment/owsec
- name: upload Allure results as artifact
if: ${{ always() }}
@@ -555,7 +556,7 @@ jobs:
- name: stop reservation
if: always()
run: python wlan-testing/.quali/stop_reservation.py ${{ steps.start.outputs.res_id }}
run: python wlan-testing/.quali/stop_reservation.py ${{ steps.reservation.outputs.identifier }}
report:
needs: [ vars, generate-matrix, test ]

View File

@@ -98,18 +98,19 @@ jobs:
run: pip install -r .quali/requirements.txt
- name: start reservation
id: start
env:
CLOUDSHELL_URL: quali-cloudshell.lab.wlan.tip.build
CLOUDSHELL_USER: ${{ secrets.CLOUDSHELL_USER }}
CLOUDSHELL_PASSWORD: ${{ secrets.CLOUDSHELL_PASSWORD }}
run: |
RES_ID=$(python .quali/start_reservation.py --openwifi-version "${{ github.event.inputs.openwifi_revision }}" --openwifi-gw-version "${{ github.event.inputs.openwifi_gw_revision }}" --openwifi-sec-version "${{ github.event.inputs.openwifi_sec_revision }}" --openwifi-fms-version "${{ github.event.inputs.openwifi_fms_revision }}" --openwifi-ui-version "${{ github.event.inputs.openwifi_ui_revision }}" --ap-model "${{ github.event.inputs.ap_model }}")
echo ::set-output name=res_id::"$RES_ID"
python .quali/start_reservation.py --openwifi-version "${{ github.event.inputs.openwifi_revision }}" --openwifi-gw-version "${{ github.event.inputs.openwifi_gw_revision }}" --openwifi-sec-version "${{ github.event.inputs.openwifi_sec_revision }}" --openwifi-fms-version "${{ github.event.inputs.openwifi_fms_revision }}" --openwifi-ui-version "${{ github.event.inputs.openwifi_ui_revision }}" --ap-model "${{ github.event.inputs.ap_model }}"
- name: set reservation identifier
- name: set reservation outputs
if: always()
id: reservation
run: echo ::set-output name=identifier::$(echo ${{ steps.start.outputs.res_id }} | cut -d "-" -f 1)
run: |
echo ::set-output name=identifier::"$(cat ./reservation_id.txt)"
echo ::set-output name=namespace::"$(cat ./reservation_id.txt | cut -d "-" -f 1)"
- name: install JRE
run: |
@@ -157,7 +158,7 @@ jobs:
Customer = ""
server = ""
CONFIGURATION = {
"basic": $(python .quali/get_configuration.py ${{ steps.start.outputs.res_id }})
"basic": $(python .quali/get_configuration.py ${{ steps.reservation.outputs.identifier }})
}
open_flow = {}
@@ -474,7 +475,7 @@ jobs:
- -x
- -c
- |
HOSTS="sec-${{ steps.reservation.outputs.identifier }}.cicd.lab.wlan.tip.build gw-${{ steps.reservation.outputs.identifier }}.cicd.lab.wlan.tip.build fms-${{ steps.reservation.outputs.identifier }}.cicd.lab.wlan.tip.build"
HOSTS="sec-${{ steps.reservation.outputs.namespace }}.cicd.lab.wlan.tip.build gw-${{ steps.reservation.outputs.namespace }}.cicd.lab.wlan.tip.build fms-${{ steps.reservation.outputs.namespace }}.cicd.lab.wlan.tip.build"
for HOST in \$HOSTS; do
HOST_ENTRY=""
until [[ ! -z "\$HOST_ENTRY" ]]; do sleep 1; HOST_ENTRY=\$(getent hosts \$HOST); done;
@@ -548,7 +549,7 @@ jobs:
- name: stop reservation
if: always()
run: python .quali/stop_reservation.py ${{ steps.start.outputs.res_id }}
run: python .quali/stop_reservation.py ${{ steps.reservation.outputs.identifier }}
env:
CLOUDSHELL_URL: quali-cloudshell.lab.wlan.tip.build
CLOUDSHELL_USER: ${{ secrets.CLOUDSHELL_USER }}

View File

@@ -125,14 +125,15 @@ jobs:
run: pip install -r .quali/requirements.txt
- name: start reservation
id: start
run: |
RES_ID=$(python .quali/start_reservation.py --openwifi-version "${{ needs.vars.outputs.openwifi_revision }}" --openwifi-gw-version "${{ needs.vars.outputs.openwifi_gw_revision }}" --openwifi-sec-version "${{ needs.vars.outputs.openwifi_sec_revision }}" --openwifi-fms-version "${{ needs.vars.outputs.openwifi_fms_revision }}" --openwifi-ui-version "${{ needs.vars.outputs.openwifi_ui_revision }}" --ap-model "${{ matrix.ap_model }}")
echo ::set-output name=res_id::"$RES_ID"
python .quali/start_reservation.py --openwifi-version "${{ needs.vars.outputs.openwifi_revision }}" --openwifi-gw-version "${{ needs.vars.outputs.openwifi_gw_revision }}" --openwifi-sec-version "${{ needs.vars.outputs.openwifi_sec_revision }}" --openwifi-fms-version "${{ needs.vars.outputs.openwifi_fms_revision }}" --openwifi-ui-version "${{ needs.vars.outputs.openwifi_ui_revision }}" --ap-model "${{ matrix.ap_model }}"
- name: set reservation identifier
- name: set reservation outputs
if: always()
id: reservation
run: echo ::set-output name=identifier::$(echo ${{ steps.start.outputs.res_id }} | cut -d "-" -f 1)
run: |
echo ::set-output name=identifier::"$(cat ./reservation_id.txt)"
echo ::set-output name=namespace::"$(cat ./reservation_id.txt | cut -d "-" -f 1)"
- name: get EKS access credentials
run: aws eks update-kubeconfig --name ${{ env.AWS_EKS_NAME }}
@@ -160,7 +161,7 @@ jobs:
Customer = ""
server = ""
CONFIGURATION = {
"basic": $(python .quali/get_configuration.py ${{ steps.start.outputs.res_id }})
"basic": $(python .quali/get_configuration.py ${{ steps.reservation.outputs.identifier }})
}
open_flow = {}
@@ -496,7 +497,7 @@ jobs:
- -x
- -c
- |
HOSTS="sec-${{ steps.reservation.outputs.identifier }}.cicd.lab.wlan.tip.build gw-${{ steps.reservation.outputs.identifier }}.cicd.lab.wlan.tip.build fms-${{ steps.reservation.outputs.identifier }}.cicd.lab.wlan.tip.build"
HOSTS="sec-${{ steps.reservation.outputs.namespace }}.cicd.lab.wlan.tip.build gw-${{ steps.reservation.outputs.namespace }}.cicd.lab.wlan.tip.build fms-${{ steps.reservation.outputs.namespace }}.cicd.lab.wlan.tip.build"
for HOST in \$HOSTS; do
HOST_ENTRY=""
until [[ ! -z "\$HOST_ENTRY" ]]; do sleep 1; HOST_ENTRY=\$(getent hosts \$HOST); done;
@@ -553,19 +554,19 @@ jobs:
- name: show gw logs
if: failure()
run: kubectl -n openwifi-${{ steps.reservation.outputs.identifier }} logs deployment/owgw
run: kubectl -n openwifi-${{ steps.reservation.outputs.namespace }} logs deployment/owgw
- name: show fms logs
if: failure()
run: kubectl -n openwifi-${{ steps.reservation.outputs.identifier }} logs deployment/owfms
run: kubectl -n openwifi-${{ steps.reservation.outputs.namespace }} logs deployment/owfms
- name: show prov logs
if: failure()
run: kubectl -n openwifi-${{ steps.reservation.outputs.identifier }} logs deployment/owprov
run: kubectl -n openwifi-${{ steps.reservation.outputs.namespace }} logs deployment/owprov
- name: show sec logs
if: failure()
run: kubectl -n openwifi-${{ steps.reservation.outputs.identifier }} logs deployment/owsec
run: kubectl -n openwifi-${{ steps.reservation.outputs.namespace }} logs deployment/owsec
- name: upload Allure results as artifact
if: always()
@@ -581,7 +582,7 @@ jobs:
- name: stop reservation
if: always()
run: python .quali/stop_reservation.py ${{ steps.start.outputs.res_id }}
run: python .quali/stop_reservation.py ${{ steps.reservation.outputs.identifier }}
report:
runs-on: ubuntu-latest

View File

@@ -19,6 +19,7 @@ def main():
parser.add_argument('--ap-model', default='[Any]')
parser.add_argument('--wifi-type', default='[Any]')
parser.add_argument('--blueprint', default='Basic Lab')
parser.add_argument('--reservation-id-file', default='./reservation_id.txt')
args = parser.parse_args()
session = get_session()
@@ -44,7 +45,8 @@ def main():
]
).Reservation
print(reservation.Id)
with open(args.reservation_id_file, 'w') as f:
f.write(reservation.Id)
wait_for_provisioning_status(session, reservation.Id, 'Ready')