-
Notifications
You must be signed in to change notification settings - Fork 740
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'sonic-net:master' into test_orchagent_standby_tor_downs…
…tream_failure_fix
- Loading branch information
Showing
1,346 changed files
with
139,860 additions
and
84,949 deletions.
There are no files selected for viewing
84 changes: 84 additions & 0 deletions
84
.azure-pipelines/baseline_test/baseline.test.mgmt.public.master.yml
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,84 @@ | ||
name: BaselineTest_$(Build.DefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r) | ||
|
||
trigger: none | ||
pr: none | ||
|
||
schedules: | ||
- cron: "0 4 * * *" | ||
displayName: Baseline test Scheduler | ||
branches: | ||
include: | ||
- master | ||
always: true | ||
|
||
stages: | ||
- stage: Pre_test | ||
variables: | ||
- group: GIT_SECRETS | ||
jobs: | ||
- job: validate_test_cases | ||
displayName: "Validate Test Cases" | ||
timeoutInMinutes: 20 | ||
continueOnError: false | ||
pool: ubuntu-20.04 | ||
steps: | ||
- template: ../pytest-collect-only.yml | ||
|
||
- stage: Test_round_1 | ||
dependsOn: | ||
- Pre_test | ||
condition: succeeded('Pre_test') | ||
variables: | ||
- group: SONiC-Elastictest | ||
- name: inventory | ||
value: veos_vtb | ||
- name: testbed_file | ||
value: vtestbed.yaml | ||
- group: GIT_SECRETS | ||
jobs: | ||
- template: baseline.test.template.yml | ||
|
||
- stage: Test_round_2 | ||
dependsOn: | ||
- Pre_test | ||
- Test_round_1 | ||
condition: and(succeeded('Pre_test'), succeededOrFailed('Test_round_1')) | ||
variables: | ||
- group: SONiC-Elastictest | ||
- name: inventory | ||
value: veos_vtb | ||
- name: testbed_file | ||
value: vtestbed.yaml | ||
- group: GIT_SECRETS | ||
jobs: | ||
- template: baseline.test.template.yml | ||
|
||
- stage: Test_round_3 | ||
dependsOn: | ||
- Pre_test | ||
- Test_round_2 | ||
condition: and(succeeded('Pre_test'), succeededOrFailed('Test_round_2')) | ||
variables: | ||
- group: SONiC-Elastictest | ||
- name: inventory | ||
value: veos_vtb | ||
- name: testbed_file | ||
value: vtestbed.yaml | ||
- group: GIT_SECRETS | ||
jobs: | ||
- template: baseline.test.template.yml | ||
|
||
- stage: Test_round_4 | ||
dependsOn: | ||
- Pre_test | ||
- Test_round_3 | ||
condition: and(succeeded('Pre_test'), succeededOrFailed('Test_round_3')) | ||
variables: | ||
- group: SONiC-Elastictest | ||
- name: inventory | ||
value: veos_vtb | ||
- name: testbed_file | ||
value: vtestbed.yaml | ||
- group: GIT_SECRETS | ||
jobs: | ||
- template: baseline.test.template.yml |
134 changes: 134 additions & 0 deletions
134
.azure-pipelines/baseline_test/baseline.test.template.yml
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,134 @@ | ||
jobs: | ||
- job: t0_elastictest | ||
displayName: "kvmtest-t0 by Elastictest" | ||
timeoutInMinutes: 240 | ||
continueOnError: false | ||
pool: ubuntu-20.04 | ||
steps: | ||
- template: ../run-test-elastictest-template.yml | ||
parameters: | ||
TOPOLOGY: t0 | ||
MIN_WORKER: $(T0_INSTANCE_NUM) | ||
MAX_WORKER: $(T0_INSTANCE_NUM) | ||
KVM_IMAGE_BRANCH: "master" | ||
MGMT_BRANCH: "master" | ||
BUILD_REASON: "BaselineTest" | ||
RETRY_TIMES: "0" | ||
STOP_ON_FAILURE: "False" | ||
TEST_PLAN_NUM: $(BASELINE_MGMT_PUBLIC_MASTER_TEST_NUM) | ||
|
||
- job: t0_2vlans_elastictest | ||
displayName: "kvmtest-t0-2vlans by Elastictest" | ||
timeoutInMinutes: 240 | ||
continueOnError: false | ||
pool: ubuntu-20.04 | ||
steps: | ||
- template: ../run-test-elastictest-template.yml | ||
parameters: | ||
TOPOLOGY: t0 | ||
TEST_SET: t0-2vlans | ||
MIN_WORKER: $(T0_2VLANS_INSTANCE_NUM) | ||
MAX_WORKER: $(T0_2VLANS_INSTANCE_NUM) | ||
DEPLOY_MG_EXTRA_PARAMS: "-e vlan_config=two_vlan_a" | ||
KVM_IMAGE_BRANCH: "master" | ||
MGMT_BRANCH: "master" | ||
BUILD_REASON: "BaselineTest" | ||
RETRY_TIMES: "0" | ||
STOP_ON_FAILURE: "False" | ||
TEST_PLAN_NUM: $(BASELINE_MGMT_PUBLIC_MASTER_TEST_NUM) | ||
|
||
- job: t1_lag_elastictest | ||
displayName: "kvmtest-t1-lag by Elastictest" | ||
timeoutInMinutes: 240 | ||
continueOnError: false | ||
pool: ubuntu-20.04 | ||
steps: | ||
- template: ../run-test-elastictest-template.yml | ||
parameters: | ||
TOPOLOGY: t1-lag | ||
MIN_WORKER: $(T1_LAG_INSTANCE_NUM) | ||
MAX_WORKER: $(T1_LAG_INSTANCE_NUM) | ||
KVM_IMAGE_BRANCH: "master" | ||
MGMT_BRANCH: "master" | ||
BUILD_REASON: "BaselineTest" | ||
RETRY_TIMES: "0" | ||
STOP_ON_FAILURE: "False" | ||
TEST_PLAN_NUM: $(BASELINE_MGMT_PUBLIC_MASTER_TEST_NUM) | ||
|
||
- job: dualtor_elastictest | ||
displayName: "kvmtest-dualtor-t0 by Elastictest" | ||
timeoutInMinutes: 240 | ||
continueOnError: false | ||
pool: ubuntu-20.04 | ||
steps: | ||
- template: ../run-test-elastictest-template.yml | ||
parameters: | ||
TOPOLOGY: dualtor | ||
MIN_WORKER: $(T0_DUALTOR_INSTANCE_NUM) | ||
MAX_WORKER: $(T0_DUALTOR_INSTANCE_NUM) | ||
COMMON_EXTRA_PARAMS: "--disable_loganalyzer " | ||
KVM_IMAGE_BRANCH: "master" | ||
MGMT_BRANCH: "master" | ||
BUILD_REASON: "BaselineTest" | ||
RETRY_TIMES: "0" | ||
STOP_ON_FAILURE: "False" | ||
TEST_PLAN_NUM: $(BASELINE_MGMT_PUBLIC_MASTER_TEST_NUM) | ||
|
||
- job: multi_asic_elastictest | ||
displayName: "kvmtest-multi-asic-t1-lag by Elastictest" | ||
timeoutInMinutes: 240 | ||
continueOnError: false | ||
pool: ubuntu-20.04 | ||
steps: | ||
- template: ../run-test-elastictest-template.yml | ||
parameters: | ||
TOPOLOGY: t1-8-lag | ||
TEST_SET: multi-asic-t1-lag | ||
MIN_WORKER: $(MULTI_ASIC_INSTANCE_NUM) | ||
MAX_WORKER: $(MULTI_ASIC_INSTANCE_NUM) | ||
NUM_ASIC: 4 | ||
KVM_IMAGE_BRANCH: "master" | ||
MGMT_BRANCH: "master" | ||
BUILD_REASON: "BaselineTest" | ||
RETRY_TIMES: "0" | ||
STOP_ON_FAILURE: "False" | ||
TEST_PLAN_NUM: $(BASELINE_MGMT_PUBLIC_MASTER_TEST_NUM) | ||
|
||
- job: sonic_t0_elastictest | ||
displayName: "kvmtest-t0-sonic by Elastictest" | ||
timeoutInMinutes: 240 | ||
continueOnError: false | ||
pool: ubuntu-20.04 | ||
steps: | ||
- template: ../run-test-elastictest-template.yml | ||
parameters: | ||
TOPOLOGY: t0-64-32 | ||
MIN_WORKER: $(T0_SONIC_INSTANCE_NUM) | ||
MAX_WORKER: $(T0_SONIC_INSTANCE_NUM) | ||
TEST_SET: t0-sonic | ||
COMMON_EXTRA_PARAMS: "--neighbor_type=sonic " | ||
VM_TYPE: vsonic | ||
KVM_IMAGE_BRANCH: "master" | ||
MGMT_BRANCH: "master" | ||
BUILD_REASON: "BaselineTest" | ||
RETRY_TIMES: "0" | ||
STOP_ON_FAILURE: "False" | ||
TEST_PLAN_NUM: $(BASELINE_MGMT_PUBLIC_MASTER_TEST_NUM) | ||
|
||
- job: dpu_elastictest | ||
displayName: "kvmtest-dpu by Elastictest" | ||
timeoutInMinutes: 240 | ||
continueOnError: false | ||
pool: ubuntu-20.04 | ||
steps: | ||
- template: ../run-test-elastictest-template.yml | ||
parameters: | ||
TOPOLOGY: dpu | ||
MIN_WORKER: $(T0_SONIC_INSTANCE_NUM) | ||
MAX_WORKER: $(T0_SONIC_INSTANCE_NUM) | ||
KVM_IMAGE_BRANCH: "master" | ||
MGMT_BRANCH: "master" | ||
BUILD_REASON: "BaselineTest" | ||
RETRY_TIMES: "0" | ||
STOP_ON_FAILURE: "False" | ||
TEST_PLAN_NUM: $(BASELINE_MGMT_PUBLIC_MASTER_TEST_NUM) |
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,65 @@ | ||
import os | ||
import sys | ||
import logging | ||
import json | ||
|
||
_self_dir = os.path.dirname(os.path.abspath(__file__)) | ||
base_path = os.path.realpath(os.path.join(_self_dir, "..")) | ||
if base_path not in sys.path: | ||
sys.path.append(base_path) | ||
ansible_path = os.path.realpath(os.path.join(_self_dir, "../ansible")) | ||
if ansible_path not in sys.path: | ||
sys.path.append(ansible_path) | ||
|
||
from tests.common.plugins.pdu_controller.pdu_manager import pdu_manager_factory # noqa E402 | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
def get_pdu_managers(sonichosts, conn_graph_facts): | ||
"""Get PDU managers for all the devices to be upgraded. | ||
Args: | ||
sonichosts (SonicHosts): Instance of class SonicHosts | ||
conn_graph_facts (dict): Connection graph dict. | ||
Returns: | ||
dict: A dict of PDU managers. Key is device hostname. Value is the PDU manager object for the device. | ||
""" | ||
pdu_managers = {} | ||
device_pdu_links = conn_graph_facts['device_pdu_links'] | ||
device_pdu_info = conn_graph_facts['device_pdu_info'] | ||
for hostname in sonichosts.hostnames: | ||
pdu_links = device_pdu_links[hostname] | ||
pdu_info = device_pdu_info[hostname] | ||
pdu_vars = {} | ||
for pdu_name in pdu_info.keys(): | ||
pdu_vars[pdu_name] = sonichosts.get_host_visible_vars(pdu_name) | ||
|
||
pdu_managers[hostname] = pdu_manager_factory(hostname, pdu_links, pdu_info, pdu_vars) | ||
return pdu_managers | ||
|
||
|
||
def check_reachability(localhost, sonichosts): | ||
hosts_reachability = {} | ||
|
||
logger.info("Check ICMP ping") | ||
for hostname, ip in zip(sonichosts.hostnames, sonichosts.ips): | ||
hosts_reachability[hostname] = True | ||
logger.info("Ping {} @{} from localhost".format(hostname, ip)) | ||
ping_failed = localhost.command( | ||
"timeout 2 ping {} -c 1".format(ip), module_ignore_errors=True | ||
).get("localhost", {}).get("failed") | ||
if ping_failed: | ||
logger.info("Ping {} @{} from localhost failed.".format(hostname, ip)) | ||
hosts_reachability[hostname] = False | ||
|
||
logger.info("Check if ansible can SSH to sonichosts") | ||
for hostname, ping_result in sonichosts.ping(module_ignore_errors=True).items(): | ||
if ping_result["failed"]: | ||
logger.info("SSH to {} failed.".format(hostname)) | ||
hosts_reachability[hostname] = False | ||
|
||
logger.info("Hosts reachability: {}".format(json.dumps(hosts_reachability, indent=2))) | ||
|
||
return hosts_reachability |
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
Oops, something went wrong.