Skip to content

Commit 28f3c99

Browse files
authored
Merge branch 'master' into bgp_dev
2 parents 8cf6217 + 48d7fe7 commit 28f3c99

File tree

63 files changed

+1131
-639
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+1131
-639
lines changed

.azure-pipelines/pr_test_scripts.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ t0:
3838
- override_config_table/test_override_config_table.py
3939
- pc/test_po_cleanup.py
4040
- pc/test_po_update.py
41-
# - platform_tests/test_advanced_reboot.py::test_warm_reboot
41+
- platform_tests/test_advanced_reboot.py::test_warm_reboot
4242
- platform_tests/test_cpu_memory_usage.py
4343
- process_monitoring/test_critical_process_monitoring.py
4444
- radv/test_radv_ipv6_ra.py
@@ -99,6 +99,7 @@ t1-lag:
9999
- container_checker/test_container_checker.py
100100
- generic_config_updater/test_mmu_dynamic_threshold_config_update.py
101101
- http/test_http_copy.py
102+
- iface_namingmode/test_iface_namingmode.py
102103
- ipfwd/test_mtu.py
103104
- lldp/test_lldp.py
104105
- monit/test_monit_status.py

.azure-pipelines/run-test-scheduler-template.yml

-4
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,6 @@ parameters:
105105
type: number
106106
default: 480
107107

108-
- name: SPECIFIED_PARAMS
109-
type: string
110-
default: "{}"
111108

112109
steps:
113110
- script: |
@@ -121,7 +118,6 @@ steps:
121118
--test-set ${{ parameters.TEST_SET }} --kvm-build-id $(KVM_BUILD_ID) \
122119
--deploy-mg-extra-params "${{ parameters.DEPLOY_MG_EXTRA_PARAMS }}" \
123120
--common-extra-params "${{ parameters.COMMON_EXTRA_PARAMS }}" \
124-
--specified-params "${{ parameters.SPECIFIED_PARAMS }}" \
125121
--vm-type ${{ parameters.VM_TYPE }} --num-asic ${{ parameters.NUM_ASIC }} \
126122
--image_url ${{ parameters.IMAGE_URL }} \
127123
--hwsku ${{ parameters.HWSKU }} \

.azure-pipelines/test_plan.py

+59-29
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@
1313
from enum import Enum
1414

1515
__metaclass__ = type
16+
BUILDIMAGE_REPO_FLAG = "buildimage"
17+
MGMT_REPO_FLAG = "sonic-mgmt"
18+
INTERNAL_REPO_LIST = ["Networking-acs-buildimage", "sonic-mgmt-int"]
19+
GITHUB_SONIC_MGMT_REPO = "https://github.com/sonic-net/sonic-mgmt"
20+
INTERNAL_SONIC_MGMT_REPO = "https://dev.azure.com/mssonic/internal/_git/sonic-mgmt-int"
1621
PR_TEST_SCRIPTS_FILE = "pr_test_scripts.yaml"
22+
SPECIFIC_PARAM_KEYWORD = "specific_param"
1723
TOLERATE_HTTP_EXCEPTION_TIMES = 20
1824
TOKEN_EXPIRE_HOURS = 6
1925

@@ -34,7 +40,10 @@ def get_test_scripts(test_set):
3440
pr_test_scripts_file = os.path.join(os.path.dirname(_self_path), PR_TEST_SCRIPTS_FILE)
3541
with open(pr_test_scripts_file) as f:
3642
pr_test_scripts = yaml.safe_load(f)
37-
return pr_test_scripts.get(test_set, [])
43+
44+
test_script_list = pr_test_scripts.get(test_set, [])
45+
specific_param_list = pr_test_scripts.get(SPECIFIC_PARAM_KEYWORD, {}).get(test_set, [])
46+
return test_script_list, specific_param_list
3847

3948

4049
def test_plan_status_factory(status):
@@ -69,7 +78,7 @@ def print_logs(self, test_plan_id, resp_data, start_time):
6978
status = resp_data.get("status", None)
7079
current_status = test_plan_status_factory(status).get_status()
7180

72-
if(current_status == self.get_status()):
81+
if current_status == self.get_status():
7382
print("Test plan id: {}, status: {}, elapsed: {:.0f} seconds"
7483
.format(test_plan_id, resp_data.get("status", None), time.time() - start_time))
7584

@@ -203,20 +212,34 @@ def create(self, topology, test_plan_name="my_test_plan", deploy_mg_extra_params
203212
print("Test scripts to be covered in this test plan:")
204213
print(json.dumps(scripts, indent=4))
205214

206-
common_params = ["--completeness_level=confident", "--allow_recover"]
207-
for param in common_extra_params:
208-
common_params.append(param)
215+
common_extra_params = common_extra_params + " --completeness_level=confident --allow_recover"
216+
217+
# If triggered by the internal repos, use internal sonic-mgmt repo as the code base
218+
sonic_mgmt_repo_url = GITHUB_SONIC_MGMT_REPO
219+
if kwargs.get("source_repo") in INTERNAL_REPO_LIST:
220+
sonic_mgmt_repo_url = INTERNAL_SONIC_MGMT_REPO
221+
222+
# If triggered by mgmt repo, use pull request id as the code base
223+
sonic_mgmt_pull_request_id = ""
224+
if MGMT_REPO_FLAG in kwargs.get("source_repo"):
225+
sonic_mgmt_pull_request_id = pr_id
226+
227+
# If triggered by buildimage repo, use image built from the buildId
228+
kvm_image_build_id = kvm_build_id
229+
if BUILDIMAGE_REPO_FLAG in kwargs.get("source_repo"):
230+
kvm_image_build_id = build_id
209231

210232
payload = json.dumps({
211233
"name": test_plan_name,
212234
"testbed": {
213235
"platform": platform,
214236
"name": testbed_name,
215237
"topology": topology,
216-
"image_url": image_url,
217238
"hwsku": hwsku,
218239
"min": min_worker,
219-
"max": max_worker
240+
"max": max_worker,
241+
"nbr_type": kwargs["vm_type"],
242+
"asic_num": kwargs["num_asic"]
220243
},
221244
"test_option": {
222245
"stop_on_failure": kwargs.get("stop_on_failure", True),
@@ -227,30 +250,36 @@ def create(self, topology, test_plan_name="my_test_plan", deploy_mg_extra_params
227250
"features_exclude": features_exclude,
228251
"scripts_exclude": scripts_exclude
229252
},
230-
"common_params": common_params,
231-
"specified_params": json.loads(kwargs['specified_params']),
232-
"deploy_mg_params": deploy_mg_extra_params
253+
"image": {
254+
"url": image_url,
255+
"release": "",
256+
"kvm_image_build_id": kvm_image_build_id
257+
},
258+
"sonic_mgmt": {
259+
"repo_url": sonic_mgmt_repo_url,
260+
"branch": kwargs["mgmt_branch"],
261+
"pull_request_id": sonic_mgmt_pull_request_id
262+
},
263+
"common_param": common_extra_params,
264+
"specific_param": kwargs.get("specific_param", []),
265+
"deploy_mg_param": deploy_mg_extra_params,
266+
"max_execute_seconds": kwargs.get("max_execute_seconds", None),
267+
"dump_kvm_if_fail": kwargs.get("dump_kvm_if_fail", False),
233268
},
234269
"type": test_plan_type,
235-
"extra_params": {
236-
"pull_request_id": pr_id,
237-
"build_id": build_id,
270+
"trigger": {
271+
"requester": kwargs.get("requester", "Pull Request"),
238272
"source_repo": kwargs.get("source_repo"),
239-
"kvm_build_id": kvm_build_id,
240-
"max_execute_seconds": kwargs.get("max_execute_seconds", None),
241-
"dump_kvm_if_fail": kwargs.get("dump_kvm_if_fail", 2),
242-
"mgmt_branch": kwargs["mgmt_branch"],
243-
"testbed": {
244-
"num_asic": kwargs["num_asic"],
245-
"vm_type": kwargs["vm_type"]
246-
},
273+
"pull_request_id": pr_id,
274+
"build_id": build_id
275+
},
276+
"extra_params": {
247277
"secrets": {
248278
"azp_access_token": kwargs["azp_access_token"],
249279
"azp_repo_access_token": kwargs["azp_repo_access_token"],
250280
}
251281
},
252-
"priority": 10,
253-
"requester": kwargs.get("requester", "Pull Request")
282+
"priority": 10
254283
})
255284
print('Creating test plan with payload: {}'.format(payload))
256285
headers = {
@@ -351,11 +380,8 @@ def poll(self, test_plan_id, interval=60, timeout=-1, expected_state=""):
351380
elif expected_status.get_status() < current_status.get_status():
352381
steps = None
353382
step_status = None
354-
extra_params = resp_data.get("extra_params", None)
355383
runtime = resp_data.get("runtime", None)
356-
if extra_params and "steps" in extra_params:
357-
steps = extra_params.get("steps", None)
358-
else:
384+
if runtime:
359385
steps = runtime.get("steps", None)
360386
if steps:
361387
for step in steps:
@@ -485,8 +511,9 @@ def poll(self, test_plan_id, interval=60, timeout=-1, expected_state=""):
485511
"--common-extra-params",
486512
type=str,
487513
dest="common_extra_params",
514+
nargs='?',
515+
const="",
488516
default="",
489-
nargs='*',
490517
required=False,
491518
help="Run test common extra params"
492519
)
@@ -769,10 +796,12 @@ def poll(self, test_plan_id, interval=60, timeout=-1, expected_state=""):
769796
).replace(' ', '_')
770797

771798
scripts = args.scripts
799+
specific_param = []
772800
# For KVM PR test, get test modules from pr_test_scripts.yaml, otherwise use args.scripts
773801
if args.platform == "kvm":
774802
args.test_set = args.test_set if args.test_set else args.topology
775-
scripts = ",".join(get_test_scripts(args.test_set))
803+
scripts, specific_param = get_test_scripts(args.test_set)
804+
scripts = ",".join(scripts)
776805

777806
tp.create(
778807
args.topology,
@@ -792,6 +821,7 @@ def poll(self, test_plan_id, interval=60, timeout=-1, expected_state=""):
792821
common_extra_params=args.common_extra_params,
793822
num_asic=args.num_asic,
794823
specified_params=args.specified_params,
824+
specific_param=specific_param,
795825
vm_type=args.vm_type,
796826
azp_access_token=args.azp_access_token,
797827
azp_repo_access_token=args.azp_repo_access_token,

ansible/ansible.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
inventory = /etc/ansible/hosts
1515
library = library:library/ixia
1616
module_utils = module_utils
17-
remote_tmp = $HOME/.ansible/tmp
17+
remote_tmp = /tmp/.ansible-$USER
1818
pattern = *
1919
forks = 5
2020
poll_interval = 15

ansible/config_sonic_basedon_testbed.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@
6565
set_fact:
6666
ptf_image: "{{ testbed_facts['ptf_image_name'] }}"
6767

68+
- name: check if testbed is an ixia testbed
69+
set_fact:
70+
is_ixia_testbed: "{{ true if ptf_image == 'docker-keysight-api-server' else false }}"
71+
6872
- name: set vm
6973
set_fact:
7074
vm_base: "{% if testbed_facts['vm_base'] != '' %}{{ testbed_facts['vm_base'] }}{% else %}''{% endif %}"
@@ -197,7 +201,7 @@
197201
- name: enable tunnel_qos_remap for T1 in dualtor deployment
198202
set_fact:
199203
enable_tunnel_qos_remap: true
200-
when: "('leafrouter' == (vm_topo_config['dut_type'] | lower)) and (hwsku in hwsku_list_dualtor_t1)"
204+
when: "('leafrouter' == (vm_topo_config['dut_type'] | lower)) and (hwsku in hwsku_list_dualtor_t1) and not (is_ixia_testbed)"
201205

202206
- name: set default vm file path
203207
set_fact:
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import "nic_simulator_grpc_service.proto"
2-
syntax = "proto3"
1+
syntax = "proto3";
2+
import "nic_simulator_grpc_service.proto";
33

44

55
service DualTorMgmtService {
@@ -15,42 +15,42 @@ service DualTorMgmtService {
1515
}
1616

1717
message ListOfAdminRequest {
18-
repeated string nic_addresses = 1
19-
repeated AdminRequest admin_requests = 2
18+
repeated string nic_addresses = 1;
19+
repeated AdminRequest admin_requests = 2;
2020
}
2121

2222
message ListOfAdminReply {
23-
repeated string nic_addresses = 1
24-
repeated AdminReply admin_replies = 2
23+
repeated string nic_addresses = 1;
24+
repeated AdminReply admin_replies = 2;
2525
}
2626

2727
message ListOfOperationRequest {
28-
repeated string nic_addresses = 1
29-
repeated OperationRequest operation_requests = 2
28+
repeated string nic_addresses = 1;
29+
repeated OperationRequest operation_requests = 2;
3030
}
3131

3232
message ListOfOperationReply {
33-
repeated string nic_addresses = 1
34-
repeated OperationReply operation_replies = 2
33+
repeated string nic_addresses = 1;
34+
repeated OperationReply operation_replies = 2;
3535
}
3636

3737
message ListOfDropRequest {
38-
repeated string nic_addresses = 1
39-
repeated DropRequest drop_requests = 2
38+
repeated string nic_addresses = 1;
39+
repeated DropRequest drop_requests = 2;
4040
}
4141

4242
message ListOfDropReply {
43-
repeated string nic_addresses = 1
44-
repeated DropReply drop_replies = 2
43+
repeated string nic_addresses = 1;
44+
repeated DropReply drop_replies = 2;
4545
}
4646

4747
message ListOfNiCServerAdminStateRequest {
48-
repeated string nic_addresses = 1
49-
repeated bool admin_states = 2
48+
repeated string nic_addresses = 1;
49+
repeated bool admin_states = 2;
5050
}
5151

5252
message ListOfNiCServerAdminStateReply {
53-
repeated string nic_addresses = 1
54-
repeated bool admin_states = 2
55-
repeated bool successes = 3
53+
repeated string nic_addresses = 1;
54+
repeated bool admin_states = 2;
55+
repeated bool successes = 3;
5656
}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
syntax = "proto3"
1+
syntax = "proto3";
22

33
service DualToRActive {
44
rpc QueryAdminForwardingPortState(AdminRequest) returns(AdminReply) {}
@@ -15,48 +15,48 @@ service DualToRActive {
1515
}
1616

1717
message AdminRequest {
18-
repeated int32 portid = 1
19-
repeated bool state = 2
18+
repeated int32 portid = 1;
19+
repeated bool state = 2;
2020
}
2121

2222
message AdminReply {
23-
repeated int32 portid = 1
24-
repeated bool state = 2
23+
repeated int32 portid = 1;
24+
repeated bool state = 2;
2525
}
2626

2727
message OperationRequest {
28-
repeated int32 portid = 1
28+
repeated int32 portid = 1;
2929
}
3030

3131
message OperationReply {
32-
repeated int32 portid = 1
33-
repeated bool state = 2
32+
repeated int32 portid = 1;
33+
repeated bool state = 2;
3434
}
3535

3636
message LinkStateRequest {
37-
repeated int32 portid = 1
37+
repeated int32 portid = 1;
3838
}
3939

4040
message LinkStateReply {
41-
repeated int32 portid = 1
42-
repeated bool state = 2
41+
repeated int32 portid = 1;
42+
repeated bool state = 2;
4343
}
4444

4545
message ServerVersionRequest {
46-
string version = 1
46+
string version = 1;
4747
}
4848

4949
message ServerVersionReply {
50-
string version = 1
50+
string version = 1;
5151
}
5252

5353
message DropRequest {
54-
repeated int32 portid = 1
55-
repeated int32 direction = 2
56-
bool recover = 3
54+
repeated int32 portid = 1;
55+
repeated int32 direction = 2;
56+
bool recover = 3;
5757
}
5858

5959
message DropReply {
60-
repeated int32 portid = 1
61-
repeated bool success = 2
60+
repeated int32 portid = 1;
61+
repeated bool success = 2;
6262
}

0 commit comments

Comments
 (0)