|
| 1 | +# Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +# or more contributor license agreements. See the NOTICE file |
| 3 | +# distributed with this work for additional information |
| 4 | +# regarding copyright ownership. The ASF licenses this file |
| 5 | +# to you under the Apache License, Version 2.0 (the |
| 6 | +# "License"); you may not use this file except in compliance |
| 7 | +# with the License. You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, |
| 12 | +# software distributed under the License is distributed on an |
| 13 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +# KIND, either express or implied. See the License for the |
| 15 | +# specific language governing permissions and limitations |
| 16 | +# under the License. |
| 17 | + |
| 18 | +name: Simulator CI |
| 19 | + |
| 20 | +on: [push, pull_request] |
| 21 | + |
| 22 | +concurrency: |
| 23 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| 24 | + cancel-in-progress: true |
| 25 | + |
| 26 | +jobs: |
| 27 | + build: |
| 28 | + runs-on: ubuntu-20.04 |
| 29 | + |
| 30 | + strategy: |
| 31 | + fail-fast: false |
| 32 | + matrix: |
| 33 | + tests: [ "smoke/test_accounts |
| 34 | + smoke/test_affinity_groups |
| 35 | + smoke/test_affinity_groups_projects |
| 36 | + smoke/test_annotations |
| 37 | + smoke/test_async_job |
| 38 | + smoke/test_attach_multiple_volumes |
| 39 | + smoke/test_backup_recovery_dummy |
| 40 | + smoke/test_certauthority_root |
| 41 | + smoke/test_console_endpoint |
| 42 | + smoke/test_create_list_domain_account_project |
| 43 | + smoke/test_create_network |
| 44 | + smoke/test_deploy_vgpu_enabled_vm |
| 45 | + smoke/test_deploy_virtio_scsi_vm |
| 46 | + smoke/test_deploy_vm_extra_config_data |
| 47 | + smoke/test_deploy_vm_iso |
| 48 | + smoke/test_deploy_vm_iso_uefi |
| 49 | + smoke/test_deploy_vm_root_resize |
| 50 | + smoke/test_deploy_vm_with_userdata |
| 51 | + smoke/test_deploy_vms_in_parallel |
| 52 | + smoke/test_deploy_vms_with_varied_deploymentplanners |
| 53 | + smoke/test_diagnostics |
| 54 | + smoke/test_direct_download |
| 55 | + smoke/test_disk_offerings |
| 56 | + smoke/test_disk_provisioning_types |
| 57 | + smoke/test_domain_disk_offerings |
| 58 | + smoke/test_domain_network_offerings |
| 59 | + smoke/test_domain_service_offerings |
| 60 | + smoke/test_domain_vpc_offerings", |
| 61 | + "smoke/test_dynamicroles |
| 62 | + smoke/test_enable_account_settings_for_domain |
| 63 | + smoke/test_enable_role_based_users_in_projects |
| 64 | + smoke/test_events_resource |
| 65 | + smoke/test_global_settings |
| 66 | + smoke/test_guest_vlan_range |
| 67 | + smoke/test_host_maintenance |
| 68 | + smoke/test_hostha_kvm |
| 69 | + smoke/test_hostha_simulator |
| 70 | + smoke/test_internal_lb |
| 71 | + smoke/test_ipv6_infra |
| 72 | + smoke/test_iso |
| 73 | + smoke/test_kubernetes_clusters |
| 74 | + smoke/test_kubernetes_supported_versions |
| 75 | + smoke/test_list_ids_parameter |
| 76 | + smoke/test_loadbalance |
| 77 | + smoke/test_login |
| 78 | + smoke/test_metrics_api |
| 79 | + smoke/test_migration |
| 80 | + smoke/test_multipleips_per_nic |
| 81 | + smoke/test_nested_virtualization", |
| 82 | + "smoke/test_network |
| 83 | + smoke/test_network_acl |
| 84 | + smoke/test_network_ipv6 |
| 85 | + smoke/test_network_permissions |
| 86 | + smoke/test_nic |
| 87 | + smoke/test_nic_adapter_type |
| 88 | + smoke/test_non_contigiousvlan |
| 89 | + smoke/test_outofbandmanagement |
| 90 | + smoke/test_outofbandmanagement_nestedplugin |
| 91 | + smoke/test_over_provisioning |
| 92 | + smoke/test_password_server |
| 93 | + smoke/test_persistent_network |
| 94 | + smoke/test_portable_publicip |
| 95 | + smoke/test_portforwardingrules |
| 96 | + smoke/test_primary_storage |
| 97 | + smoke/test_privategw_acl |
| 98 | + smoke/test_privategw_acl_ovs_gre |
| 99 | + smoke/test_projects |
| 100 | + smoke/test_public_ip_range |
| 101 | + smoke/test_pvlan |
| 102 | + smoke/test_regions |
| 103 | + smoke/test_register_userdata |
| 104 | + smoke/test_reset_configuration_settings |
| 105 | + smoke/test_reset_vm_on_reboot |
| 106 | + smoke/test_resource_accounting |
| 107 | + smoke/test_resource_detail", |
| 108 | + "smoke/test_router_dhcphosts |
| 109 | + smoke/test_router_dns |
| 110 | + smoke/test_router_dnsservice |
| 111 | + smoke/test_routers |
| 112 | + smoke/test_routers_iptables_default_policy |
| 113 | + smoke/test_routers_network_ops |
| 114 | + smoke/test_scale_vm |
| 115 | + smoke/test_secondary_storage |
| 116 | + smoke/test_service_offerings |
| 117 | + smoke/test_snapshots |
| 118 | + smoke/test_ssvm |
| 119 | + smoke/test_staticroles |
| 120 | + smoke/test_templates |
| 121 | + smoke/test_update_security_group |
| 122 | + smoke/test_usage |
| 123 | + smoke/test_usage_events |
| 124 | + smoke/test_vm_deployment_planner |
| 125 | + smoke/test_vm_life_cycle |
| 126 | + smoke/test_vm_lifecycle_unmanage_import |
| 127 | + smoke/test_vm_snapshot_kvm |
| 128 | + smoke/test_vm_snapshots |
| 129 | + smoke/test_volumes |
| 130 | + smoke/test_vpc_ipv6 |
| 131 | + smoke/test_vpc_redundant |
| 132 | + smoke/test_vpc_router_nics |
| 133 | + smoke/test_vpc_vpn", |
| 134 | + "component/find_hosts_for_migration |
| 135 | + component/test_acl_isolatednetwork |
| 136 | + component/test_acl_isolatednetwork_delete |
| 137 | + component/test_acl_listsnapshot", |
| 138 | + "component/test_acl_listvm |
| 139 | + component/test_acl_listvolume", |
| 140 | + "component/test_acl_sharednetwork |
| 141 | + component/test_acl_sharednetwork_deployVM-impersonation |
| 142 | + component/test_user_private_gateway |
| 143 | + component/test_user_shared_network", |
| 144 | + "component/test_affinity_groups_projects |
| 145 | + component/test_allocation_states |
| 146 | + component/test_assign_vm", |
| 147 | + "component/test_concurrent_snapshots_limit |
| 148 | + component/test_cpu_domain_limits |
| 149 | + component/test_cpu_limits |
| 150 | + component/test_cpu_max_limits |
| 151 | + component/test_cpu_project_limits |
| 152 | + component/test_deploy_vm_userdata_multi_nic", |
| 153 | + "component/test_egress_fw_rules |
| 154 | + component/test_invalid_gw_nm |
| 155 | + component/test_ip_reservation", |
| 156 | + "component/test_lb_secondary_ip |
| 157 | + component/test_list_nics |
| 158 | + component/test_list_pod |
| 159 | + component/test_memory_limits", |
| 160 | + "component/test_mm_domain_limits |
| 161 | + component/test_mm_max_limits |
| 162 | + component/test_mm_project_limits |
| 163 | + component/test_network_offering |
| 164 | + component/test_non_contiguous_vlan", |
| 165 | + "component/test_persistent_networks |
| 166 | + component/test_project_configs |
| 167 | + component/test_project_limits |
| 168 | + component/test_project_resources", |
| 169 | + "component/test_project_usage |
| 170 | + component/test_protocol_number_security_group |
| 171 | + component/test_public_ip |
| 172 | + component/test_resource_limits", |
| 173 | + "component/test_regions_accounts |
| 174 | + component/test_routers |
| 175 | + component/test_snapshots |
| 176 | + component/test_stopped_vm |
| 177 | + component/test_tags |
| 178 | + component/test_templates |
| 179 | + component/test_updateResourceCount |
| 180 | + component/test_update_vm", |
| 181 | + "component/test_volumes |
| 182 | + component/test_vpc |
| 183 | + component/test_vpc_distributed_routing_offering |
| 184 | + component/test_vpc_network |
| 185 | + component/test_vpc_offerings |
| 186 | + component/test_vpc_routers |
| 187 | + component/test_vpn_users", |
| 188 | + "component/test_vpc_network_lbrules" ] |
| 189 | + |
| 190 | + steps: |
| 191 | + - uses: actions/checkout@v3 |
| 192 | + |
| 193 | + - name: Set up JDK |
| 194 | + uses: actions/setup-java@v3 |
| 195 | + with: |
| 196 | + java-version: '11' |
| 197 | + distribution: 'adopt' |
| 198 | + architecture: x64 |
| 199 | + cache: maven |
| 200 | + |
| 201 | + - name: Set up Python |
| 202 | + uses: actions/setup-python@v4 |
| 203 | + with: |
| 204 | + python-version: '3.8' |
| 205 | + architecture: 'x64' |
| 206 | + |
| 207 | + - name: Install Build Dependencies |
| 208 | + run: | |
| 209 | + sudo apt-get update |
| 210 | + sudo apt-get install -y git uuid-runtime genisoimage netcat ipmitool build-essential libgcrypt20 libgpg-error-dev libgpg-error0 libopenipmi0 ipmitool libpython3-dev libssl-dev libffi-dev python3-openssl python3-dev python3-setuptools |
| 211 | +
|
| 212 | + - name: Install Python dependencies |
| 213 | + run: | |
| 214 | + python3 -m pip install --user --upgrade urllib3 lxml paramiko nose texttable ipmisim pyopenssl pycrypto mock flask netaddr pylint pycodestyle six astroid |
| 215 | +
|
| 216 | + - name: Env details |
| 217 | + run: | |
| 218 | + uname -a |
| 219 | + whoami |
| 220 | + javac -version |
| 221 | + mvn -v |
| 222 | + python3 --version |
| 223 | + free -m |
| 224 | + nproc |
| 225 | + git status |
| 226 | + ipmitool -V |
| 227 | +
|
| 228 | + - name: Setup MySQL Server |
| 229 | + run: | |
| 230 | + # https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2004-Readme.md#mysql |
| 231 | + sudo apt-get install -y mysql-server |
| 232 | + sudo systemctl start mysql |
| 233 | + sudo mysql -uroot -proot -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY ''; FLUSH PRIVILEGES;" |
| 234 | + sudo systemctl restart mysql |
| 235 | + sudo mysql -uroot -e "SELECT VERSION();" |
| 236 | +
|
| 237 | + - name: Build with Maven |
| 238 | + run: | |
| 239 | + mvn -B -P developer,systemvm -Dsimulator clean install -DskipTests=true |
| 240 | +
|
| 241 | + - name: Setup Simulator Prerequisites |
| 242 | + run: | |
| 243 | + sudo python3 -m pip install --upgrade netaddr mysql-connector-python |
| 244 | + python3 -m pip install --user --upgrade tools/marvin/dist/Marvin-*.tar.gz |
| 245 | + mvn -q -Pdeveloper -pl developer -Ddeploydb |
| 246 | + mvn -q -Pdeveloper -pl developer -Ddeploydb-simulator |
| 247 | +
|
| 248 | + - name: Start CloudStack Management Server with Simulator |
| 249 | + run: | |
| 250 | + export MAVEN_OPTS="-Xmx4096m -XX:MaxPermSize=800m -Djava.security.egd=file:/dev/urandom" |
| 251 | + echo -e "\nStarting simulator" |
| 252 | + set +e |
| 253 | + mvn -Dsimulator -Dorg.eclipse.jetty.annotations.maxWait=120 -pl :cloud-client-ui jetty:run 2>&1 > /tmp/jetty-log || true & |
| 254 | + while ! nc -vzw 5 localhost 8096 2>&1 > /dev/null; do grep Exception /tmp/jetty-log; sleep 10; done |
| 255 | + set -e |
| 256 | + echo -e "\nStarting Advanced Zone DataCenter deployment" |
| 257 | + python3 tools/marvin/marvin/deployDataCenter.py -i setup/dev/advanced.cfg 2>&1 || true |
| 258 | +
|
| 259 | + - name: Run Integration Tests with Simulator |
| 260 | + run: | |
| 261 | + mkdir -p integration-test-results/smoke/misc |
| 262 | + mkdir -p integration-test-results/component |
| 263 | + set -e |
| 264 | + TESTS="${{ matrix.tests }}" |
| 265 | + echo "Tests in this job: $TESTS" |
| 266 | +
|
| 267 | + TESTS=($(echo $TESTS | tr -d '\n' | tr -s ' ')) |
| 268 | + for suite in "${TESTS[@]}" ; do |
| 269 | + echo -e "Currently running test: $suite\n" |
| 270 | + time nosetests-3.4 --with-xunit --xunit-file=integration-test-results/$suite.xml --with-marvin --marvin-config=setup/dev/advanced.cfg test/integration/$suite.py -s -a tags=advanced,required_hardware=false --zone=Sandbox-simulator --hypervisor=simulator || true ; |
| 271 | + done |
| 272 | +
|
| 273 | + echo -e "Stopping Simulator, integration tests run completed\n" |
| 274 | + mvn -Dsimulator -pl client jetty:stop 2>&1 |
| 275 | + find /tmp//MarvinLogs -type f -exec echo -e "Printing marvin logs {} :\n" \; -exec cat {} \; |
| 276 | +
|
| 277 | + - name: Integration Tests Result |
| 278 | + run: | |
| 279 | + echo -e "Simulator CI Test Results: (only failures listed)\n" |
| 280 | + python3 ./tools/marvin/xunit-reader.py integration-test-results/ |
0 commit comments