eSIM RSP 测试用例对比站

人工切片(-man) ↔ Cas 盲生成(-cas)· 真机真卡执行证据对照

源码对照:5.2.5.2.1

删除 Profile 及其 ISD-P 组件 / TC_eUICC_DeleteProfile_ISDP_And_Components

左侧为人工切片入口(-man,来自 原料/切片 的最小可执行脚本),右侧为 Cas 盲生成入口(-cas,仅依据规范生成)。文件按原始编码(多为 GBK)解码为 UTF-8 显示,行号自 1 起;字节级原文与 sha256 见两侧脚本包。完整 unified diff 见本页底部折叠区,以及 报告原文 §4。
-man 入口
Import/TestCase_SGP_23.js
165 行 / 6647 字符 / gb18030
-cas 入口
TC_eUICC_DeleteProfile_ISDP_And_Components/Import/TC_eUICC_DeleteProfile_ISDP_And_Components.js
113 行 / 9457 字符 / gb18030
默认折行显示长行;取消勾选可横向滚动查看原始行宽
-man 人工切片Import/TestCase_SGP_23.js165 行 / 6647 字符 / gb18030入口函数 @L3
1// slice of Import\TestCase_SGP_23.js - cases: TC_eUICC_DeleteProfile_ISDP_And_Components_01_Nominal_ISD_P_and_Profile_Components_Deletion (extracted verbatim)
2
3function TC_eUICC_DeleteProfile_ISDP_And_Components_01_Nominal_ISD_P_and_Profile_Components_Deletion()
4{
5	
6	tracenamestr = "验证删除profile后,eUICC移除ISD-P和所有profile内容,并且检查空间变化";
7	curDis.TraceStart(sno++,tracenamestr);
8	
9	curLogicChannel = 0;
10	curDis.TestStepStart2(stno++,"eUICC卡片初始化;");
11	Ini_powerOn_eUICC_LPAe_not_activate();
12	
13	curDis.TestStepStart2(stno++,"读卡器向卡片发送MANAGE_CHANNEL命令,打开辅助逻辑通道;");
14	TS_MANAGE_CHANNEL_OPEN();
15	
16	curLogicChannel = 1;
17	
18	curDis.TestStepStart2(stno++,"读卡器向卡片发送SELECT命令,选择ISD-R;");
19	TS_SELECT("Select ISD",ISD_R_AID,"9000");
20	
21	curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行GetEuiccInfo2Request,获取eUICC的剩余不可变空间;");
22	var euiccInfo2 = new EUICCInfo2();
23	var hexData = LPAd_Transport_data_to_eUICC(GetEuiccInfo2RequestHexStr);
24	
25	euiccInfo2.checkCardResDataFormat(hexData);
26	
27	var FREE_MEMORY_NO_PROFILE = 0;
28	
29	try
30	{
31		if (check_format_extCardResource)
32			FREE_MEMORY_NO_PROFILE = parseInt(euiccInfo2.extCardResource.FreeNonVolatileMemory, 16);
33		else
34		{
35			var extCardResourceObj = new ExtendedCardResource();
36			extCardResourceObj.SetHexData(euiccInfo2.extCardResource);
37			FREE_MEMORY_NO_PROFILE = parseInt(extCardResourceObj.FreeNonVolatileMemory, 16);
38		}
39	}catch(e){
40		obj.SubLevel(ProfileInfoListResponse_Data_Error, level_of_SubLevel.error);
41	}
42	
43	curDis.TestStepStart2(stno++,"下载PROFILE_OPERATIONAL1;");
44	var Profile_load_procedure = new RSP_profile_load_procedure_LPAd(PROFILE_OPERATIONAL1_DATA);
45	Profile_load_procedure.ICCID = ICCID_OP_PROF1;
46	Profile_load_procedure.ES10b_GetEUICCInfo1();
47
48	Profile_load_procedure.ES10b_GetEUICCChallenge();
49
50	Profile_load_procedure.ES10b_AuthenticateServer();
51	
52	Profile_load_procedure.ES10b_PrepareDownload();
53	
54	Profile_load_procedure.ES10b_GetEID();
55	
56	Profile_load_procedure.serviceProviderName = SP_NAME1;	//SP Name 1
57	Profile_load_procedure.profileName = PROFILE_OPERATIONAL1_NAME1;
58	Profile_load_procedure.iconType = "01";
59	Profile_load_procedure.icon = ICON_OP_PROF1;
60	Profile_load_procedure.notificationConfigurationInfo = new SequenceOfElement("30");
61	Profile_load_procedure.notificationConfigurationInfo.arrOfElement[0] = new NotificationConfigurationInformation();
62	Profile_load_procedure.notificationConfigurationInfo.arrOfElement[0].profileManagementOperation = "04F0";
63	Profile_load_procedure.notificationConfigurationInfo.arrOfElement[0].notificationAddress = TEST_DP_ADDRESS1;;
64	Profile_load_procedure.profileOwner = OWNER_OP_PROF1;
65	Profile_load_procedure.profileClass = "02";
66	Profile_load_procedure.mccMnc = MCC_MNC1;
67	Profile_load_procedure.ES10b_LoadBoundProfilePackage();
68	var ISD_P_Test01 = curProfile_ISD_P_AID;
69	
70	curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行RetrieveNotificationsList。移除卡内所有INSTALL通知;");
71	Profile_load_procedure.ES10b_ListNotification("0780");
72	
73	
74	var NotificationLen = Profile_load_procedure.listNotificationResponse.notificationMetadataList.arrOfElement.length;
75	
76	for(var i=0;i<NotificationLen;i++)
77	{
78		var parameter = Profile_load_procedure.listNotificationResponse.notificationMetadataList.arrOfElement[i].seqNumber;
79	    Profile_load_procedure.ES10b_RemoveNotificationFromList(parameter);
80	    var deleteNotificationStatus=Profile_load_procedure.notificationSentResponse.deleteNotificationStatus;
81	    curStrHandle.CheckData("00", deleteNotificationStatus, "deleteNotificationStatus");
82	}
83	
84	curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行GetEuiccInfo2Request,获取eUICC的剩余不可变空间;");
85	var hexData = LPAd_Transport_data_to_eUICC(GetEuiccInfo2RequestHexStr);
86	
87	var euiccInfo2 = new EUICCInfo2();
88	euiccInfo2.checkCardResDataFormat(hexData);
89	
90	var FREE_MEM_OP_PROF_INSTALLED = 0;
91	
92	try
93	{
94		if (check_format_extCardResource)
95			FREE_MEM_OP_PROF_INSTALLED = parseInt(euiccInfo2.extCardResource.FreeNonVolatileMemory, 16);
96		else
97		{
98			var extCardResourceObj = new ExtendedCardResource();
99			extCardResourceObj.SetHexData(euiccInfo2.extCardResource);
100			FREE_MEM_OP_PROF_INSTALLED = parseInt(extCardResourceObj.FreeNonVolatileMemory, 16);
101		}
102	}catch(e){
103		obj.SubLevel(ProfileInfoListResponse_Data_Error, level_of_SubLevel.error);
104	}
105	
106	if (FREE_MEMORY_NO_PROFILE > FREE_MEM_OP_PROF_INSTALLED)
107		obj.SubLevel("下载profile后卡片剩余不可变空间变小了", 1);
108	else
109		obj.SubLevel("下载profile后卡片剩余不可变空间没有变小", 0);
110	
111	curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行DeleteProfileRequest,删除PROFILE_OPERATIONAL1;");
112	var deleProfileRequest = new DeleteProfileRequest();
113	deleProfileRequest.iccid = ICCID_OP_PROF1;
114	deleProfileRequest.GenHexData();
115	var respData = LPAd_Transport_data_to_eUICC(deleProfileRequest.hexData);
116	
117	curStrHandle.CheckData("BF3303800100", respData, "DeleteProfileResponse");
118	
119	curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行RetrieveNotificationsList。移除卡内所有DELETE通知;");
120	Profile_load_procedure.ES10b_ListNotification("0410");
121	
122	var NotificationLen = Profile_load_procedure.listNotificationResponse.notificationMetadataList.arrOfElement.length;
123	
124	for(var i=0;i<NotificationLen;i++)
125	{
126		var parameter = Profile_load_procedure.listNotificationResponse.notificationMetadataList.arrOfElement[i].seqNumber;
127	    Profile_load_procedure.ES10b_RemoveNotificationFromList(parameter);
128	    var deleteNotificationStatus=Profile_load_procedure.notificationSentResponse.deleteNotificationStatus;
129	    curStrHandle.CheckData("00", deleteNotificationStatus, "deleteNotificationStatus");
130	}
131	
132	
133	curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行GetEuiccInfo2Request,获取eUICC的剩余不可变空间;");
134	var euiccInfo2 = new EUICCInfo2();
135	var hexData = LPAd_Transport_data_to_eUICC(GetEuiccInfo2RequestHexStr);
136	
137	euiccInfo2.checkCardResDataFormat(hexData);
138	
139	var FREE_MEMORY_NO_PROFILE2 = 0;
140	
141	try
142	{
143		if (check_format_extCardResource)
144			FREE_MEMORY_NO_PROFILE2 = parseInt(euiccInfo2.extCardResource.FreeNonVolatileMemory, 16);
145		else
146		{
147			var extCardResourceObj = new ExtendedCardResource();
148			extCardResourceObj.SetHexData(euiccInfo2.extCardResource);
149			FREE_MEMORY_NO_PROFILE2 = parseInt(extCardResourceObj.FreeNonVolatileMemory, 16);
150		}
151	}catch(e){
152		obj.SubLevel(ProfileInfoListResponse_Data_Error, level_of_SubLevel.error);
153	}
154	
155	if (FREE_MEMORY_NO_PROFILE2 > FREE_MEM_OP_PROF_INSTALLED)
156		obj.SubLevel("删除后的卡片剩余不可变空间变大了", 1);
157	else
158		obj.SubLevel("删除后的卡片剩余不可变空间没有变大", 0);
159	
160	curStrHandle.CheckData(FREE_MEMORY_NO_PROFILE, FREE_MEMORY_NO_PROFILE2, "剩余不可变空间");
161	
162	
163	RecoverCard();
164}
165
-cas 盲生成TC_eUICC_DeleteProfile_ISDP_And_Components/Import/TC_eUICC_DeleteProfile_ISDP_And_Components.js113 行 / 9457 字符 / gb18030入口函数 @L15
1// Author: 卡思Cas智能体
2// Date: 20261004-022947
3// Function: (purpose 原文未由 SGP.23 该 TC 提供,corpus vacuum 登记)TC_eUICC_DeleteProfile_ISDP_And_Components,Test Sequence #01 Nominal: ISD-P and Profile Components Deletion(本 TC 单条 Test Sequence),适用性 M。
4// Test points: ICH-IC1-K1-C1 ATR_present;ICH-IC1-K2-C2 FCP_Template;ICH-IC1-K2-C4 SW
5//   ICH-IC1-K3-C4 SW;ICH-IC1-K4-C4 final SW;ICH-IC2-K1-C4 SW;ICH-IC2-K1-C3 CHANNEL_NUMBER extracted
6//   ICH-IC2-K2-C4 SW;S1-C1 R_EUICC_INFO2 outer tag;S1-C1 R_EUICC_INFO2 required members present
7//   S1-C2 free non-volatile memory tag 82 present;S4-C1 R_EUICC_INFO2 outer tag
8//   S4-C1 R_EUICC_INFO2 required members present;S4-C2 free non-volatile memory tag 82 present
9//   S4-C3 free non-volatile memory lower than step 1;S7-C1 R_EUICC_INFO2 outer tag
10//   S7-C1 R_EUICC_INFO2 required members present;S7-C2 free non-volatile memory tag 82 present
11//   S7-C3 free non-volatile memory higher than step 4
12// 本函数由 CaseIR 5.2.5.2.1 编译生成(5.2.5.2.1-TC_eUICC_DeleteProfile_ISDP_And_Components-20261004_022947,SGP.23 v1.16 × SGP.22 v2.7):字节权威=CaseIR,非誊录黄金脚本。
13// Value-free template: every data byte is injected from CaseIR fields; no scaffold globals (see docs/speconly/compile-symbol-migration.md).
14// 适用性 M:编译期门,运行时由 harness 环境前置承担。
15function TC_eUICC_DeleteProfile_ISDP_And_Components_01_merged() {
16    var bind = curBind;
17    // SEQ-IC-1 卡态声明(E 段 Initial Conditions,编排责任):There is no Profile installed on the eUICC: declared unexpanded (non-PROC row or K corpus vacuum; see CaseIR open_items).
18
19    // IC head inline (initial_conditions → PROC_EUICC_INITIALIZATION_SEQUENCE, K row 1):RESET(K 语料机械展开)
20    var s8 = bind.resetAndAtr();
21    bind.checkData("ICH-IC1-K1-C1 ATR_present", "1", s8.atr_hex !== "" ? "1" : "0");
22
23    // IC head inline (initial_conditions → PROC_EUICC_INITIALIZATION_SEQUENCE, K row 2):SELECT_MF(K 语料机械展开)
24    // FCP outer tag not materialized from clause: tag-face asserted only when corpus fixes the tag byte (e.g. TS 102 221 FCP '62').
25    var s9 = bind.sendApdu("00", "A4", "00", "04", "3F00", "00", "9000");
26    bind.checkData("ICH-IC1-K2-C2 FCP_Template", "1", s9.resp.length > 0 ? "1" : "0");
27    bind.checkData("ICH-IC1-K2-C4 SW", "9000", s9.sw);
28
29    // IC head inline (initial_conditions → PROC_EUICC_INITIALIZATION_SEQUENCE, K row 3):TERMINAL_CAPABILITY_LPAd(K 语料机械展开)
30    var s10 = bind.sendApdu("80", "AA", "00", "00", "A9058100830107", null, "9000");
31    bind.checkData("ICH-IC1-K3-C4 SW", "9000", s10.sw);
32
33    // IC head inline (initial_conditions → PROC_EUICC_INITIALIZATION_SEQUENCE, K row 4):TERMINAL_PROFILE(K 语料机械展开)
34    var steady11 = bind.runToSteadyState(function () {
35        return bind.sendTerminalProfile("FFFFFFFF7F9D00DFBF00001FE2000000C7EB0000000168005000000000000200", "9000");
36    });
37    bind.checkData("ICH-IC1-K4-C4 final SW", "9000", steady11.final.sw);
38
39    // IC head inline (initial_conditions → PROC_OPEN_LOGICAL_CHANNEL_AND_SELECT_ISDR, K row 1):MANAGE_CHANNEL_OPEN(K 语料机械展开)
40    // CHANNEL_NUMBER extraction and dynamic CLA rebinding are CasBind internal state (chaining rule; no generated-code re-implementation).
41    var s12 = bind.manageChannelOpen("9000");
42    bind.checkData("ICH-IC2-K1-C4 SW", "9000", s12.sw);
43    bind.checkData("ICH-IC2-K1-C3 CHANNEL_NUMBER extracted", "1", s12.chan !== null ? "1" : "0");
44
45    // IC head inline (initial_conditions → PROC_OPEN_LOGICAL_CHANNEL_AND_SELECT_ISDR, K row 2):MTD_SELECT(K 语料机械展开)
46    // CLA = bound channel (cla_rule) and <L> length binding are CasBind internal state (chaining rule; no generated-code re-implementation).
47    var s13 = bind.sendApdu(null, "A4", "04", "00", "A0000005591010FFFFFFFF8900000100", null, "9000");
48    // MTD_SELECT expected face is SW-only (K Annex C.2 open-channel procedure step 2: no FCI content assertion in corpus); no fabricated template parse.
49    bind.checkData("ICH-IC2-K2-C4 SW", "9000", s13.sw);
50
51    // 步骤 1:MTD_STORE_DATA(tc_step)
52    // <L> length binding and the conditional 61XX + GET RESPONSE chain (D.4.2) are CasBind internal state (chaining rule).
53    var sdCla1 = s12.chan !== null ? (s12.chan <= 3 ? 128 + s12.chan : 188 + s12.chan).toString(16).toUpperCase() : null;
54    var s1 = bind.sendApdu(sdCla1, "E2", "91", "00", "BF2200", "00", null);
55    // geca-proc ES10b Info 响应面(R_EUICC_INFO2,SGP.22 §5.7.7/§5.7.8 结构机械转录;响应外层 tag = 请求 tag):绑定层结构步行 + 在场性断言。
56    var gw1 = BindGecaProc.parseGecaResponse(s1.resp, {outer: "BF22", required: ["81", "82", "83", "84", "85", "88", "A9", "AA", "04", "0C"], optional: ["86", "87"]});
57    bind.checkData("S1-C1 R_EUICC_INFO2 outer tag", "BF22", gw1.outer_tag === null ? "absent" : gw1.outer_tag);
58    bind.checkData("S1-C1 R_EUICC_INFO2 required members present", "1", gw1.ok ? "1" : "0");
59    var ext1 = BindEs10xSingleRequest.parseBerTlv(gw1.fields["84"] || "");
60    var freeVal1 = null; for (var fti1 = 0; fti1 < ext1.length; fti1++) { if (ext1[fti1].tag === "82") { freeVal1 = ext1[fti1].value; } }
61    bind.checkData("S1-C2 free non-volatile memory tag 82 present", "1", freeVal1 !== null ? "1" : "0");
62
63    // 步骤 2:Install PROFILE_OPERATIONAL1(tc_step)
64    // card-state orchestration declaration (no APDU face): execution is
65    // the batch card_state prep framework's responsibility (4227 ruling B
66    // same-family scope; ensure_profile_state / prep_packager);
67    // no fabricated bytes emitted here; see CaseIR unresolved/open_items.
68
69    // 步骤 3:Remove all Install Notifications from eUICC(tc_step)
70    // card-state orchestration declaration (no APDU face): execution is
71    // the batch card_state prep framework's responsibility (4227 ruling B
72    // same-family scope; ensure_profile_state / prep_packager);
73    // no fabricated bytes emitted here; see CaseIR unresolved/open_items.
74
75    // 步骤 4:MTD_STORE_DATA(tc_step;REQ: RQ31_027, RQ31_028, RQ57_051, RQ57_052, RQ57_054, RQ31_183)
76    // <L> length binding and the conditional 61XX + GET RESPONSE chain (D.4.2) are CasBind internal state (chaining rule).
77    var sdCla4 = s12.chan !== null ? (s12.chan <= 3 ? 128 + s12.chan : 188 + s12.chan).toString(16).toUpperCase() : null;
78    var s4 = bind.sendApdu(sdCla4, "E2", "91", "00", "BF2200", "00", null);
79    // geca-proc ES10b Info 响应面(R_EUICC_INFO2,SGP.22 §5.7.7/§5.7.8 结构机械转录;响应外层 tag = 请求 tag):绑定层结构步行 + 在场性断言。
80    var gw4 = BindGecaProc.parseGecaResponse(s4.resp, {outer: "BF22", required: ["81", "82", "83", "84", "85", "88", "A9", "AA", "04", "0C"], optional: ["86", "87"]});
81    bind.checkData("S4-C1 R_EUICC_INFO2 outer tag", "BF22", gw4.outer_tag === null ? "absent" : gw4.outer_tag);
82    bind.checkData("S4-C1 R_EUICC_INFO2 required members present", "1", gw4.ok ? "1" : "0");
83    var ext4 = BindEs10xSingleRequest.parseBerTlv(gw4.fields["84"] || "");
84    var freeVal4 = null; for (var fti4 = 0; fti4 < ext4.length; fti4++) { if (ext4[fti4].tag === "82") { freeVal4 = ext4[fti4].value; } }
85    bind.checkData("S4-C2 free non-volatile memory tag 82 present", "1", freeVal4 !== null ? "1" : "0");
86    bind.checkData("S4-C3 free non-volatile memory lower than step 1", "1", (freeVal4 !== null && freeVal4 !== undefined && freeVal1 !== null && freeVal1 !== undefined && parseInt(freeVal4, 16) < parseInt(freeVal1, 16)) ? "1" : "0");
87
88    // 步骤 5:Delete PROFILE_OPERATIONAL1(tc_step)
89    // card-state orchestration declaration (no APDU face): execution is
90    // the batch card_state prep framework's responsibility (4227 ruling B
91    // same-family scope; ensure_profile_state / prep_packager);
92    // no fabricated bytes emitted here; see CaseIR unresolved/open_items.
93
94    // 步骤 6:Remove the Delete Notification from eUICC(tc_step)
95    // card-state orchestration declaration (no APDU face): execution is
96    // the batch card_state prep framework's responsibility (4227 ruling B
97    // same-family scope; ensure_profile_state / prep_packager);
98    // no fabricated bytes emitted here; see CaseIR unresolved/open_items.
99
100    // 步骤 7:MTD_STORE_DATA(tc_step;REQ: RQ31_027, RQ31_028, RQ57_051, RQ57_052, RQ57_054, RQ24_020)
101    // <L> length binding and the conditional 61XX + GET RESPONSE chain (D.4.2) are CasBind internal state (chaining rule).
102    var sdCla7 = s12.chan !== null ? (s12.chan <= 3 ? 128 + s12.chan : 188 + s12.chan).toString(16).toUpperCase() : null;
103    var s7 = bind.sendApdu(sdCla7, "E2", "91", "00", "BF2200", "00", null);
104    // geca-proc ES10b Info 响应面(R_EUICC_INFO2,SGP.22 §5.7.7/§5.7.8 结构机械转录;响应外层 tag = 请求 tag):绑定层结构步行 + 在场性断言。
105    var gw7 = BindGecaProc.parseGecaResponse(s7.resp, {outer: "BF22", required: ["81", "82", "83", "84", "85", "88", "A9", "AA", "04", "0C"], optional: ["86", "87"]});
106    bind.checkData("S7-C1 R_EUICC_INFO2 outer tag", "BF22", gw7.outer_tag === null ? "absent" : gw7.outer_tag);
107    bind.checkData("S7-C1 R_EUICC_INFO2 required members present", "1", gw7.ok ? "1" : "0");
108    var ext7 = BindEs10xSingleRequest.parseBerTlv(gw7.fields["84"] || "");
109    var freeVal7 = null; for (var fti7 = 0; fti7 < ext7.length; fti7++) { if (ext7[fti7].tag === "82") { freeVal7 = ext7[fti7].value; } }
110    bind.checkData("S7-C2 free non-volatile memory tag 82 present", "1", freeVal7 !== null ? "1" : "0");
111    bind.checkData("S7-C3 free non-volatile memory higher than step 4", "1", (freeVal7 !== null && freeVal7 !== undefined && freeVal4 !== null && freeVal4 !== undefined && parseInt(freeVal7, 16) > parseInt(freeVal4, 16)) ? "1" : "0");
112}
113

完整 unified diff

行级差异:新增 108 行 / 删除 160 行(以 -man 为基准,unified 上下文 3 行)。

展开 diff(276 行)
--- -man
+++ -cas
@@ -1,165 +1,113 @@
-// slice of Import\TestCase_SGP_23.js - cases: TC_eUICC_DeleteProfile_ISDP_And_Components_01_Nominal_ISD_P_and_Profile_Components_Deletion (extracted verbatim)
+// Author: 卡思Cas智能体
+// Date: 20261004-022947
+// Function: (purpose 原文未由 SGP.23 该 TC 提供,corpus vacuum 登记)TC_eUICC_DeleteProfile_ISDP_And_Components,Test Sequence #01 Nominal: ISD-P and Profile Components Deletion(本 TC 单条 Test Sequence),适用性 M。
+// Test points: ICH-IC1-K1-C1 ATR_present;ICH-IC1-K2-C2 FCP_Template;ICH-IC1-K2-C4 SW
+//   ICH-IC1-K3-C4 SW;ICH-IC1-K4-C4 final SW;ICH-IC2-K1-C4 SW;ICH-IC2-K1-C3 CHANNEL_NUMBER extracted
+//   ICH-IC2-K2-C4 SW;S1-C1 R_EUICC_INFO2 outer tag;S1-C1 R_EUICC_INFO2 required members present
+//   S1-C2 free non-volatile memory tag 82 present;S4-C1 R_EUICC_INFO2 outer tag
+//   S4-C1 R_EUICC_INFO2 required members present;S4-C2 free non-volatile memory tag 82 present
+//   S4-C3 free non-volatile memory lower than step 1;S7-C1 R_EUICC_INFO2 outer tag
+//   S7-C1 R_EUICC_INFO2 required members present;S7-C2 free non-volatile memory tag 82 present
+//   S7-C3 free non-volatile memory higher than step 4
+// 本函数由 CaseIR 5.2.5.2.1 编译生成(5.2.5.2.1-TC_eUICC_DeleteProfile_ISDP_And_Components-20261004_022947,SGP.23 v1.16 × SGP.22 v2.7):字节权威=CaseIR,非誊录黄金脚本。
+// Value-free template: every data byte is injected from CaseIR fields; no scaffold globals (see docs/speconly/compile-symbol-migration.md).
+// 适用性 M:编译期门,运行时由 harness 环境前置承担。
+function TC_eUICC_DeleteProfile_ISDP_And_Components_01_merged() {
+    var bind = curBind;
+    // SEQ-IC-1 卡态声明(E 段 Initial Conditions,编排责任):There is no Profile installed on the eUICC: declared unexpanded (non-PROC row or K corpus vacuum; see CaseIR open_items).
 
-function TC_eUICC_DeleteProfile_ISDP_And_Components_01_Nominal_ISD_P_and_Profile_Components_Deletion()
-{
-	
-	tracenamestr = "验证删除profile后,eUICC移除ISD-P和所有profile内容,并且检查空间变化";
-	curDis.TraceStart(sno++,tracenamestr);
-	
-	curLogicChannel = 0;
-	curDis.TestStepStart2(stno++,"eUICC卡片初始化;");
-	Ini_powerOn_eUICC_LPAe_not_activate();
-	
-	curDis.TestStepStart2(stno++,"读卡器向卡片发送MANAGE_CHANNEL命令,打开辅助逻辑通道;");
-	TS_MANAGE_CHANNEL_OPEN();
-	
-	curLogicChannel = 1;
-	
-	curDis.TestStepStart2(stno++,"读卡器向卡片发送SELECT命令,选择ISD-R;");
-	TS_SELECT("Select ISD",ISD_R_AID,"9000");
-	
-	curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行GetEuiccInfo2Request,获取eUICC的剩余不可变空间;");
-	var euiccInfo2 = new EUICCInfo2();
-	var hexData = LPAd_Transport_data_to_eUICC(GetEuiccInfo2RequestHexStr);
-	
-	euiccInfo2.checkCardResDataFormat(hexData);
-	
-	var FREE_MEMORY_NO_PROFILE = 0;
-	
-	try
-	{
-		if (check_format_extCardResource)
-			FREE_MEMORY_NO_PROFILE = parseInt(euiccInfo2.extCardResource.FreeNonVolatileMemory, 16);
-		else
-		{
-			var extCardResourceObj = new ExtendedCardResource();
-			extCardResourceObj.SetHexData(euiccInfo2.extCardResource);
-			FREE_MEMORY_NO_PROFILE = parseInt(extCardResourceObj.FreeNonVolatileMemory, 16);
-		}
-	}catch(e){
-		obj.SubLevel(ProfileInfoListResponse_Data_Error, level_of_SubLevel.error);
-	}
-	
-	curDis.TestStepStart2(stno++,"下载PROFILE_OPERATIONAL1;");
-	var Profile_load_procedure = new RSP_profile_load_procedure_LPAd(PROFILE_OPERATIONAL1_DATA);
-	Profile_load_procedure.ICCID = ICCID_OP_PROF1;
-	Profile_load_procedure.ES10b_GetEUICCInfo1();
+    // IC head inline (initial_conditions → PROC_EUICC_INITIALIZATION_SEQUENCE, K row 1):RESET(K 语料机械展开)
+    var s8 = bind.resetAndAtr();
+    bind.checkData("ICH-IC1-K1-C1 ATR_present", "1", s8.atr_hex !== "" ? "1" : "0");
 
-	Profile_load_procedure.ES10b_GetEUICCChallenge();
+    // IC head inline (initial_conditions → PROC_EUICC_INITIALIZATION_SEQUENCE, K row 2):SELECT_MF(K 语料机械展开)
+    // FCP outer tag not materialized from clause: tag-face asserted only when corpus fixes the tag byte (e.g. TS 102 221 FCP '62').
+    var s9 = bind.sendApdu("00", "A4", "00", "04", "3F00", "00", "9000");
+    bind.checkData("ICH-IC1-K2-C2 FCP_Template", "1", s9.resp.length > 0 ? "1" : "0");
+    bind.checkData("ICH-IC1-K2-C4 SW", "9000", s9.sw);
 
-	Profile_load_procedure.ES10b_AuthenticateServer();
-	
-	Profile_load_procedure.ES10b_PrepareDownload();
-	
-	Profile_load_procedure.ES10b_GetEID();
-	
-	Profile_load_procedure.serviceProviderName = SP_NAME1;	//SP Name 1
-	Profile_load_procedure.profileName = PROFILE_OPERATIONAL1_NAME1;
-	Profile_load_procedure.iconType = "01";
-	Profile_load_procedure.icon = ICON_OP_PROF1;
-	Profile_load_procedure.notificationConfigurationInfo = new SequenceOfElement("30");
-	Profile_load_procedure.notificationConfigurationInfo.arrOfElement[0] = new NotificationConfigurationInformation();
-	Profile_load_procedure.notificationConfigurationInfo.arrOfElement[0].profileManagementOperation = "04F0";
-	Profile_load_procedure.notificationConfigurationInfo.arrOfElement[0].notificationAddress = TEST_DP_ADDRESS1;;
-	Profile_load_procedure.profileOwner = OWNER_OP_PROF1;
-	Profile_load_procedure.profileClass = "02";
-	Profile_load_procedure.mccMnc = MCC_MNC1;
-	Profile_load_procedure.ES10b_LoadBoundProfilePackage();
-	var ISD_P_Test01 = curProfile_ISD_P_AID;
-	
-	curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行RetrieveNotificationsList。移除卡内所有INSTALL通知;");
-	Profile_load_procedure.ES10b_ListNotification("0780");
-	
-	
-	var NotificationLen = Profile_load_procedure.listNotificationResponse.notificationMetadataList.arrOfElement.length;
-	
-	for(var i=0;i<NotificationLen;i++)
-	{
-		var parameter = Profile_load_procedure.listNotificationResponse.notificationMetadataList.arrOfElement[i].seqNumber;
-	    Profile_load_procedure.ES10b_RemoveNotificationFromList(parameter);
-	    var deleteNotificationStatus=Profile_load_procedure.notificationSentResponse.deleteNotificationStatus;
-	    curStrHandle.CheckData("00", deleteNotificationStatus, "deleteNotificationStatus");
-	}
-	
-	curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行GetEuiccInfo2Request,获取eUICC的剩余不可变空间;");
-	var hexData = LPAd_Transport_data_to_eUICC(GetEuiccInfo2RequestHexStr);
-	
-	var euiccInfo2 = new EUICCInfo2();
-	euiccInfo2.checkCardResDataFormat(hexData);
-	
-	var FREE_MEM_OP_PROF_INSTALLED = 0;
-	
-	try
-	{
-		if (check_format_extCardResource)
-			FREE_MEM_OP_PROF_INSTALLED = parseInt(euiccInfo2.extCardResource.FreeNonVolatileMemory, 16);
-		else
-		{
-			var extCardResourceObj = new ExtendedCardResource();
-			extCardResourceObj.SetHexData(euiccInfo2.extCardResource);
-			FREE_MEM_OP_PROF_INSTALLED = parseInt(extCardResourceObj.FreeNonVolatileMemory, 16);
-		}
-	}catch(e){
-		obj.SubLevel(ProfileInfoListResponse_Data_Error, level_of_SubLevel.error);
-	}
-	
-	if (FREE_MEMORY_NO_PROFILE > FREE_MEM_OP_PROF_INSTALLED)
-		obj.SubLevel("下载profile后卡片剩余不可变空间变小了", 1);
-	else
-		obj.SubLevel("下载profile后卡片剩余不可变空间没有变小", 0);
-	
-	curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行DeleteProfileRequest,删除PROFILE_OPERATIONAL1;");
-	var deleProfileRequest = new DeleteProfileRequest();
-	deleProfileRequest.iccid = ICCID_OP_PROF1;
-	deleProfileRequest.GenHexData();
-	var respData = LPAd_Transport_data_to_eUICC(deleProfileRequest.hexData);
-	
-	curStrHandle.CheckData("BF3303800100", respData, "DeleteProfileResponse");
-	
-	curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行RetrieveNotificationsList。移除卡内所有DELETE通知;");
-	Profile_load_procedure.ES10b_ListNotification("0410");
-	
-	var NotificationLen = Profile_load_procedure.listNotificationResponse.notificationMetadataList.arrOfElement.length;
-	
-	for(var i=0;i<NotificationLen;i++)
-	{
-		var parameter = Profile_load_procedure.listNotificationResponse.notificationMetadataList.arrOfElement[i].seqNumber;
-	    Profile_load_procedure.ES10b_RemoveNotificationFromList(parameter);
-	    var deleteNotificationStatus=Profile_load_procedure.notificationSentResponse.deleteNotificationStatus;
-	    curStrHandle.CheckData("00", deleteNotificationStatus, "deleteNotificationStatus");
-	}
-	
-	
-	curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行GetEuiccInfo2Request,获取eUICC的剩余不可变空间;");
-	var euiccInfo2 = new EUICCInfo2();
-	var hexData = LPAd_Transport_data_to_eUICC(GetEuiccInfo2RequestHexStr);
-	
-	euiccInfo2.checkCardResDataFormat(hexData);
-	
-	var FREE_MEMORY_NO_PROFILE2 = 0;
-	
-	try
-	{
-		if (check_format_extCardResource)
-			FREE_MEMORY_NO_PROFILE2 = parseInt(euiccInfo2.extCardResource.FreeNonVolatileMemory, 16);
-		else
-		{
-			var extCardResourceObj = new ExtendedCardResource();
-			extCardResourceObj.SetHexData(euiccInfo2.extCardResource);
-			FREE_MEMORY_NO_PROFILE2 = parseInt(extCardResourceObj.FreeNonVolatileMemory, 16);
-		}
-	}catch(e){
-		obj.SubLevel(ProfileInfoListResponse_Data_Error, level_of_SubLevel.error);
-	}
-	
-	if (FREE_MEMORY_NO_PROFILE2 > FREE_MEM_OP_PROF_INSTALLED)
-		obj.SubLevel("删除后的卡片剩余不可变空间变大了", 1);
-	else
-		obj.SubLevel("删除后的卡片剩余不可变空间没有变大", 0);
-	
-	curStrHandle.CheckData(FREE_MEMORY_NO_PROFILE, FREE_MEMORY_NO_PROFILE2, "剩余不可变空间");
-	
-	
-	RecoverCard();
+    // IC head inline (initial_conditions → PROC_EUICC_INITIALIZATION_SEQUENCE, K row 3):TERMINAL_CAPABILITY_LPAd(K 语料机械展开)
+    var s10 = bind.sendApdu("80", "AA", "00", "00", "A9058100830107", null, "9000");
+    bind.checkData("ICH-IC1-K3-C4 SW", "9000", s10.sw);
+
+    // IC head inline (initial_conditions → PROC_EUICC_INITIALIZATION_SEQUENCE, K row 4):TERMINAL_PROFILE(K 语料机械展开)
+    var steady11 = bind.runToSteadyState(function () {
+        return bind.sendTerminalProfile("FFFFFFFF7F9D00DFBF00001FE2000000C7EB0000000168005000000000000200", "9000");
+    });
+    bind.checkData("ICH-IC1-K4-C4 final SW", "9000", steady11.final.sw);
+
+    // IC head inline (initial_conditions → PROC_OPEN_LOGICAL_CHANNEL_AND_SELECT_ISDR, K row 1):MANAGE_CHANNEL_OPEN(K 语料机械展开)
+    // CHANNEL_NUMBER extraction and dynamic CLA rebinding are CasBind internal state (chaining rule; no generated-code re-implementation).
+    var s12 = bind.manageChannelOpen("9000");
+    bind.checkData("ICH-IC2-K1-C4 SW", "9000", s12.sw);
+    bind.checkData("ICH-IC2-K1-C3 CHANNEL_NUMBER extracted", "1", s12.chan !== null ? "1" : "0");
+
+    // IC head inline (initial_conditions → PROC_OPEN_LOGICAL_CHANNEL_AND_SELECT_ISDR, K row 2):MTD_SELECT(K 语料机械展开)
+    // CLA = bound channel (cla_rule) and <L> length binding are CasBind internal state (chaining rule; no generated-code re-implementation).
+    var s13 = bind.sendApdu(null, "A4", "04", "00", "A0000005591010FFFFFFFF8900000100", null, "9000");
+    // MTD_SELECT expected face is SW-only (K Annex C.2 open-channel procedure step 2: no FCI content assertion in corpus); no fabricated template parse.
+    bind.checkData("ICH-IC2-K2-C4 SW", "9000", s13.sw);
+
+    // 步骤 1:MTD_STORE_DATA(tc_step)
+    // <L> length binding and the conditional 61XX + GET RESPONSE chain (D.4.2) are CasBind internal state (chaining rule).
+    var sdCla1 = s12.chan !== null ? (s12.chan <= 3 ? 128 + s12.chan : 188 + s12.chan).toString(16).toUpperCase() : null;
+    var s1 = bind.sendApdu(sdCla1, "E2", "91", "00", "BF2200", "00", null);
+    // geca-proc ES10b Info 响应面(R_EUICC_INFO2,SGP.22 §5.7.7/§5.7.8 结构机械转录;响应外层 tag = 请求 tag):绑定层结构步行 + 在场性断言。
+    var gw1 = BindGecaProc.parseGecaResponse(s1.resp, {outer: "BF22", required: ["81", "82", "83", "84", "85", "88", "A9", "AA", "04", "0C"], optional: ["86", "87"]});
+    bind.checkData("S1-C1 R_EUICC_INFO2 outer tag", "BF22", gw1.outer_tag === null ? "absent" : gw1.outer_tag);
+    bind.checkData("S1-C1 R_EUICC_INFO2 required members present", "1", gw1.ok ? "1" : "0");
+    var ext1 = BindEs10xSingleRequest.parseBerTlv(gw1.fields["84"] || "");
+    var freeVal1 = null; for (var fti1 = 0; fti1 < ext1.length; fti1++) { if (ext1[fti1].tag === "82") { freeVal1 = ext1[fti1].value; } }
+    bind.checkData("S1-C2 free non-volatile memory tag 82 present", "1", freeVal1 !== null ? "1" : "0");
+
+    // 步骤 2:Install PROFILE_OPERATIONAL1(tc_step)
+    // card-state orchestration declaration (no APDU face): execution is
+    // the batch card_state prep framework's responsibility (4227 ruling B
+    // same-family scope; ensure_profile_state / prep_packager);
+    // no fabricated bytes emitted here; see CaseIR unresolved/open_items.
+
+    // 步骤 3:Remove all Install Notifications from eUICC(tc_step)
+    // card-state orchestration declaration (no APDU face): execution is
+    // the batch card_state prep framework's responsibility (4227 ruling B
+    // same-family scope; ensure_profile_state / prep_packager);
+    // no fabricated bytes emitted here; see CaseIR unresolved/open_items.
+
+    // 步骤 4:MTD_STORE_DATA(tc_step;REQ: RQ31_027, RQ31_028, RQ57_051, RQ57_052, RQ57_054, RQ31_183)
+    // <L> length binding and the conditional 61XX + GET RESPONSE chain (D.4.2) are CasBind internal state (chaining rule).
+    var sdCla4 = s12.chan !== null ? (s12.chan <= 3 ? 128 + s12.chan : 188 + s12.chan).toString(16).toUpperCase() : null;
+    var s4 = bind.sendApdu(sdCla4, "E2", "91", "00", "BF2200", "00", null);
+    // geca-proc ES10b Info 响应面(R_EUICC_INFO2,SGP.22 §5.7.7/§5.7.8 结构机械转录;响应外层 tag = 请求 tag):绑定层结构步行 + 在场性断言。
+    var gw4 = BindGecaProc.parseGecaResponse(s4.resp, {outer: "BF22", required: ["81", "82", "83", "84", "85", "88", "A9", "AA", "04", "0C"], optional: ["86", "87"]});
+    bind.checkData("S4-C1 R_EUICC_INFO2 outer tag", "BF22", gw4.outer_tag === null ? "absent" : gw4.outer_tag);
+    bind.checkData("S4-C1 R_EUICC_INFO2 required members present", "1", gw4.ok ? "1" : "0");
+    var ext4 = BindEs10xSingleRequest.parseBerTlv(gw4.fields["84"] || "");
+    var freeVal4 = null; for (var fti4 = 0; fti4 < ext4.length; fti4++) { if (ext4[fti4].tag === "82") { freeVal4 = ext4[fti4].value; } }
+    bind.checkData("S4-C2 free non-volatile memory tag 82 present", "1", freeVal4 !== null ? "1" : "0");
+    bind.checkData("S4-C3 free non-volatile memory lower than step 1", "1", (freeVal4 !== null && freeVal4 !== undefined && freeVal1 !== null && freeVal1 !== undefined && parseInt(freeVal4, 16) < parseInt(freeVal1, 16)) ? "1" : "0");
+
+    // 步骤 5:Delete PROFILE_OPERATIONAL1(tc_step)
+    // card-state orchestration declaration (no APDU face): execution is
+    // the batch card_state prep framework's responsibility (4227 ruling B
+    // same-family scope; ensure_profile_state / prep_packager);
+    // no fabricated bytes emitted here; see CaseIR unresolved/open_items.
+
+    // 步骤 6:Remove the Delete Notification from eUICC(tc_step)
+    // card-state orchestration declaration (no APDU face): execution is
+    // the batch card_state prep framework's responsibility (4227 ruling B
+    // same-family scope; ensure_profile_state / prep_packager);
+    // no fabricated bytes emitted here; see CaseIR unresolved/open_items.
+
+    // 步骤 7:MTD_STORE_DATA(tc_step;REQ: RQ31_027, RQ31_028, RQ57_051, RQ57_052, RQ57_054, RQ24_020)
+    // <L> length binding and the conditional 61XX + GET RESPONSE chain (D.4.2) are CasBind internal state (chaining rule).
+    var sdCla7 = s12.chan !== null ? (s12.chan <= 3 ? 128 + s12.chan : 188 + s12.chan).toString(16).toUpperCase() : null;
+    var s7 = bind.sendApdu(sdCla7, "E2", "91", "00", "BF2200", "00", null);
+    // geca-proc ES10b Info 响应面(R_EUICC_INFO2,SGP.22 §5.7.7/§5.7.8 结构机械转录;响应外层 tag = 请求 tag):绑定层结构步行 + 在场性断言。
+    var gw7 = BindGecaProc.parseGecaResponse(s7.resp, {outer: "BF22", required: ["81", "82", "83", "84", "85", "88", "A9", "AA", "04", "0C"], optional: ["86", "87"]});
+    bind.checkData("S7-C1 R_EUICC_INFO2 outer tag", "BF22", gw7.outer_tag === null ? "absent" : gw7.outer_tag);
+    bind.checkData("S7-C1 R_EUICC_INFO2 required members present", "1", gw7.ok ? "1" : "0");
+    var ext7 = BindEs10xSingleRequest.parseBerTlv(gw7.fields["84"] || "");
+    var freeVal7 = null; for (var fti7 = 0; fti7 < ext7.length; fti7++) { if (ext7[fti7].tag === "82") { freeVal7 = ext7[fti7].value; } }
+    bind.checkData("S7-C2 free non-volatile memory tag 82 present", "1", freeVal7 !== null ? "1" : "0");
+    bind.checkData("S7-C3 free non-volatile memory higher than step 4", "1", (freeVal7 !== null && freeVal7 !== undefined && freeVal4 !== null && freeVal4 !== undefined && parseInt(freeVal7, 16) > parseInt(freeVal4, 16)) ? "1" : "0");
 }