@@ -685,3 +685,193 @@ jobs:
685
685
- name : Check for edits to code-generated files
686
686
run : |
687
687
./utils/check_codegen_edits.py
688
+
689
+ clang-sanitizers :
690
+ runs-on : ubuntu-24.04 # latest
691
+ strategy :
692
+ matrix :
693
+ sanitizer-variants : ["tsan", "asan"]
694
+ permissions :
695
+ id-token : write # This is required for requesting the JWT
696
+ steps :
697
+ - name : Build ${{ env.PACKAGE_NAME }} + consumers
698
+ run : |
699
+ echo "Downloading source"
700
+ git clone --recursive https://github.com/aws/aws-iot-device-sdk-cpp-v2.git --branch ${{ env.HEAD_REF || github.ref_name }}
701
+ echo "Running builder"
702
+ python -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')"
703
+ python builder.pyz build -p ${{ env.PACKAGE_NAME }} --variant ${{ matrix.sanitizer-variants }}
704
+ - name : Running samples in CI setup
705
+ run : |
706
+ python3 -m pip install boto3
707
+ sudo apt-get update -y
708
+ sudo apt-get install softhsm2 -y
709
+ softhsm2-util --version
710
+ - name : configure AWS credentials (Fleet provisioning)
711
+ uses : aws-actions/configure-aws-credentials@v2
712
+ with :
713
+ role-to-assume : ${{ env.CI_FLEET_PROVISIONING_ROLE }}
714
+ aws-region : ${{ env.AWS_DEFAULT_REGION }}
715
+ - name : run Fleet Provisioning service client test for MQTT311
716
+ working-directory : ./aws-iot-device-sdk-cpp-v2/servicetests
717
+ run : |
718
+ export PYTHONPATH=${{ github.workspace }}/aws-iot-device-sdk-cpp-v2/utils
719
+ python3 ./test_cases/test_fleet_provisioning.py --config-file test_cases/mqtt3_fleet_provisioning_cfg.json --thing-name-prefix Fleet_Thing_
720
+ - name : run Fleet Provisioning service client test for MQTT5
721
+ working-directory : ./aws-iot-device-sdk-cpp-v2/servicetests
722
+ run : |
723
+ export PYTHONPATH=${{ github.workspace }}/aws-iot-device-sdk-cpp-v2/utils
724
+ python3 ./test_cases/test_fleet_provisioning.py --config-file test_cases/mqtt5_fleet_provisioning_cfg.json --thing-name-prefix Fleet_Thing_
725
+ - name : run Fleet Provisioning with CSR service client test for MQTT311
726
+ working-directory : ./aws-iot-device-sdk-cpp-v2/servicetests
727
+ run : |
728
+ export PYTHONPATH=${{ github.workspace }}/aws-iot-device-sdk-cpp-v2/utils
729
+ python3 ./test_cases/test_fleet_provisioning.py --config-file test_cases/mqtt3_fleet_provisioning_with_csr_cfg.json --thing-name-prefix Fleet_Thing_
730
+ - name : run Fleet Provisioning with CSR service client test for MQTT5
731
+ working-directory : ./aws-iot-device-sdk-cpp-v2/servicetests
732
+ run : |
733
+ export PYTHONPATH=${{ github.workspace }}/aws-iot-device-sdk-cpp-v2/utils
734
+ python3 ./test_cases/test_fleet_provisioning.py --config-file test_cases/mqtt5_fleet_provisioning_with_csr_cfg.json --thing-name-prefix Fleet_Thing_
735
+ - name : configure AWS credentials (Jobs)
736
+ uses : aws-actions/configure-aws-credentials@v2
737
+ with :
738
+ role-to-assume : ${{ env.CI_JOBS_SERVICE_CLIENT_ROLE }}
739
+ aws-region : ${{ env.AWS_DEFAULT_REGION }}
740
+ - name : run mqtt3 Jobs serviceTests
741
+ working-directory : ./aws-iot-device-sdk-cpp-v2/servicetests
742
+ run : |
743
+ export PYTHONPATH=${{ github.workspace }}/aws-iot-device-sdk-cpp-v2/utils
744
+ python3 ./test_cases/test_jobs_execution.py --config-file ${{ env.CI_SERVICE_TESTS_CFG_FOLDER }}/mqtt3_jobs_cfg.json
745
+ - name : run mqtt5 Jobs serviceTests
746
+ working-directory : ./aws-iot-device-sdk-cpp-v2/servicetests
747
+ run : |
748
+ export PYTHONPATH=${{ github.workspace }}/aws-iot-device-sdk-cpp-v2/utils
749
+ python3 ./test_cases/test_jobs_execution.py --config-file ${{ env.CI_SERVICE_TESTS_CFG_FOLDER }}/mqtt5_jobs_cfg.json
750
+ - name : configure AWS credentials (Shadow)
751
+ uses : aws-actions/configure-aws-credentials@v2
752
+ with :
753
+ role-to-assume : ${{ env.CI_SHADOW_SERVICE_CLIENT_ROLE }}
754
+ aws-region : ${{ env.AWS_DEFAULT_REGION }}
755
+ - name : run Shadow service client test for MQTT5
756
+ working-directory : ./aws-iot-device-sdk-cpp-v2/servicetests
757
+ run : |
758
+ export PYTHONPATH=${{ github.workspace }}/aws-iot-device-sdk-cpp-v2/utils
759
+ python3 ./test_cases/test_shadow_update.py --config-file test_cases/mqtt5_shadow_cfg.json
760
+ - name : run Shadow service client test for MQTT311
761
+ working-directory : ./aws-iot-device-sdk-cpp-v2/servicetests
762
+ run : |
763
+ export PYTHONPATH=${{ github.workspace }}/aws-iot-device-sdk-cpp-v2/utils
764
+ python3 ./test_cases/test_shadow_update.py --config-file test_cases/mqtt3_shadow_cfg.json
765
+ - name : run Named Shadow service client test for MQTT311
766
+ working-directory : ./aws-iot-device-sdk-cpp-v2/servicetests
767
+ run : |
768
+ export PYTHONPATH=${{ github.workspace }}/aws-iot-device-sdk-cpp-v2/utils
769
+ python3 ./test_cases/test_shadow_update.py --config-file test_cases/mqtt3_named_shadow_cfg.json
770
+ - name : run Named Shadow service client test for MQTT5
771
+ working-directory : ./aws-iot-device-sdk-cpp-v2/servicetests
772
+ run : |
773
+ export PYTHONPATH=${{ github.workspace }}/aws-iot-device-sdk-cpp-v2/utils
774
+ python3 ./test_cases/test_shadow_update.py --config-file test_cases/mqtt5_named_shadow_cfg.json
775
+ - name : configure AWS credentials (Connect and PubSub)
776
+ uses : aws-actions/configure-aws-credentials@v2
777
+ with :
778
+ role-to-assume : ${{ env.CI_PUBSUB_ROLE }}
779
+ aws-region : ${{ env.AWS_DEFAULT_REGION }}
780
+ - name : run Basic Connect sample
781
+ run : |
782
+ python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_basic_connect_cfg.json
783
+ - name : run Websocket Connect sample
784
+ run : |
785
+ python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_websocket_connect_cfg.json
786
+ - name : run MQTT3 PubSub sample
787
+ run : |
788
+ python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_pubsub_cfg.json
789
+ - name : run PKCS11 Connect sample
790
+ run : |
791
+ mkdir -p /tmp/tokens
792
+ export SOFTHSM2_CONF=/tmp/softhsm2.conf
793
+ echo "directories.tokendir = /tmp/tokens" > /tmp/softhsm2.conf
794
+ python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_pkcs11_connect_cfg.json
795
+ - name : configure AWS credentials (MQTT5)
796
+ uses : aws-actions/configure-aws-credentials@v2
797
+ with :
798
+ role-to-assume : ${{ env.CI_MQTT5_ROLE }}
799
+ aws-region : ${{ env.AWS_DEFAULT_REGION }}
800
+ - name : run MQTT5 PubSub sample
801
+ run : |
802
+ python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_mqtt5_pubsub_cfg.json
803
+ - name : run MQTT5 Shared Subscription sample
804
+ run : |
805
+ python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_mqtt5_shared_subscription_cfg.json
806
+ - name : configure AWS credentials (Jobs)
807
+ uses : aws-actions/configure-aws-credentials@v2
808
+ with :
809
+ role-to-assume : ${{ env.CI_JOBS_ROLE }}
810
+ aws-region : ${{ env.AWS_DEFAULT_REGION }}
811
+ - name : run Jobs sample
812
+ run : |
813
+ python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_jobs_cfg.json
814
+ - name : run Mqtt5 Jobs sample
815
+ run : |
816
+ python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_jobs_mqtt5_cfg.json
817
+ - name : configure AWS credentials (Cognito)
818
+ uses : aws-actions/configure-aws-credentials@v2
819
+ with :
820
+ role-to-assume : ${{ env.CI_COGNITO_ROLE }}
821
+ aws-region : ${{ env.AWS_DEFAULT_REGION }}
822
+ - name : run CognitoConnect sample
823
+ run : |
824
+ python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_cognito_connect_cfg.json
825
+ - name : configure AWS credentials (Custom Authorizer)
826
+ uses : aws-actions/configure-aws-credentials@v2
827
+ with :
828
+ role-to-assume : ${{ env.CI_CUSTOM_AUTHORIZER_ROLE }}
829
+ aws-region : ${{ env.AWS_DEFAULT_REGION }}
830
+ - name : run CustomAuthorizerConnect sample
831
+ run : |
832
+ python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_custom_authorizer_connect_cfg.json
833
+ - name : configure AWS credentials (Shadow)
834
+ uses : aws-actions/configure-aws-credentials@v2
835
+ with :
836
+ role-to-assume : ${{ env.CI_SHADOW_ROLE }}
837
+ aws-region : ${{ env.AWS_DEFAULT_REGION }}
838
+ - name : run Shadow sample
839
+ run : |
840
+ python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_shadow_cfg.json
841
+ - name : run Mqtt5 Shadow sample
842
+ run : |
843
+ python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_shadow_mqtt5_cfg.json
844
+ - name : configure AWS credentials (Fleet provisioning)
845
+ uses : aws-actions/configure-aws-credentials@v2
846
+ with :
847
+ role-to-assume : ${{ env.CI_FLEET_PROVISIONING_ROLE }}
848
+ aws-region : ${{ env.AWS_DEFAULT_REGION }}
849
+ - name : run Fleet Provisioning sample
850
+ run : |
851
+ echo "Generating UUID for IoT thing"
852
+ Sample_UUID=$(python3 -c "import uuid; print (uuid.uuid4())")
853
+ python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_fleet_provisioning_cfg.json --input_uuid ${Sample_UUID}
854
+ python3 ${{ env.CI_UTILS_FOLDER }}/delete_iot_thing_ci.py --thing_name "Fleet_Thing_${Sample_UUID}" --region "us-east-1"
855
+ - name : run Mqtt5 Fleet Provisioning sample
856
+ run : |
857
+ echo "Generating UUID for IoT thing"
858
+ Sample_UUID=$(python3 -c "import uuid; print (uuid.uuid4())")
859
+ python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_fleet_provisioning_mqtt5_cfg.json --input_uuid ${Sample_UUID}
860
+ python3 ${{ env.CI_UTILS_FOLDER }}/delete_iot_thing_ci.py --thing_name "Fleet_Thing_${Sample_UUID}" --region "us-east-1"
861
+ - name : configure AWS credentials (Secure tunneling)
862
+ uses : aws-actions/configure-aws-credentials@v2
863
+ with :
864
+ role-to-assume : ${{ env.CI_SECURE_TUNNEL }}
865
+ aws-region : ${{ env.AWS_DEFAULT_REGION }}
866
+ # Secure Tunneling has special requirements, so it uses a different Python file
867
+ - name : run Secure Tunneling sample
868
+ run : |
869
+ python3 ${{ env.CI_UTILS_FOLDER }}/run_secure_tunnel_ci.py --sample_file "./aws-iot-device-sdk-cpp-v2/build/samples/secure_tunneling/secure_tunnel/secure-tunnel" --sample_region ${{ env.AWS_DEFAULT_REGION }}
870
+ - name : configure AWS credentials (X509)
871
+ uses : aws-actions/configure-aws-credentials@v2
872
+ with :
873
+ role-to-assume : ${{ env.CI_X509_ROLE }}
874
+ aws-region : ${{ env.AWS_DEFAULT_REGION }}
875
+ - name : run X509 sample
876
+ run : |
877
+ python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_x509_connect_cfg.json
0 commit comments