bhooshan786 / jmeter-ssh-sampler

Automatically exported from code.google.com/p/jmeter-ssh-sampler
0 stars 0 forks source link

use jmeter-ssh-sampler with JMeter Maven Plugin #17

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.create a jmeter test plan with the ssh plugin => produce a .jmx file
2.create a maven application with jmeter plugin (http://jmeter.lazerycode.com/) 
and add the .jmx file in the /src/test/jmeter/
3.run the sample with mvn verify

What is the expected output? What do you see instead?

I want my maven application finish properly : 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

Instead my test will never end ... i see this :

-bash-4.1$ mvn verify
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building tests 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ test ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, 
i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory 
/home/tomcat/.jenkins/workspace/jmeter-injection-LOGLGTX03-cp-is02-1000-500/src/
main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ test ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ 
test ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, 
i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory 
/home/tomcat/.jenkins/workspace/jmeter-injection-LOGLGTX03-cp-is02-1000-500/src/
test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ test 

---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ test ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ test ---
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] Building jar: 
/home/tomcat/.jenkins/workspace/jmeter-injection-LOGLGTX03-cp-is02-1000-500/targ
et/test-1.0-SNAPSHOT.jar
[INFO]
[INFO] --- jmeter-maven-plugin:1.10.0:jmeter (jmeter-tests) @ test ---
[WARNING] The POM for 
org.apache.jmeter.protocol.ssh.sampler:jmeter-ssh-sampler:jar:0.1.0 is invalid, 
transitive dependencies (if any) will not be available, enable debug logging 
for more details
[INFO]
[INFO] -------------------------------------------------------
[INFO]  P E R F O R M A N C E    T E S T S
[INFO] -------------------------------------------------------
[INFO]
[INFO]
[info]
[debug] JMeter is called with the following command line arguments: -n -t 
/home/tomcat/.jenkins/workspace/jmeter-injection-LOGLGTX03-cp-is02-1000-500/src/
test/jmeter/SSHCommand-LOGLGTX03-cp-is02-1000-500.jmx -l 
/home/tomcat/.jenkins/workspace/jmeter-injection-LOGLGTX03-cp-is02-1000-500/targ
et/jmeter/results/SSHCommand-LOGLGTX03-cp-is02-1000-500.jtl -d 
/home/tomcat/.jenkins/workspace/jmeter-injection-LOGLGTX03-cp-is02-1000-500/targ
et/jmeter -j 
/home/tomcat/.jenkins/workspace/jmeter-injection-LOGLGTX03-cp-is02-1000-500/targ
et/jmeter/logs/SSHCommand-LOGLGTX03-cp-is02-1000-500.jmx.log
[info] Executing test: SSHCommand-LOGLGTX03-cp-is02-1000-500.jmx

//WHEN THE INJECTION IS END THEN THE MAVEN TASK SHOULD STOP AUTOMATICALLY

What version of the product are you using? On what operating system?

mvn -version
Apache Maven 3.2.3 (33f8c3e1027c3ddde99d3cdebad2656a31e8fdf4; 
2014-08-11T22:58:10+02:00)
Maven home: /opt/apache-maven-3.2.3
Java version: 1.7.0_45, vendor: Oracle Corporation
Java home: /usr/java/jdk1.7.0_45/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-358.11.1.el6.x86_64", arch: "amd64", family: 
"unix"

-bash-4.1$ java -version
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)

Please provide any additional information below.

my pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <groupId>com.decathlon.jmeter</groupId>
        <artifactId>test</artifactId>
        <packaging>jar</packaging>
        <version>1.0-SNAPSHOT</version>
        <name>tests</name>
        <url>http://maven.apache.org</url>
        <build>
                <plugins>
                        <plugin>
                                <groupId>com.lazerycode.jmeter</groupId>
                                <artifactId>jmeter-maven-plugin</artifactId>
                                <version>1.10.0</version>
                                <configuration>
                                        <testResultsTimestamp>false</testResultsTimestamp>
                                </configuration>
                                <executions>
                                        <execution>
                                                <id>jmeter-tests</id>
                                                <phase>verify</phase>
                                                <goals>
                                                        <goal>jmeter</goal>
                                                </goals>
                        <configuration>
                             <jMeterProcessJVMSettings>
                                <xms>64</xms>
                                <xmx>64</xmx>
                             </jMeterProcessJVMSettings>
                                                        <jmeterPlugins>
                                                                <plugin>
                                                                        <groupId>org.apache.jmeter.protocol.ssh.sampler</groupId>
                                                                        <artifactId>jmeter-ssh-sampler</artifactId>
                                                                </plugin>
                                                        </jmeterPlugins>
                                                </configuration>
                                        </execution>
                                </executions>
                                <dependencies>
                                        <dependency>
                                                <groupId>com.jcraft</groupId>
                                                <artifactId>jsch</artifactId>
                                                <version>0.1.51</version>
                                        </dependency>
                                        <dependency>
                                                <groupId>org.apache.jmeter.protocol.ssh.sampler</groupId>
                                                <artifactId>jmeter-ssh-sampler</artifactId>
                                                <version>0.1.0</version>
                                        </dependency>
                                </dependencies>
                        </plugin>
                </plugins>
        </build>

</project>

When I use Maven + Jmeter then it works fine. 
I don't understand why my application doesn't properly end when my Jmeter test 
is finish.

Actually my jmeter test plan only performs a ssh connection and make some cp 
command. It takes only a few minutes to be completed when I use the jmeter GUI 
+ SSH plugin. My problem only happens when I combine maven + jmeter plugin + 
ssh plugin for jmeter. I need to do like this because i have to use jenkins to 
schedule test... For now this solution works fine but it would be perfect if my 
test properly end ... If you need more information you can contact me on 
bertrand.deweer@gmail.com

Original issue reported on code.google.com by external...@decathlon.com on 14 Nov 2014 at 1:45

GoogleCodeExporter commented 8 years ago
the solution is to use this parameter : jmeterengine.force.system.exit=true

Original comment by external...@decathlon.com on 2 Dec 2014 at 1:25

GoogleCodeExporter commented 8 years ago
Hi guys
I tried use this parameter (jmeterengine.force.system.exit=true) but didn't 
work. I am with the same problem and I don't know with solved this problem. 
Anybody have an ideia ?

Original comment by thiago.s...@gmail.com on 18 Dec 2014 at 8:37

GoogleCodeExporter commented 8 years ago
Hi, 
Where do you set this properties?
You have to create a file named system.properties with this key/value

like this : 

yourproject/src/test/jmeter/system.properties

Original comment by bertrand...@gmail.com on 19 Dec 2014 at 8:03

GoogleCodeExporter commented 8 years ago
Hi,

Any one solved the issue?
I added:
<propertiesSystem>
<jmeterengine.force.system.exit>true</jmeterengine.force.system.exit>
</propertiesSystem>
After mvn clean install the propertie is set in system.properties.
Anyway the issue is still there.

Original comment by dmichau...@gmail.com on 25 Feb 2015 at 3:04

GoogleCodeExporter commented 8 years ago
Hi,

To me the isssue was solved by adding this propertiesSystem.

Original comment by external...@decathlon.com on 25 Feb 2015 at 3:06