浏览代码

add script for edgex fvt case

RockyJin 5 年之前
父节点
当前提交
01727d3be3
共有 3 个文件被更改,包括 24 次插入2 次删除
  1. 3 0
      fvt_scripts/run_jmeter.sh
  2. 18 1
      fvt_scripts/select_edgex_condition_rule.jmx
  3. 3 1
      fvt_scripts/start_vdmock.sh

+ 3 - 0
fvt_scripts/run_jmeter.sh

@@ -42,4 +42,7 @@ echo -e "---------------------------------------------\n"
 echo -e "---------------------------------------------\n"
 
 /opt/jmeter/bin/jmeter.sh -Jjmeter.save.saveservice.output_format=xml -n -t fvt_scripts/change_stream_rule.jmx -Dbase="$base_dir" -Dfvt="$fvt_dir" -l change_stream_rule.jtl
+echo -e "---------------------------------------------\n"
+
+/opt/jmeter/bin/jmeter.sh -Jjmeter.save.saveservice.output_format=xml -n -t fvt_scripts/select_edgex_condition_rule.jmx -Dbase="$base_dir" -Dfvt="$fvt_dir" -l select_edgex_condition_rule.jtl
 echo -e "---------------------------------------------\n"

+ 18 - 1
fvt_scripts/select_edgex_condition_rule.jmx

@@ -36,7 +36,7 @@
           </elementProp>
           <elementProp name="mqtt_srv" elementType="Argument">
             <stringProp name="Argument.name">mqtt_srv</stringProp>
-            <stringProp name="Argument.value">127.0.0.1</stringProp>
+            <stringProp name="Argument.value">10.211.55.6</stringProp>
             <stringProp name="Argument.metadata">=</stringProp>
           </elementProp>
         </collectionProp>
@@ -464,6 +464,23 @@
             <boolProp name="ISREGEX">false</boolProp>
           </JSONPathAssertion>
           <hashTree/>
+          <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="temperature value assertion" enabled="true">
+            <stringProp name="BeanShellAssertion.query">import net.sf.json.JSONArray;
+import net.sf.json.JSONObject;
+
+String response = SampleResult.getResponseDataAsString();
+JSONArray arr = JSONArray.fromObject(response);
+JSONObject json = arr.getJSONObject(0);
+int temp = json.getInt(&quot;temperature&quot;);
+if(temp &lt;= 30) {
+	Failure = true;
+	FailureMessage = &quot;The temperature result should not be less than 30!&quot;;
+}</stringProp>
+            <stringProp name="BeanShellAssertion.filename"></stringProp>
+            <stringProp name="BeanShellAssertion.parameters"></stringProp>
+            <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp>
+          </BeanShellAssertion>
+          <hashTree/>
         </hashTree>
       </hashTree>
     </hashTree>

+ 3 - 1
fvt_scripts/start_vdmock.sh

@@ -3,7 +3,9 @@
 
 
 echo "starting edgex value descriptor mockup server."
+PATH=$PATH:/usr/local/go/bin
+export PATH
 go build -o fvt_scripts/edgex/vdmocker fvt_scripts/edgex/vd_server.go
 go build -o fvt_scripts/edgex/pub fvt_scripts/edgex/pub.go
 export BUILD_ID=dontKillMe
-nohup fvt_scripts/edgex/vdmocker > log/vdmocker.out 2>&1 &
+nohup fvt_scripts/edgex/vdmocker > vdmocker.out 2>&1 &