aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNuoHan Qiao <qiaonuohan@cn.fujitsu.com>2016-01-24 05:15:21 -0500
committerNuoHan Qiao <qiaonuohan@cn.fujitsu.com>2016-01-24 05:15:21 -0500
commit385a0ae062fca5927401d0cf880b3940b9d6ac0f (patch)
tree9b3d46898438299ef5e1113e2e83d8107dcf8e2c
parent8d1b5401eeb05b95a6f17c1b1acceeb0dddcb5bf (diff)
Add two test cases for testing CIAT
Add CIAT.my1 and CIAT.my2. These two cases check touch command on board. And they will be served as the normal test cases in the CIAT Change-Id: I8d8d662c018f67be48ae1c6e8f029d3313b23939 Signed-off-by: NuoHan Qiao <qiaonuohan@cn.fujitsu.com>
-rwxr-xr-xjta-core/engine/tests/CIAT.my1/touch-device.sh15
-rw-r--r--jta-core/engine/tests/CIAT.my1/touch.sh18
-rwxr-xr-xjta-core/engine/tests/CIAT.my2/touch-device.sh15
-rw-r--r--jta-core/engine/tests/CIAT.my2/touch.sh18
-rw-r--r--jta-core/jobs/CIAT.my1/config.xml143
-rw-r--r--jta-core/jobs/CIAT.my2/config.xml143
6 files changed, 352 insertions, 0 deletions
diff --git a/jta-core/engine/tests/CIAT.my1/touch-device.sh b/jta-core/engine/tests/CIAT.my1/touch-device.sh
new file mode 100755
index 0000000..415f3a0
--- /dev/null
+++ b/jta-core/engine/tests/CIAT.my1/touch-device.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+echo "touch function test!"
+
+file=/tmp/$1
+
+rm -rf $file
+touch $file
+
+if [[ -f $file ]]; then
+ echo "PASS"
+else
+ echo "FAIL"
+fi
+
+rm -f $file
diff --git a/jta-core/engine/tests/CIAT.my1/touch.sh b/jta-core/engine/tests/CIAT.my1/touch.sh
new file mode 100644
index 0000000..4c87ebf
--- /dev/null
+++ b/jta-core/engine/tests/CIAT.my1/touch.sh
@@ -0,0 +1,18 @@
+function test_build {
+ echo "test build"
+}
+
+function test_deploy {
+ put $TEST_HOME/touch-device.sh $JTA_HOME/jta.$TESTDIR/
+}
+
+function test_run {
+ report "cd $JTA_HOME/jta.$TESTDIR; ./touch-device.sh tmpfile"
+}
+
+function test_processing {
+ log_compare "$TESTDIR" "1" "PASS$" "p"
+ log_compare "$TESTDIR" "0" "FAIL$" "n"
+}
+
+. $JTA_SCRIPTS_PATH/functional.sh
diff --git a/jta-core/engine/tests/CIAT.my2/touch-device.sh b/jta-core/engine/tests/CIAT.my2/touch-device.sh
new file mode 100755
index 0000000..415f3a0
--- /dev/null
+++ b/jta-core/engine/tests/CIAT.my2/touch-device.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+echo "touch function test!"
+
+file=/tmp/$1
+
+rm -rf $file
+touch $file
+
+if [[ -f $file ]]; then
+ echo "PASS"
+else
+ echo "FAIL"
+fi
+
+rm -f $file
diff --git a/jta-core/engine/tests/CIAT.my2/touch.sh b/jta-core/engine/tests/CIAT.my2/touch.sh
new file mode 100644
index 0000000..4c87ebf
--- /dev/null
+++ b/jta-core/engine/tests/CIAT.my2/touch.sh
@@ -0,0 +1,18 @@
+function test_build {
+ echo "test build"
+}
+
+function test_deploy {
+ put $TEST_HOME/touch-device.sh $JTA_HOME/jta.$TESTDIR/
+}
+
+function test_run {
+ report "cd $JTA_HOME/jta.$TESTDIR; ./touch-device.sh tmpfile"
+}
+
+function test_processing {
+ log_compare "$TESTDIR" "1" "PASS$" "p"
+ log_compare "$TESTDIR" "0" "FAIL$" "n"
+}
+
+. $JTA_SCRIPTS_PATH/functional.sh
diff --git a/jta-core/jobs/CIAT.my1/config.xml b/jta-core/jobs/CIAT.my1/config.xml
new file mode 100644
index 0000000..97421c5
--- /dev/null
+++ b/jta-core/jobs/CIAT.my1/config.xml
@@ -0,0 +1,143 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<project>
+ <actions/>
+ <description></description>
+ <logRotator class="hudson.tasks.LogRotator">
+ <daysToKeep>-1</daysToKeep>
+ <numToKeep>300</numToKeep>
+ <artifactDaysToKeep>-1</artifactDaysToKeep>
+ <artifactNumToKeep>-1</artifactNumToKeep>
+ </logRotator>
+ <keepDependencies>false</keepDependencies>
+ <properties>
+ <jp.ikedam.jenkins.plugins.groovy__label__assignment.GroovyLabelAssignmentProperty plugin="groovy-label-assignment@1.0.0">
+ <groovyScript> return s = binding.getVariables().get(&quot;Device&quot;).toString()</groovyScript>
+ </jp.ikedam.jenkins.plugins.groovy__label__assignment.GroovyLabelAssignmentProperty>
+ <hudson.queueSorter.PrioritySorterJobProperty plugin="PrioritySorter@1.2">
+ <priority>100</priority>
+ </hudson.queueSorter.PrioritySorterJobProperty>
+ <hudson.model.ParametersDefinitionProperty>
+ <parameterDefinitions>
+ <com.seitenbau.jenkins.plugins.dynamicparameter.scriptler.ScriptlerChoiceParameterDefinition plugin="dynamicparameter@0.2.1-SNAPSHOT">
+ <name>Device</name>
+ <description>(target)</description>
+ <__uuid>39fe6994-6fb0-44ce-9951-a4f27c8ad273</__uuid>
+ <__remote>false</__remote>
+ <__scriptlerScriptId>getTargets.groovy</__scriptlerScriptId>
+ <__parameters>
+ <com.seitenbau.jenkins.plugins.dynamicparameter.scriptler.ScriptlerParameterDefinition_-ScriptParameter>
+ <name></name>
+ <value></value>
+ </com.seitenbau.jenkins.plugins.dynamicparameter.scriptler.ScriptlerParameterDefinition_-ScriptParameter>
+ </__parameters>
+ <readonlyInputField>false</readonlyInputField>
+ <choiceType>PT_SINGLE_SELECT</choiceType>
+ </com.seitenbau.jenkins.plugins.dynamicparameter.scriptler.ScriptlerChoiceParameterDefinition>
+ <hudson.model.BooleanParameterDefinition>
+ <name>Reboot</name>
+ <description>If checked target device will be rebooted &lt;u&gt;before&lt;/u&gt; running test.</description>
+ <defaultValue>false</defaultValue>
+ </hudson.model.BooleanParameterDefinition>
+ <hudson.model.BooleanParameterDefinition>
+ <name>Rebuild</name>
+ <description>If checked all existing build instances of the test suite will be deleted and test suite will be rebuilt from tarball.</description>
+ <defaultValue>false</defaultValue>
+ </hudson.model.BooleanParameterDefinition>
+ <hudson.model.BooleanParameterDefinition>
+ <name>Target_Cleanup</name>
+ <description></description>
+ <defaultValue>true</defaultValue>
+ </hudson.model.BooleanParameterDefinition>
+ <com.seitenbau.jenkins.plugins.dynamicparameter.scriptler.ScriptlerChoiceParameterDefinition plugin="dynamicparameter@0.2.1-SNAPSHOT">
+ <name>TESTPLAN</name>
+ <description></description>
+ <__uuid>2d2285ca-b2f0-4d78-b204-053a5a6dd7dc</__uuid>
+ <__remote>false</__remote>
+ <__scriptlerScriptId>getTestplans.groovy</__scriptlerScriptId>
+ <__parameters>
+ <com.seitenbau.jenkins.plugins.dynamicparameter.scriptler.ScriptlerParameterDefinition_-ScriptParameter>
+ <name>test_name</name>
+ <value>CIAT.my1</value>
+ </com.seitenbau.jenkins.plugins.dynamicparameter.scriptler.ScriptlerParameterDefinition_-ScriptParameter>
+ </__parameters>
+ <readonlyInputField>false</readonlyInputField>
+ <choiceType>PT_SINGLE_SELECT</choiceType>
+ </com.seitenbau.jenkins.plugins.dynamicparameter.scriptler.ScriptlerChoiceParameterDefinition>
+ </parameterDefinitions>
+ </hudson.model.ParametersDefinitionProperty>
+ <hudson.plugins.sidebar__link.ProjectLinks plugin="sidebar-link@1.6">
+ <links>
+ <hudson.plugins.sidebar__link.LinkAction>
+ <url>/userContent/docs/jta-docs.pdf</url>
+ <text>Documentation</text>
+ <icon>help.gif</icon>
+ </hudson.plugins.sidebar__link.LinkAction>
+ </links>
+ </hudson.plugins.sidebar__link.ProjectLinks>
+ <hudson.plugins.throttleconcurrents.ThrottleJobProperty plugin="throttle-concurrents@1.6">
+ <maxConcurrentPerNode>0</maxConcurrentPerNode>
+ <maxConcurrentTotal>0</maxConcurrentTotal>
+ <throttleEnabled>false</throttleEnabled>
+ </hudson.plugins.throttleconcurrents.ThrottleJobProperty>
+ </properties>
+ <scm class="hudson.scm.NullSCM"/>
+ <canRoam>true</canRoam>
+ <disabled>false</disabled>
+ <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
+ <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
+ <triggers class="vector"/>
+ <concurrentBuild>true</concurrentBuild>
+ <customWorkspace>/home/jenkins/buildzone</customWorkspace>
+ <builders>
+ <hudson.tasks.Shell>
+ <command>if [ ! -d &quot;$JTA_LOGS_PATH/$JOB_NAME&quot; ]; then mkdir -p &quot;$JTA_LOGS_PATH/$JOB_NAME&quot;; fi
+ echo $TESTPLAN &gt;$JTA_LOGS_PATH/$JOB_NAME/last_used_testplan;
+ TESTPLAN=testplans/$TESTPLAN.json
+
+ source $JTA_TESTS_PATH/$JOB_NAME/touch.sh</command>
+ </hudson.tasks.Shell>
+ </builders>
+ <publishers>
+ <hudson.plugins.postbuildtask.PostbuildTask plugin="postbuild-task@1.8">
+ <tasks>
+ <hudson.plugins.postbuildtask.TaskProperties>
+ <logTexts>
+ <hudson.plugins.postbuildtask.LogProperties>
+ <logText>ssh</logText>
+ <operator>AND</operator>
+ </hudson.plugins.postbuildtask.LogProperties>
+ </logTexts>
+ <EscalateStatus>true</EscalateStatus>
+ <RunIfJobSuccessful>false</RunIfJobSuccessful>
+ <script>source $JTA_SCRIPTS_PATH/functions.sh;&#xd;
+post_test $TESTDIR&#xd;
+</script>
+ </hudson.plugins.postbuildtask.TaskProperties>
+ </tasks>
+ </hudson.plugins.postbuildtask.PostbuildTask>
+ <org.jvnet.hudson.plugins.groovypostbuild.GroovyPostbuildRecorder plugin="groovy-postbuild@1.6-SNAPSHOT">
+ <groovyScript>Binding binding = new Binding();
+binding.setVariable(&quot;manager&quot;, manager);
+GroovyShell shell = new GroovyShell(binding);
+shell.evaluate(new File(&quot;/home/jenkins/scripts/postbuild.groovy&quot;).text);</groovyScript>
+ <behavior>0</behavior>
+ </org.jvnet.hudson.plugins.groovypostbuild.GroovyPostbuildRecorder>
+ </publishers>
+ <buildWrappers>
+ <hudson.plugins.build__timeout.BuildTimeoutWrapper plugin="build-timeout@1.11">
+ <timeoutMinutes>60</timeoutMinutes>
+ <failBuild>false</failBuild>
+ <writingDescription>false</writingDescription>
+ <timeoutPercentage>0</timeoutPercentage>
+ <timeoutType>absolute</timeoutType>
+ <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
+ </hudson.plugins.build__timeout.BuildTimeoutWrapper>
+ <org.jvnet.hudson.plugins.exclusion.IdAllocator plugin="Exclusion@0.8">
+ <ids>
+ <org.jvnet.hudson.plugins.exclusion.DefaultIdType>
+ <name>$JOB_NAME</name>
+ </org.jvnet.hudson.plugins.exclusion.DefaultIdType>
+ </ids>
+ </org.jvnet.hudson.plugins.exclusion.IdAllocator>
+ </buildWrappers>
+</project>
diff --git a/jta-core/jobs/CIAT.my2/config.xml b/jta-core/jobs/CIAT.my2/config.xml
new file mode 100644
index 0000000..19b63a1
--- /dev/null
+++ b/jta-core/jobs/CIAT.my2/config.xml
@@ -0,0 +1,143 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<project>
+ <actions/>
+ <description></description>
+ <logRotator class="hudson.tasks.LogRotator">
+ <daysToKeep>-1</daysToKeep>
+ <numToKeep>300</numToKeep>
+ <artifactDaysToKeep>-1</artifactDaysToKeep>
+ <artifactNumToKeep>-1</artifactNumToKeep>
+ </logRotator>
+ <keepDependencies>false</keepDependencies>
+ <properties>
+ <jp.ikedam.jenkins.plugins.groovy__label__assignment.GroovyLabelAssignmentProperty plugin="groovy-label-assignment@1.0.0">
+ <groovyScript> return s = binding.getVariables().get(&quot;Device&quot;).toString()</groovyScript>
+ </jp.ikedam.jenkins.plugins.groovy__label__assignment.GroovyLabelAssignmentProperty>
+ <hudson.queueSorter.PrioritySorterJobProperty plugin="PrioritySorter@1.2">
+ <priority>100</priority>
+ </hudson.queueSorter.PrioritySorterJobProperty>
+ <hudson.model.ParametersDefinitionProperty>
+ <parameterDefinitions>
+ <com.seitenbau.jenkins.plugins.dynamicparameter.scriptler.ScriptlerChoiceParameterDefinition plugin="dynamicparameter@0.2.1-SNAPSHOT">
+ <name>Device</name>
+ <description>(target)</description>
+ <__uuid>39fe6994-6fb0-44ce-9951-a4f27c8ad273</__uuid>
+ <__remote>false</__remote>
+ <__scriptlerScriptId>getTargets.groovy</__scriptlerScriptId>
+ <__parameters>
+ <com.seitenbau.jenkins.plugins.dynamicparameter.scriptler.ScriptlerParameterDefinition_-ScriptParameter>
+ <name></name>
+ <value></value>
+ </com.seitenbau.jenkins.plugins.dynamicparameter.scriptler.ScriptlerParameterDefinition_-ScriptParameter>
+ </__parameters>
+ <readonlyInputField>false</readonlyInputField>
+ <choiceType>PT_SINGLE_SELECT</choiceType>
+ </com.seitenbau.jenkins.plugins.dynamicparameter.scriptler.ScriptlerChoiceParameterDefinition>
+ <hudson.model.BooleanParameterDefinition>
+ <name>Reboot</name>
+ <description>If checked target device will be rebooted &lt;u&gt;before&lt;/u&gt; running test.</description>
+ <defaultValue>false</defaultValue>
+ </hudson.model.BooleanParameterDefinition>
+ <hudson.model.BooleanParameterDefinition>
+ <name>Rebuild</name>
+ <description>If checked all existing build instances of the test suite will be deleted and test suite will be rebuilt from tarball.</description>
+ <defaultValue>false</defaultValue>
+ </hudson.model.BooleanParameterDefinition>
+ <hudson.model.BooleanParameterDefinition>
+ <name>Target_Cleanup</name>
+ <description></description>
+ <defaultValue>true</defaultValue>
+ </hudson.model.BooleanParameterDefinition>
+ <com.seitenbau.jenkins.plugins.dynamicparameter.scriptler.ScriptlerChoiceParameterDefinition plugin="dynamicparameter@0.2.1-SNAPSHOT">
+ <name>TESTPLAN</name>
+ <description></description>
+ <__uuid>2d2285ca-b2f0-4d78-b204-053a5a6dd7dc</__uuid>
+ <__remote>false</__remote>
+ <__scriptlerScriptId>getTestplans.groovy</__scriptlerScriptId>
+ <__parameters>
+ <com.seitenbau.jenkins.plugins.dynamicparameter.scriptler.ScriptlerParameterDefinition_-ScriptParameter>
+ <name>test_name</name>
+ <value>CIAT.my2</value>
+ </com.seitenbau.jenkins.plugins.dynamicparameter.scriptler.ScriptlerParameterDefinition_-ScriptParameter>
+ </__parameters>
+ <readonlyInputField>false</readonlyInputField>
+ <choiceType>PT_SINGLE_SELECT</choiceType>
+ </com.seitenbau.jenkins.plugins.dynamicparameter.scriptler.ScriptlerChoiceParameterDefinition>
+ </parameterDefinitions>
+ </hudson.model.ParametersDefinitionProperty>
+ <hudson.plugins.sidebar__link.ProjectLinks plugin="sidebar-link@1.6">
+ <links>
+ <hudson.plugins.sidebar__link.LinkAction>
+ <url>/userContent/docs/jta-docs.pdf</url>
+ <text>Documentation</text>
+ <icon>help.gif</icon>
+ </hudson.plugins.sidebar__link.LinkAction>
+ </links>
+ </hudson.plugins.sidebar__link.ProjectLinks>
+ <hudson.plugins.throttleconcurrents.ThrottleJobProperty plugin="throttle-concurrents@1.6">
+ <maxConcurrentPerNode>0</maxConcurrentPerNode>
+ <maxConcurrentTotal>0</maxConcurrentTotal>
+ <throttleEnabled>false</throttleEnabled>
+ </hudson.plugins.throttleconcurrents.ThrottleJobProperty>
+ </properties>
+ <scm class="hudson.scm.NullSCM"/>
+ <canRoam>true</canRoam>
+ <disabled>false</disabled>
+ <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
+ <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
+ <triggers class="vector"/>
+ <concurrentBuild>true</concurrentBuild>
+ <customWorkspace>/home/jenkins/buildzone</customWorkspace>
+ <builders>
+ <hudson.tasks.Shell>
+ <command>if [ ! -d &quot;$JTA_LOGS_PATH/$JOB_NAME&quot; ]; then mkdir -p &quot;$JTA_LOGS_PATH/$JOB_NAME&quot;; fi
+ echo $TESTPLAN &gt;$JTA_LOGS_PATH/$JOB_NAME/last_used_testplan;
+ TESTPLAN=testplans/$TESTPLAN.json
+
+ source $JTA_TESTS_PATH/$JOB_NAME/touch.sh</command>
+ </hudson.tasks.Shell>
+ </builders>
+ <publishers>
+ <hudson.plugins.postbuildtask.PostbuildTask plugin="postbuild-task@1.8">
+ <tasks>
+ <hudson.plugins.postbuildtask.TaskProperties>
+ <logTexts>
+ <hudson.plugins.postbuildtask.LogProperties>
+ <logText>ssh</logText>
+ <operator>AND</operator>
+ </hudson.plugins.postbuildtask.LogProperties>
+ </logTexts>
+ <EscalateStatus>true</EscalateStatus>
+ <RunIfJobSuccessful>false</RunIfJobSuccessful>
+ <script>source $JTA_SCRIPTS_PATH/functions.sh;&#xd;
+post_test $TESTDIR&#xd;
+</script>
+ </hudson.plugins.postbuildtask.TaskProperties>
+ </tasks>
+ </hudson.plugins.postbuildtask.PostbuildTask>
+ <org.jvnet.hudson.plugins.groovypostbuild.GroovyPostbuildRecorder plugin="groovy-postbuild@1.6-SNAPSHOT">
+ <groovyScript>Binding binding = new Binding();
+binding.setVariable(&quot;manager&quot;, manager);
+GroovyShell shell = new GroovyShell(binding);
+shell.evaluate(new File(&quot;/home/jenkins/scripts/postbuild.groovy&quot;).text);</groovyScript>
+ <behavior>0</behavior>
+ </org.jvnet.hudson.plugins.groovypostbuild.GroovyPostbuildRecorder>
+ </publishers>
+ <buildWrappers>
+ <hudson.plugins.build__timeout.BuildTimeoutWrapper plugin="build-timeout@1.11">
+ <timeoutMinutes>60</timeoutMinutes>
+ <failBuild>false</failBuild>
+ <writingDescription>false</writingDescription>
+ <timeoutPercentage>0</timeoutPercentage>
+ <timeoutType>absolute</timeoutType>
+ <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
+ </hudson.plugins.build__timeout.BuildTimeoutWrapper>
+ <org.jvnet.hudson.plugins.exclusion.IdAllocator plugin="Exclusion@0.8">
+ <ids>
+ <org.jvnet.hudson.plugins.exclusion.DefaultIdType>
+ <name>$JOB_NAME</name>
+ </org.jvnet.hudson.plugins.exclusion.DefaultIdType>
+ </ids>
+ </org.jvnet.hudson.plugins.exclusion.IdAllocator>
+ </buildWrappers>
+</project>