瀏覽代碼

Add Base/BaseContainer.py

hanojiang 2 年之前
父節點
當前提交
672b5d174e
共有 7 個文件被更改,包括 506 次插入98 次删除
  1. 2 1
      .gitignore
  2. 137 76
      .idea/workspace.xml
  3. 278 0
      Base/BaseContainer.py
  4. 二進制
      Data/CheckList.xlsx
  5. 19 10
      Data/DataAccess.py
  6. 1 0
      all.py
  7. 69 11
      testcase/test_case.py

+ 2 - 1
.gitignore

@@ -1,4 +1,5 @@
 report/*
 result/*
 .pytest_cache/*
-.idea/*
+.idea/*
+*.pyc

+ 137 - 76
.idea/workspace.xml

@@ -2,8 +2,37 @@
 <project version="4">
   <component name="ChangeListManager">
     <list default="true" id="95170716-16e9-467a-973d-c2f0cc971440" name="Default Changelist" comment="">
-      <change afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/.gitignore" beforeDir="false" afterPath="$PROJECT_DIR$/.gitignore" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/Data/CheckList.xlsx" beforeDir="false" afterPath="$PROJECT_DIR$/Data/CheckList.xlsx" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/Data/DataAccess.py" beforeDir="false" afterPath="$PROJECT_DIR$/Data/DataAccess.py" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/all.py" beforeDir="false" afterPath="$PROJECT_DIR$/all.py" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/report/data/behaviors.csv" beforeDir="false" afterPath="$PROJECT_DIR$/report/data/behaviors.csv" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/report/data/behaviors.json" beforeDir="false" afterPath="$PROJECT_DIR$/report/data/behaviors.json" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/report/data/categories.csv" beforeDir="false" afterPath="$PROJECT_DIR$/report/data/categories.csv" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/report/data/categories.json" beforeDir="false" afterPath="$PROJECT_DIR$/report/data/categories.json" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/report/data/packages.json" beforeDir="false" afterPath="$PROJECT_DIR$/report/data/packages.json" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/report/data/suites.csv" beforeDir="false" afterPath="$PROJECT_DIR$/report/data/suites.csv" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/report/data/suites.json" beforeDir="false" afterPath="$PROJECT_DIR$/report/data/suites.json" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/report/data/timeline.json" beforeDir="false" afterPath="$PROJECT_DIR$/report/data/timeline.json" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/report/export/influxDbData.txt" beforeDir="false" afterPath="$PROJECT_DIR$/report/export/influxDbData.txt" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/report/export/prometheusData.txt" beforeDir="false" afterPath="$PROJECT_DIR$/report/export/prometheusData.txt" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/report/history/categories-trend.json" beforeDir="false" afterPath="$PROJECT_DIR$/report/history/categories-trend.json" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/report/history/duration-trend.json" beforeDir="false" afterPath="$PROJECT_DIR$/report/history/duration-trend.json" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/report/history/history-trend.json" beforeDir="false" afterPath="$PROJECT_DIR$/report/history/history-trend.json" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/report/history/history.json" beforeDir="false" afterPath="$PROJECT_DIR$/report/history/history.json" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/report/history/retry-trend.json" beforeDir="false" afterPath="$PROJECT_DIR$/report/history/retry-trend.json" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/report/widgets/behaviors.json" beforeDir="false" afterPath="$PROJECT_DIR$/report/widgets/behaviors.json" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/report/widgets/categories-trend.json" beforeDir="false" afterPath="$PROJECT_DIR$/report/widgets/categories-trend.json" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/report/widgets/categories.json" beforeDir="false" afterPath="$PROJECT_DIR$/report/widgets/categories.json" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/report/widgets/duration-trend.json" beforeDir="false" afterPath="$PROJECT_DIR$/report/widgets/duration-trend.json" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/report/widgets/duration.json" beforeDir="false" afterPath="$PROJECT_DIR$/report/widgets/duration.json" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/report/widgets/history-trend.json" beforeDir="false" afterPath="$PROJECT_DIR$/report/widgets/history-trend.json" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/report/widgets/retry-trend.json" beforeDir="false" afterPath="$PROJECT_DIR$/report/widgets/retry-trend.json" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/report/widgets/severity.json" beforeDir="false" afterPath="$PROJECT_DIR$/report/widgets/severity.json" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/report/widgets/status-chart.json" beforeDir="false" afterPath="$PROJECT_DIR$/report/widgets/status-chart.json" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/report/widgets/suites.json" beforeDir="false" afterPath="$PROJECT_DIR$/report/widgets/suites.json" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/report/widgets/summary.json" beforeDir="false" afterPath="$PROJECT_DIR$/report/widgets/summary.json" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/reportname.html" beforeDir="false" afterPath="$PROJECT_DIR$/reportname.html" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/testcase/test_case.py" beforeDir="false" afterPath="$PROJECT_DIR$/testcase/test_case.py" afterDir="false" />
     </list>
@@ -18,8 +47,8 @@
       <file pinned="false" current-in-tab="false">
         <entry file="file://$PROJECT_DIR$/all.py">
           <provider selected="true" editor-type-id="text-editor">
-            <state relative-caret-position="114">
-              <caret line="9" column="64" selection-start-line="9" selection-start-column="64" selection-end-line="9" selection-end-column="64" />
+            <state relative-caret-position="171">
+              <caret line="9" column="60" selection-start-line="9" selection-start-column="56" selection-end-line="9" selection-end-column="60" />
               <folding>
                 <element signature="e#0#9#0" expanded="true" />
               </folding>
@@ -30,8 +59,8 @@
       <file pinned="false" current-in-tab="false">
         <entry file="file://$PROJECT_DIR$/Base/CfgCheckBase.py">
           <provider selected="true" editor-type-id="text-editor">
-            <state relative-caret-position="247">
-              <caret line="16" column="8" selection-start-line="16" selection-start-column="8" selection-end-line="16" selection-end-column="8" />
+            <state relative-caret-position="882">
+              <caret line="47" column="118" selection-start-line="47" selection-start-column="19" selection-end-line="47" selection-end-column="118" />
               <folding>
                 <element signature="e#125#147#0" expanded="true" />
               </folding>
@@ -39,11 +68,11 @@
           </provider>
         </entry>
       </file>
-      <file pinned="false" current-in-tab="false">
+      <file pinned="false" current-in-tab="true">
         <entry file="file://$PROJECT_DIR$/Base/ModuleCfgCheck.py">
           <provider selected="true" editor-type-id="text-editor">
-            <state relative-caret-position="1026">
-              <caret line="60" column="58" selection-start-line="60" selection-start-column="32" selection-end-line="60" selection-end-column="58" />
+            <state relative-caret-position="-904">
+              <caret line="15" column="33" selection-start-line="15" selection-start-column="21" selection-end-line="15" selection-end-column="33" />
               <folding>
                 <element signature="e#127#141#0" expanded="true" />
               </folding>
@@ -51,20 +80,11 @@
           </provider>
         </entry>
       </file>
-      <file pinned="false" current-in-tab="false">
-        <entry file="file://$USER_HOME$/.PyCharm2019.1/system/python_stubs/-65985591/lxml/etree/__init__.py">
-          <provider selected="true" editor-type-id="text-editor">
-            <state relative-caret-position="11001">
-              <caret line="579" column="4" selection-start-line="579" selection-start-column="4" selection-end-line="579" selection-end-column="4" />
-            </state>
-          </provider>
-        </entry>
-      </file>
       <file pinned="false" current-in-tab="false">
         <entry file="file://$PROJECT_DIR$/Base/Arxml.py">
           <provider selected="true" editor-type-id="text-editor">
-            <state relative-caret-position="2166">
-              <caret line="115" column="8" selection-start-line="115" selection-start-column="8" selection-end-line="115" selection-end-column="8" />
+            <state relative-caret-position="3724">
+              <caret line="196" column="47" selection-start-line="196" selection-start-column="47" selection-end-line="196" selection-end-column="47" />
               <folding>
                 <element signature="e#0#22#0" expanded="true" />
               </folding>
@@ -72,11 +92,11 @@
           </provider>
         </entry>
       </file>
-      <file pinned="false" current-in-tab="true">
+      <file pinned="false" current-in-tab="false">
         <entry file="file://$PROJECT_DIR$/testcase/test_case.py">
           <provider selected="true" editor-type-id="text-editor">
-            <state relative-caret-position="988">
-              <caret line="52" column="24" lean-forward="true" selection-start-line="52" selection-start-column="24" selection-end-line="52" selection-end-column="24" />
+            <state relative-caret-position="1596">
+              <caret line="84" column="25" selection-start-line="84" selection-start-column="25" selection-end-line="84" selection-end-column="25" />
               <folding>
                 <element signature="e#123#136#0" expanded="true" />
               </folding>
@@ -87,8 +107,8 @@
       <file pinned="false" current-in-tab="false">
         <entry file="file://$PROJECT_DIR$/Base/BaseContainer.py">
           <provider selected="true" editor-type-id="text-editor">
-            <state relative-caret-position="1064">
-              <caret line="58" column="15" selection-start-line="58" selection-start-column="5" selection-end-line="58" selection-end-column="15" />
+            <state relative-caret-position="-3521">
+              <caret line="41" column="24" selection-start-line="41" selection-start-column="6" selection-end-line="41" selection-end-column="24" />
             </state>
           </provider>
         </entry>
@@ -105,8 +125,8 @@
       <file pinned="false" current-in-tab="false">
         <entry file="file://$PROJECT_DIR$/Data/DataAccess.py">
           <provider selected="true" editor-type-id="text-editor">
-            <state relative-caret-position="817">
-              <caret line="45" column="39" selection-start-line="45" selection-start-column="39" selection-end-line="45" selection-end-column="39" />
+            <state relative-caret-position="760">
+              <caret line="78" column="34" selection-start-line="78" selection-start-column="34" selection-end-line="78" selection-end-column="34" />
             </state>
           </provider>
         </entry>
@@ -140,22 +160,22 @@
   <component name="IdeDocumentHistory">
     <option name="CHANGED_PATHS">
       <list>
-        <option value="$PROJECT_DIR$/Base/Arxml.py" />
         <option value="$PROJECT_DIR$/testcase/testcase_dcm.py" />
         <option value="$PROJECT_DIR$/Base/CfgCheckBase.py" />
         <option value="$APPLICATION_HOME_DIR$/helpers/third_party/thriftpy/_shaded_thriftpy/_compat.py" />
         <option value="$PROJECT_DIR$/testcase/test_dcm.py" />
-        <option value="$PROJECT_DIR$/all.py" />
         <option value="$PROJECT_DIR$/Base/ModuleCfgCheck.py" />
-        <option value="$PROJECT_DIR$/Data/DataAccess.py" />
         <option value="$PROJECT_DIR$/Base/BaseContainer.py" />
+        <option value="$PROJECT_DIR$/all.py" />
+        <option value="$PROJECT_DIR$/Base/Arxml.py" />
+        <option value="$PROJECT_DIR$/Data/DataAccess.py" />
         <option value="$PROJECT_DIR$/testcase/test_case.py" />
       </list>
     </option>
   </component>
-  <component name="ProjectFrameBounds" extendedState="7">
-    <option name="x" value="1261" />
-    <option name="y" value="31" />
+  <component name="ProjectFrameBounds" extendedState="6">
+    <option name="x" value="940" />
+    <option name="y" value="565" />
     <option name="width" value="1300" />
     <option name="height" value="1610" />
   </component>
@@ -165,6 +185,7 @@
       <foldersAlwaysOnTop value="true" />
     </navigator>
     <panes>
+      <pane id="Scope" />
       <pane id="ProjectPane">
         <subPane>
           <expand>
@@ -191,7 +212,6 @@
           <select />
         </subPane>
       </pane>
-      <pane id="Scope" />
     </panes>
   </component>
   <component name="PropertiesComponent">
@@ -345,6 +365,13 @@
       <workItem from="1664026386897" duration="1460000" />
       <workItem from="1664084945115" duration="2438000" />
       <workItem from="1664095335991" duration="205000" />
+      <workItem from="1664095606757" duration="2871000" />
+      <workItem from="1664156829138" duration="7028000" />
+      <workItem from="1664250190361" duration="1396000" />
+      <workItem from="1664325209515" duration="3580000" />
+      <workItem from="1664355712870" duration="91000" />
+      <workItem from="1664527281750" duration="246000" />
+      <workItem from="1664528095262" duration="123000" />
     </task>
     <servers />
   </component>
@@ -381,23 +408,24 @@
     </history-entry>
   </component>
   <component name="TimeTrackingManager">
-    <option name="totallyTimeSpent" value="43542000" />
+    <option name="totallyTimeSpent" value="58877000" />
   </component>
   <component name="ToolWindowManager">
-    <frame x="-7" y="-7" width="3086" height="1742" extended-state="6" />
+    <frame x="-7" y="-7" width="2062" height="1294" extended-state="6" />
+    <editor active="true" />
     <layout>
       <window_info id="Favorites" order="0" side_tool="true" />
-      <window_info content_ui="combo" id="Project" order="1" visible="true" weight="0.14077991" />
+      <window_info active="true" content_ui="combo" id="Project" order="1" visible="true" weight="0.17632368" />
       <window_info id="Structure" order="2" side_tool="true" weight="0.25" />
       <window_info anchor="bottom" id="Database Changes" order="0" />
-      <window_info anchor="bottom" id="Terminal" order="1" weight="0.27482823" />
+      <window_info anchor="bottom" id="Terminal" order="1" weight="0.27425373" />
       <window_info anchor="bottom" id="Event Log" order="2" side_tool="true" />
-      <window_info anchor="bottom" id="Version Control" order="3" />
+      <window_info anchor="bottom" id="Version Control" order="3" weight="0.16293104" />
       <window_info anchor="bottom" id="Python Console" order="4" weight="0.3101305" />
       <window_info anchor="bottom" id="Docker" order="5" show_stripe_button="false" />
       <window_info anchor="bottom" id="Message" order="6" />
       <window_info anchor="bottom" id="Find" order="7" weight="0.32939714" />
-      <window_info anchor="bottom" id="Run" order="8" weight="0.39676616" />
+      <window_info anchor="bottom" id="Run" order="8" weight="0.28448275" />
       <window_info anchor="bottom" id="Debug" order="9" weight="0.39925373" />
       <window_info anchor="bottom" id="Cvs" order="10" weight="0.25" />
       <window_info anchor="bottom" id="Inspection" order="11" weight="0.4" />
@@ -408,6 +436,29 @@
       <window_info anchor="right" id="Ant Build" order="3" weight="0.25" />
       <window_info anchor="right" content_ui="combo" id="Hierarchy" order="4" weight="0.25" />
     </layout>
+    <layout-to-restore>
+      <window_info id="Favorites" order="0" side_tool="true" />
+      <window_info content_ui="combo" id="Project" order="1" visible="true" weight="0.14177132" />
+      <window_info id="Structure" order="2" side_tool="true" weight="0.25" />
+      <window_info anchor="bottom" id="Database Changes" order="0" />
+      <window_info anchor="bottom" id="Terminal" order="1" weight="0.27425373" />
+      <window_info anchor="bottom" id="Event Log" order="2" side_tool="true" />
+      <window_info anchor="bottom" id="Version Control" order="3" />
+      <window_info anchor="bottom" id="Python Console" order="4" weight="0.3101305" />
+      <window_info anchor="bottom" id="Docker" order="5" show_stripe_button="false" />
+      <window_info anchor="bottom" id="Message" order="6" />
+      <window_info anchor="bottom" id="Find" order="7" weight="0.32939714" />
+      <window_info active="true" anchor="bottom" id="Run" order="8" visible="true" weight="0.39676616" />
+      <window_info anchor="bottom" id="Debug" order="9" weight="0.39925373" />
+      <window_info anchor="bottom" id="Cvs" order="10" weight="0.25" />
+      <window_info anchor="bottom" id="Inspection" order="11" weight="0.4" />
+      <window_info anchor="bottom" id="TODO" order="12" />
+      <window_info anchor="right" id="Database" order="0" />
+      <window_info anchor="right" id="Commander" internal_type="SLIDING" order="1" type="SLIDING" weight="0.4" />
+      <window_info anchor="right" id="SciView" order="2" />
+      <window_info anchor="right" id="Ant Build" order="3" weight="0.25" />
+      <window_info anchor="right" content_ui="combo" id="Hierarchy" order="4" weight="0.25" />
+    </layout-to-restore>
   </component>
   <component name="TypeScriptGeneratedFilesManager">
     <option name="version" value="1" />
@@ -417,7 +468,7 @@
     <SUITE FILE_PATH="coverage/pytest_src$DataAccess.coverage" NAME="DataAccess Coverage Results" MODIFIED="1664009099956" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/Data" />
     <SUITE FILE_PATH="coverage/pytest_src$pytest_for_test_case_test_04_case.coverage" NAME="pytest for test_case.test_04_case Coverage Results" MODIFIED="1664085346123" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/testcase" />
     <SUITE FILE_PATH="coverage/pytest_src$pytest_for_test_dcm_test_01_case.coverage" NAME="pytest for test_dcm.test_01_case Coverage Results" MODIFIED="1663913935826" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/testcase" />
-    <SUITE FILE_PATH="coverage/pytest_src$all.coverage" NAME="all Coverage Results" MODIFIED="1664095682719" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
+    <SUITE FILE_PATH="coverage/pytest_src$all.coverage" NAME="all Coverage Results" MODIFIED="1664527287141" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
     <SUITE FILE_PATH="coverage/pytest_src$CfgCheckBase.coverage" NAME="CfgCheckBase Coverage Results" MODIFIED="1663898494426" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/Base" />
     <SUITE FILE_PATH="coverage/pytest_src$ModuleCfgCheck.coverage" NAME="ModuleCfgCheck Coverage Results" MODIFIED="1663909713613" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/Base" />
   </component>
@@ -453,47 +504,51 @@
     <entry file="file://$PROJECT_DIR$/Base/__init__.py">
       <provider selected="true" editor-type-id="text-editor" />
     </entry>
-    <entry file="file://$PROJECT_DIR$/all.py">
+    <entry file="file://$USER_HOME$/.PyCharm2019.1/system/python_stubs/-65985591/lxml/etree/__init__.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="114">
-          <caret line="9" column="64" selection-start-line="9" selection-start-column="64" selection-end-line="9" selection-end-column="64" />
-          <folding>
-            <element signature="e#0#9#0" expanded="true" />
-          </folding>
+        <state relative-caret-position="11001">
+          <caret line="579" column="4" selection-start-line="579" selection-start-column="4" selection-end-line="579" selection-end-column="4" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/Base/CfgCheckBase.py">
+    <entry file="file://$PROJECT_DIR$/../pytest_venv/Lib/site-packages/pytest/__init__.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="247">
-          <caret line="16" column="8" selection-start-line="16" selection-start-column="8" selection-end-line="16" selection-end-column="8" />
-          <folding>
-            <element signature="e#125#147#0" expanded="true" />
-          </folding>
+        <state relative-caret-position="209">
+          <caret line="141" column="16" lean-forward="true" selection-start-line="141" selection-start-column="16" selection-end-line="141" selection-end-column="16" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/Base/ModuleCfgCheck.py">
+    <entry file="file://$PROJECT_DIR$/requirements.txt">
+      <provider selected="true" editor-type-id="text-editor" />
+    </entry>
+    <entry file="file://$PROJECT_DIR$/all.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="1026">
-          <caret line="60" column="58" selection-start-line="60" selection-start-column="32" selection-end-line="60" selection-end-column="58" />
+        <state relative-caret-position="171">
+          <caret line="9" column="60" selection-start-line="9" selection-start-column="56" selection-end-line="9" selection-end-column="60" />
           <folding>
-            <element signature="e#127#141#0" expanded="true" />
+            <element signature="e#0#9#0" expanded="true" />
           </folding>
         </state>
       </provider>
     </entry>
-    <entry file="file://$USER_HOME$/.PyCharm2019.1/system/python_stubs/-65985591/lxml/etree/__init__.py">
+    <entry file="file://$PROJECT_DIR$/../pytest_venv/Lib/site-packages/openpyxl/worksheet/_reader.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="11001">
-          <caret line="579" column="4" selection-start-line="579" selection-start-column="4" selection-end-line="579" selection-end-column="4" />
+        <state relative-caret-position="5130">
+          <caret line="311" selection-start-line="311" selection-end-line="311" />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/../pytest_venv/Lib/site-packages/openpyxl/reader/excel.py">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="5909">
+          <caret line="317" column="17" selection-start-line="317" selection-start-column="11" selection-end-line="317" selection-end-column="17" />
         </state>
       </provider>
     </entry>
     <entry file="file://$PROJECT_DIR$/Base/Arxml.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="2166">
-          <caret line="115" column="8" selection-start-line="115" selection-start-column="8" selection-end-line="115" selection-end-column="8" />
+        <state relative-caret-position="3724">
+          <caret line="196" column="47" selection-start-line="196" selection-start-column="47" selection-end-line="196" selection-end-column="47" />
           <folding>
             <element signature="e#0#22#0" expanded="true" />
           </folding>
@@ -502,38 +557,44 @@
     </entry>
     <entry file="file://$PROJECT_DIR$/Base/BaseContainer.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="1064">
-          <caret line="58" column="15" selection-start-line="58" selection-start-column="5" selection-end-line="58" selection-end-column="15" />
+        <state relative-caret-position="-3521">
+          <caret line="41" column="24" selection-start-line="41" selection-start-column="6" selection-end-line="41" selection-end-column="24" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/../pytest_venv/Lib/site-packages/openpyxl/worksheet/_reader.py">
+    <entry file="file://$PROJECT_DIR$/Data/DataAccess.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="5130">
-          <caret line="311" selection-start-line="311" selection-end-line="311" />
+        <state relative-caret-position="760">
+          <caret line="78" column="34" selection-start-line="78" selection-start-column="34" selection-end-line="78" selection-end-column="34" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/Data/DataAccess.py">
+    <entry file="file://$PROJECT_DIR$/testcase/test_case.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="817">
-          <caret line="45" column="39" selection-start-line="45" selection-start-column="39" selection-end-line="45" selection-end-column="39" />
+        <state relative-caret-position="1596">
+          <caret line="84" column="25" selection-start-line="84" selection-start-column="25" selection-end-line="84" selection-end-column="25" />
+          <folding>
+            <element signature="e#123#136#0" expanded="true" />
+          </folding>
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/../pytest_venv/Lib/site-packages/openpyxl/reader/excel.py">
+    <entry file="file://$PROJECT_DIR$/Base/CfgCheckBase.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="5909">
-          <caret line="317" column="17" selection-start-line="317" selection-start-column="11" selection-end-line="317" selection-end-column="17" />
+        <state relative-caret-position="882">
+          <caret line="47" column="118" selection-start-line="47" selection-start-column="19" selection-end-line="47" selection-end-column="118" />
+          <folding>
+            <element signature="e#125#147#0" expanded="true" />
+          </folding>
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/testcase/test_case.py">
+    <entry file="file://$PROJECT_DIR$/Base/ModuleCfgCheck.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="988">
-          <caret line="52" column="24" lean-forward="true" selection-start-line="52" selection-start-column="24" selection-end-line="52" selection-end-column="24" />
+        <state relative-caret-position="-904">
+          <caret line="15" column="33" selection-start-line="15" selection-start-column="21" selection-end-line="15" selection-end-column="33" />
           <folding>
-            <element signature="e#123#136#0" expanded="true" />
+            <element signature="e#127#141#0" expanded="true" />
           </folding>
         </state>
       </provider>

+ 278 - 0
Base/BaseContainer.py

@@ -0,0 +1,278 @@
+from Base.Arxml import Arxml
+import logging
+import copy
+
+class BaseContainer:
+
+    def __init__(self, element):
+        self.__element = element
+        # self.__container_tag = ''
+        # self.__container_attribute = {}
+        # self.__container_text = ''
+        self.set_container_attr()
+        # print(self.get_container_attr())
+
+    def set_container_attr(self):
+        if self.__element is not None:
+            self.__container_tag = self.__element.tag
+            self.__container_attribute = self.__element.attrib
+            self.__container_text = self.__element.text
+        else:
+            self.__container_tag = ''
+            self.__container_attribute = {}
+            self.__container_text = ''
+
+    def __str__(self):
+        container = 'Container Tag:{}, Attribute:{}, Text:{}'.format(self.__container_tag,
+                                                                       self.__container_attribute,
+                                                                       self.__container_text)
+        return container
+
+    def update_container_by_attr(self, attr_dict):
+        pass
+
+    def get_container_attr(self):
+        attr_dict = {}
+        attr_dict['TAG'] = self.__container_tag.split('}')[-1]
+        attr_dict['ATTRIB'] = self.__container_attribute.get('DEST', '')
+        attr_dict['TEXT'] = self.__container_text
+
+        return attr_dict
+
+class EcucContainerValue:
+    '''
+    short_name
+    container_definition_ref: (attrib_type, definition_text)
+    parameter_values:
+    {
+        split(parameter_name):(tag_type, parameter_attrib_type, parameter_name, parameter_value),
+        ...
+    }
+    reference_values:
+    {
+        split(reference_name):(tag_type, reference_name_attrib_type, reference_name, reference_value_attrib_type, reference_value),
+        ...
+    }
+
+    eg:
+    {
+    'short_name': 'CCP_SigGW_050ms_PDU00_PT_8c62d7ea_Tx',
+    'container_definition_ref': ['ECUC-PARAM-CONF-CONTAINER-DEF', '/MICROSAR/IpduM/IpduMConfig/IpduMContainedTxPdu'],
+    'parameter_values':
+        {
+        'IpduMContainedPduHeaderId': ['ECUC-NUMERICAL-PARAM-VALUE', 'ECUC-INTEGER-PARAM-DEF', '/MICROSAR/IpduM/IpduMConfig/IpduMContainedTxPdu/IpduMContainedPduHeaderId', '1114112'],
+        'IpduMContainedTxPduCollectionSemantics': ['ECUC-TEXTUAL-PARAM-VALUE', 'ECUC-ENUMERATION-PARAM-DEF', '/MICROSAR/IpduM/IpduMConfig/IpduMContainedTxPdu/IpduMContainedTxPduCollectionSemantics', 'IPDUM_COLLECT_LAST_IS_BEST'],
+        'IpduMContainedTxPduTrigger': ['ECUC-TEXTUAL-PARAM-VALUE', 'ECUC-ENUMERATION-PARAM-DEF', '/MICROSAR/IpduM/IpduMConfig/IpduMContainedTxPdu/IpduMContainedTxPduTrigger', 'IPDUM_TRIGGER_ALWAYS'],
+        'IpduMContainedTxPduConfirmation': ['ECUC-NUMERICAL-PARAM-VALUE', 'ECUC-BOOLEAN-PARAM-DEF', '/MICROSAR/IpduM/IpduMConfig/IpduMContainedTxPdu/IpduMContainedTxPduConfirmation', 'true'],
+        'IpduMContainedTxPduHandleId': ['ECUC-NUMERICAL-PARAM-VALUE', 'ECUC-INTEGER-PARAM-DEF', '/MICROSAR/IpduM/IpduMConfig/IpduMContainedTxPdu/IpduMContainedTxPduHandleId', '43']
+        },
+    'reference_values':
+        {
+        'IpduMContainedTxInContainerPduRef': ['ECUC-REFERENCE-VALUE', 'ECUC-REFERENCE-DEF', '/MICROSAR/IpduM/IpduMConfig/IpduMContainedTxPdu/IpduMContainedTxInContainerPduRef', 'ECUC-CONTAINER-VALUE', '/ActiveEcuC/IpduM/IpduMConfig/CCP_PTCANFD_050ms_Container03_52bb19c8_Tx'],
+        'IpduMContainedTxPduRef': ['ECUC-REFERENCE-VALUE', 'ECUC-REFERENCE-DEF', '/MICROSAR/IpduM/IpduMConfig/IpduMContainedTxPdu/IpduMContainedTxPduRef', 'ECUC-CONTAINER-VALUE', '/ActiveEcuC/EcuC/EcucPduCollection/CCP_SigGW_050ms_PDU00_PT_8c62d7ea_Tx']
+        }
+    }
+    '''
+
+    def __init__(self, ecuc_container):
+        self.__ecuc_container = ecuc_container
+        self.__get_ecuc_container_attr()
+
+
+    def __get_ecuc_container_attr(self):
+        '''
+        获取一个ECUC-CONTAINER-VALUE container中的所有属性,使用成员变量,存储属性字典,和子container
+        :return:
+        '''
+        # SHORT-NAME container
+        short_name_container = Arxml.get_first_match_element(self.__ecuc_container,
+                                                                            './SHORT-NAME')
+        short_name = Arxml.get_container_text(short_name_container)
+
+        # DEFINITION-REF container
+        definition_container = Arxml.get_first_match_element(self.__ecuc_container, './DEFINITION-REF')
+
+        definition_container_attr = BaseContainer(definition_container).get_container_attr()
+
+        # print(definition_container_attr) # DEST attribute and container text
+        container_definition_ref = [definition_container_attr['ATTRIB'], definition_container_attr['TEXT']]
+
+        '''
+        PARAMETER-VALUES	
+	        [ECUC-NUMERICAL-PARAM-VALUE]-0	
+	            DEFINITION-REF	[/MICROSAR/CanIf/CanIfInitCfg/CanIfBufferCfg/CanIfBufferSize]-2
+                    DEST	[ECUC-INTEGER-PARAM-DEF]-1
+	            VALUE	[0]-3
+        '''
+
+        # PARAMETER-VALUES container
+        parameter_containers = Arxml.get_first_match_element(self.__ecuc_container, './PARAMETER-VALUES')
+        if parameter_containers is None: # fix,when get parameter_containers is None, for iterator will get ERROR 
+            parameter_containers = []
+        parameter_values = {}
+        parameter_containers_dict = {}
+
+        for ele in parameter_containers:
+            # parameter container tag is parameter type
+            tag_type = BaseContainer(ele).get_container_attr()['TAG']
+
+            # parameter DEFINITION-REF container , include attribute, text(parameter name), tag(DEFINITION-REF)
+            def_container = Arxml.get_first_match_element(ele, './DEFINITION-REF')
+            def_attr = BaseContainer(def_container).get_container_attr()
+            parameter_attrib_type = def_attr['ATTRIB']
+            parameter_name = def_attr['TEXT']
+            parameter_name_short = parameter_name.split('/')[-1]
+
+            # parameter VALUE container , include attribute, text(actual parameter value), tag(VALUE)
+            value_container = Arxml.get_first_match_element(ele, './VALUE')
+            value_attr = BaseContainer(value_container).get_container_attr() ## get text info
+            parameter_value = value_attr['TEXT']
+
+            parameter_values[parameter_name_short] = [tag_type, parameter_attrib_type, parameter_name, parameter_value]
+            parameter_containers_dict[parameter_name_short] = ele
+
+        #reference container
+        reference_containers = Arxml.get_first_match_element(self.__ecuc_container, './REFERENCE-VALUES')
+        if reference_containers is None: # fix,when get reference_containers is None, for iterator will get ERROR
+            reference_containers = []
+        '''
+        REFERENCE-VALUES	
+	        [ECUC-REFERENCE-VALUE]-0	
+	            DEFINITION-REF	[/MICROSAR/CanIf/CanIfInitCfg/CanIfBufferCfg/CanIfBufferHthRef]-2
+		            DEST	[ECUC-REFERENCE-DEF]-1
+                VALUE-REF	[/ActiveEcuC/CanIf/CanIfInitCfg/CanIfInitHohCfg/CanIfHthCfg_CCP_ADCANFD_010ms_Container36_574ce325_Tx]-4
+		            DEST	[ECUC-CONTAINER-VALUE]-3
+        '''
+        reference_values = {}
+        reference_containers_dict = {}
+        for ele in reference_containers:
+            tag_type = BaseContainer(ele).get_container_attr()['TAG']
+
+            def_container = Arxml.get_first_match_element(ele, './DEFINITION-REF')
+            def_attr = BaseContainer(def_container).get_container_attr()
+            reference_name_attrib_type = def_attr['ATTRIB']
+            reference_name = def_attr['TEXT']
+            reference_name_short = reference_name.split('/')[-1]
+
+            value_container = Arxml.get_first_match_element(ele, './VALUE-REF') # difference with parameter container
+            value_attr = BaseContainer(value_container).get_container_attr()
+            reference_value = value_attr['TEXT']
+
+            reference_value_attrib_type = value_attr['ATTRIB']
+
+            reference_values[reference_name_short] = [tag_type, reference_name_attrib_type, reference_name, reference_value_attrib_type, reference_value]
+            reference_containers_dict[reference_name_short] = ele
+
+        self.__container_attr = {
+            'short_name':short_name,
+            'container_definition_ref':container_definition_ref,
+            'parameter_values':parameter_values,
+            'reference_values':reference_values
+        }
+
+        self.__container = {
+            'short_name': short_name_container,
+            'container_definition_ref': definition_container,
+            'parameter_values': parameter_containers_dict,
+            'reference_values': reference_containers_dict
+        }
+
+    @property
+    def container_attr(self):
+        return copy.deepcopy(self.__container_attr)
+
+    @container_attr.setter
+    def container_attr(self, new_conatiner_attr):
+        self.__container_attr = new_conatiner_attr
+
+    def __update_ecuc_base_attr(self, new_attr):
+        pass
+
+    def __update_ecuc_base_container_attr(self, new_attr, container_type):
+        value_tag_name = 'VALUE' if 'PARAM' == container_type else 'VALUE-REF'
+        attr_key = 'parameter_values' if 'PARAM' == container_type else 'reference_values'
+
+        if len(new_attr[attr_key]) >= len(self.__container_attr[attr_key]) and \
+                new_attr[attr_key] != self.__container_attr[attr_key]:
+            for key, value in new_attr[attr_key].items():
+                logging.info(key)
+                logging.info(value)
+                if key in self.__container_attr[attr_key]:
+                    ## param or reference key in attr dict? yes
+                    # find param VALUE or reference VALUE-REF element
+                    value_container = Arxml.get_first_match_element(self.__container[attr_key][key], './' + value_tag_name)
+                    # print(value_container)
+                    if value_container is not None:
+                        # VALUE or reference VALUE-REF element is exit, so update value.
+                        value_container.text = value[-1]  # set text info
+                    # elif value[-1] != '':
+                    else:
+                        # has key but without VALUE or reference VALUE-REF element.
+                        Arxml.creat_child_new_element(self.__container[attr_key][key], # new add element in container, can not find by xpath, through it has append to container
+                                                      value_tag_name, text_str=value[-1]) # TO DO creat VALUE-REF child with attribute_dict
+                        pass
+                else: # new attr ,need to be created
+                    param_type_tag = value[0]
+                    # if <PARAMETER-VALUES/> or <REFERENCE-VALUES/> is empty, when add element to it, will cause error.
+                    first_container_key = list(self.__container[attr_key].keys())[0] # find first element in <PARAMETER-VALUES/> or <REFERENCE-VALUES/>
+
+                    # find first brother container
+                    brother_container = self.__container[attr_key][first_container_key]
+
+                    # creat new brother element <ECUC-REFERENCE-VALUE/>
+                    new_container = Arxml.creat_brother_new_element(brother_container,
+                                                                      param_type_tag)
+                    # creat child <DEFINITION-REF/> element
+                    Arxml.creat_child_new_element(new_container,
+                                                  'DEFINITION-REF', text_str=value[2], attribute_dict={'DEST':value[1]})
+
+                    if 'PARAM' == container_type:
+                        # creat child <VALUE/> element
+                        Arxml.creat_child_new_element(new_container, value_tag_name,
+                                                  text_str=value[-1])
+                    else:
+                        # creat child <VALUE-REF/> element
+                        Arxml.creat_child_new_element(new_container, value_tag_name, text_str=value[-1], attribute_dict={'DEST':value[-2]})
+
+        # self.__container_attr = new_attr
+
+    def __update_ecuc_parameter_attr(self, new_attr):
+        self.__update_ecuc_base_container_attr(new_attr, 'PARAM')
+
+
+    def __update_ecuc_reference_attr(self, new_attr):
+        self.__update_ecuc_base_container_attr(new_attr, 'REF')
+
+    def update_ecuc_container(self, new_attr):
+        '''
+        update info or add new sub-container
+        :param new_attr:
+        :return:
+        '''
+        self.__update_ecuc_base_attr(new_attr)
+        self.__update_ecuc_parameter_attr(new_attr)
+        self.__update_ecuc_reference_attr(new_attr)
+        self.__container_attr = new_attr
+
+if __name__ == '__main__':
+    arxml = Arxml('EH32_GW04_IpduM_ecuc.arxml')
+
+    element = Arxml.get_first_match_element(arxml.root, './/SHORT-NAME', 'IpduMConfig', 'TEXT_EQ')
+    par_ele = Arxml.get_parent_element(element)
+    # ecuc = Arxml.get_first_match_element(par_ele, './SUB-CONTAINERS/ECUC-CONTAINER-VALUE')
+    #
+    # ecuc_container = EcucContainerValue(ecuc)
+    # attr = ecuc_container.container_attr
+    # attr['parameter_values']['IpduMContainedPduHeaderId'][-1] ='1122'
+    # attr['parameter_values']['aaaa'] = ['test_tag', 'test_attribute', 'test_param_name', 'test_param_value']
+    # attr['reference_values']['bbbb'] = ['test_ref_tag', 'test_ref_attribute', 'test_ref_name', 'test_ref_value_attrib', 'test_ref_value']
+
+    # ecuc_container.update_ecuc_container(attr)
+
+    ecuc_containers = Arxml.get_all_match_element(par_ele, './SUB-CONTAINERS/ECUC-CONTAINER-VALUE')
+
+    for ecuc in ecuc_containers:
+        ecuc_container = EcucContainerValue(ecuc)
+        print(ecuc_container.container_attr)
+
+    arxml.xml_write_to_file(arxml.root, 'test.arxml')

二進制
Data/CheckList.xlsx


+ 19 - 10
Data/DataAccess.py

@@ -12,19 +12,26 @@ from openpyxl import load_workbook
 CHECK_LIST_FILE = r'./Data/CheckList.xlsx'
 
 class ColumHeader(Enum):
-    Module = 0
-    ConfigurationItem = 1
-    Type = 2
-    ExpectValue = 3
-    SearchPattern = 4
-    SearchText = 5
-    SearchRule = 6
+    Project = 0
+    Module = 1
+    ConfigurationItem = 2
+    Type = 3
+    ExpectValue = 4
+    SearchPattern = 5
+    SearchText = 6
+    SearchRule = 7
+
 
 class ItemType(Enum):
     FIXED_VALUE = 0
     CUSTOM_PATTERN = 1
     DEPENDENCY_PATTERN = 2
 
+class ProjectType(Enum):
+    ALL = 0
+    GW04 = 1
+    CCP = 2
+
 ItemRule = {
     ItemType.FIXED_VALUE: (
         ColumHeader.Module.value,
@@ -62,7 +69,7 @@ def get_item_by_item_type(item_type: ItemType, row_data):
 
     return tuple(ret_data)
 
-def get_xlsx_data_by_item_type(item_type: ItemType):
+def get_xlsx_data_by_filter(project: ProjectType, item_type: ItemType):
 
     wb = load_workbook(CHECK_LIST_FILE)
     sheet1 = wb.active
@@ -70,7 +77,9 @@ def get_xlsx_data_by_item_type(item_type: ItemType):
     ret_data_table = list()
 
     for row in sheet1.iter_rows():
-        if row[ColumHeader.Type.value].value == item_type.name:
+        if row[ColumHeader.Type.value].value == item_type.name \
+                and (row[ColumHeader.Project.value].value == project.name
+                     or row[ColumHeader.Project.value].value == ProjectType.ALL.name):
             ret_data_table.append(get_item_by_item_type(item_type, row))
 
     return ret_data_table
@@ -79,5 +88,5 @@ def get_xlsx_data_by_item_type(item_type: ItemType):
 
 
 if __name__ == '__main__':
-    table = get_xlsx_data_by_item_type(ItemType.CUSTOM_PATTERN)
+    table = get_xlsx_data_by_filter(ItemType.CUSTOM_PATTERN)
     print(table)

+ 1 - 0
all.py

@@ -6,5 +6,6 @@ import logging
 if __name__ == '__main__':
     logging.basicConfig(level=logging.INFO)
     # pytest.main(['./testcase', '--html=reportname.html'])
+    os.system('del /f /q report result')
     pytest.main(['./testcase', '-v', '--html=reportname.html', '--alluredir', './result/'])
     # os.system('allure generate ./result/ -o ./report --clean')

+ 69 - 11
testcase/test_case.py

@@ -5,15 +5,21 @@
 @Author  :haojiang
 @Date    :2022/9/23 10:09 
 """
+import allure
 import pytest
 
 from Base.ModuleCfgCheck import ModuleCfgCheck, check_module_param_check
-from Data.DataAccess import ItemType, get_xlsx_data_by_item_type
+from Data.DataAccess import ItemType, get_xlsx_data_by_filter, ProjectType
+from Base.Arxml import Arxml
+from Base.BaseContainer import EcucContainerValue
 
+PROJECT_TYPE = ProjectType.CCP
 PROJECT = r'D:\01_Work\02_WP\EP39_EV\branch\src\Config\ECUC'
+# PROJECT = r'D:\01_Work\02_WP\EP39_EV\branch\src\Config\ECUC'
 
-@pytest.mark.parametrize("module_name, param_name, expect_value", get_xlsx_data_by_item_type(ItemType.FIXED_VALUE))
-def test_01_case(module_name, param_name, expect_value):
+@allure.feature('Fix Value Parameter Check')
+@pytest.mark.parametrize("module_name, param_name, expect_value", get_xlsx_data_by_filter(PROJECT_TYPE, ItemType.FIXED_VALUE))
+def test_fix_value_case(module_name, param_name, expect_value):
     '''
     该用例适用于 对某一配置项值进行检查,可能有多个container 都具有该配置项,但所有配置项的值都相同,为一固定值。
     当有一个值与预期值不匹配时,将报错。
@@ -27,8 +33,9 @@ def test_01_case(module_name, param_name, expect_value):
 
     assert True == res
 
-@pytest.mark.parametrize("module_name, search_pattern, param_name, expect_value",  get_xlsx_data_by_item_type(ItemType.CUSTOM_PATTERN))
-def test_02_case(module_name, search_pattern, param_name, expect_value):
+@allure.feature('Custom Pattern Parameter Check')
+@pytest.mark.parametrize("module_name, search_pattern, param_name, expect_value",  get_xlsx_data_by_filter(PROJECT_TYPE, ItemType.CUSTOM_PATTERN))
+def test_custom_pattern_case(module_name, search_pattern, param_name, expect_value):
     '''
     该用例适用于测试 通过某种模式规则,定位到唯一的container, 该container包含的指定配置项,是否与期望值相同。
     例如,可能多个container 都具有该配置项,但对于目标container, 可能和其他container 配置值不同。
@@ -43,10 +50,61 @@ def test_02_case(module_name, search_pattern, param_name, expect_value):
 
     assert True == res
 
-@pytest.mark.parametrize("module_name, search_pattern, param_name, expect_value",  get_xlsx_data_by_item_type(ItemType.DEPENDENCY_PATTERN))
-def test_03_case(module_name, search_pattern, param_name, expect_value):
-    # 该测试用例,用于目标container 需要使用 依赖关系才能确定确定的场景。
+# @allure.feature('case03')
+# @pytest.mark.parametrize("module_name, search_pattern, param_name, expect_value",  get_xlsx_data_by_filter(PROJECT_TYPE, ItemType.DEPENDENCY_PATTERN))
+# def test_03_case(module_name, search_pattern, param_name, expect_value):
+#     # 该测试用例,用于目标container 需要使用 依赖关系才能确定确定的场景。
+#
+#     print(module_name, search_pattern, param_name, expect_value)
+#     assert True == False
+#     pass
 
-    print(module_name, search_pattern, param_name, expect_value)
-    assert True == False
-    pass
+@allure.feature('CanIfRxPduDlcCheck Check')
+@allure.title('CanIfRxPduDlcCheck 检查')
+def test_canif_dlc_check_case():
+    '''
+    该用例用于 CanIf 模块 CanIfRxPduCfg 的CanIfRxPduDlcCheck 检查。
+    :return:
+    '''
+    mcc = ModuleCfgCheck('CanIf', PROJECT)
+    canif_init_cfg = Arxml.get_first_match_element(mcc.arxml_root, './/SHORT-NAME', 'CanIfInitCfg', 'TEXT_EQ')
+
+    ecuc_containers = Arxml.get_all_match_element(Arxml.get_parent_element(canif_init_cfg), './/ECUC-CONTAINER-VALUE')
+    for ecuc in ecuc_containers:
+        ecuc_con = EcucContainerValue(ecuc)
+        ecuc_con_attr = ecuc_con.container_attr
+        ecuc_type = Arxml.get_split_end_value(ecuc_con_attr['container_definition_ref'][-1])
+        if ecuc_type == 'CanIfRxPduCfg':
+            CanIfRxPduDlc = ecuc_con_attr['parameter_values']['CanIfRxPduDlc'][-1]
+            CanIfRxPduDlcCheck = ecuc_con_attr['parameter_values']['CanIfRxPduDlcCheck'][-1]
+            # print(CanIfRxPduDlc, CanIfRxPduDlcCheck)
+            if (CanIfRxPduDlc == '64' and 'true' == CanIfRxPduDlcCheck) or \
+                    (CanIfRxPduDlc != '64' and 'false' == CanIfRxPduDlcCheck):
+                print(f"DLC Check ERROR! {ecuc_con_attr['short_name']}, dlc is {CanIfRxPduDlc} , actual dlccheck is {CanIfRxPduDlcCheck}")
+
+                assert True == False
+
+@allure.feature('CanIfBufferSize Check')
+@allure.title('tx buffer 配置检查')
+def test_canif_buffersize_check_case():
+    '''
+    该用例用于 CanIf 模块 CanIfBufferCfg CanIfBufferSize CanIfTxBufferHandlingType检查。
+    :return:
+    '''
+    mcc = ModuleCfgCheck('CanIf', PROJECT)
+    canif_init_cfg = Arxml.get_first_match_element(mcc.arxml_root, './/SHORT-NAME', 'CanIfInitCfg', 'TEXT_EQ')
+
+    ecuc_containers = Arxml.get_all_match_element(Arxml.get_parent_element(canif_init_cfg), './/ECUC-CONTAINER-VALUE')
+    for ecuc in ecuc_containers:
+        ecuc_con = EcucContainerValue(ecuc)
+        ecuc_con_attr = ecuc_con.container_attr
+        ecuc_type = Arxml.get_split_end_value(ecuc_con_attr['container_definition_ref'][-1])
+        if ecuc_type == 'CanIfBufferCfg':
+            CanIfTxBufferHandlingType = ecuc_con_attr['parameter_values']['CanIfTxBufferHandlingType'][-1]
+            CanIfBufferSize = ecuc_con_attr['parameter_values']['CanIfBufferSize'][-1]
+            CanIfTxBufferMappedTxPdus = ecuc_con_attr['parameter_values']['CanIfTxBufferMappedTxPdus'][-1]
+            print(f"{ecuc_con_attr['short_name']}, CanIfTxBufferHandlingType={CanIfTxBufferHandlingType}")
+            if ('CanIfBufferCfg' not in ecuc_con_attr['short_name'] and
+                    int(CanIfTxBufferMappedTxPdus) > int(CanIfBufferSize)):
+                print(f"CanIfBufferSize Check ERROR! {ecuc_con_attr['short_name']}, CanIfBufferSize={CanIfBufferSize}, CanIfTxBufferMappedTxPdus={CanIfTxBufferMappedTxPdus}")
+                assert True == False