Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating Version of Jmeter to 5.6.2 #1776

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 4 additions & 22 deletions bzt/modules/jmeter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1398,8 +1398,8 @@ class JMeter(RequiredTool):
PLUGINS_MANAGER_LINK = 'https://search.maven.org/remotecontent?filepath=kg/apc/jmeter-plugins-manager/{version}/jmeter-plugins-manager-{version}.jar'
COMMAND_RUNNER_VERSION = "2.2"
COMMAND_RUNNER_LINK = 'https://search.maven.org/remotecontent?filepath=kg/apc/cmdrunner/{version}/cmdrunner-{version}.jar'
VERSION = "5.4.3"
VERSION_LATEST = "5.5"
VERSION = "5.6.2"
VERSION_LATEST = "5.6.2"

def __init__(self, config=None, props=None, **kwargs):
settings = config or BetterDict()
Expand Down Expand Up @@ -1592,7 +1592,7 @@ def _get_jar_fixes(self, lib_dir):
"commons-text": "org/apache/commons/commons-text/1.10.0/commons-text-1.10.0.jar",
"xmlgraphics-commons": "org/apache/xmlgraphics/xmlgraphics-commons/2.8/xmlgraphics-commons-2.8.jar"}

if LooseVersion(self.version) <= LooseVersion('5.4.3'): # log4j must be fixed till jmeter 5.4.3
if LooseVersion(self.version) <= LooseVersion('5.6.2'): # log4j must be fixed till jmeter 5.4.3
affected_names = ["log4j-core", "log4j-api", "log4j-slf4j-impl", "log4j-1.2-api"]
fixed_version = '2.19.0'
maven_link = "org/apache/logging/log4j/{name}/{ver}/{name}-{ver}.jar"
Expand All @@ -1611,22 +1611,6 @@ def _get_jar_fixes(self, lib_dir):

return direct_install_tools

def _fix_jquery_in_jmeter(self, jmeter_dir):
if not self.fix_jars or LooseVersion(self.version) < LooseVersion('5.0.0'):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted this function since LooseVersion is never less than 5 so it could be deleted

return

# Fix CVE-2016-10707 in jquery
jquery_src_dir = os.path.join(jmeter_dir, "jquery-dist-3.6.1")
jquery_target_dir = os.path.join(jmeter_dir,
"bin/report-template/sbadmin2-1.0.7/bower_components/jquery/")
jquery_tar = os.path.join(jmeter_dir, "jquery-dist-3.6.1.tar.gz")
self.__download_additions([["https://github.com/jquery/jquery-dist/archive/3.6.1.tar.gz",
jquery_tar]])
shutil.unpack_archive(jquery_tar, jmeter_dir)
shutil.rmtree(jquery_target_dir, ignore_errors=True)
shutil.move(jquery_src_dir, jquery_target_dir)
os.remove(jquery_tar)

def install(self):
jmeter_dir = get_full_path(self.tool_path, step_up=2)
lib_dir = os.path.join(jmeter_dir, 'lib')
Expand All @@ -1644,9 +1628,7 @@ def install(self):
self.__install_plugins_manager(pm_installer_path)
self.__install_plugins()
# Apply JAR vulnerability fixes
self.__download_additions(self._get_jar_fixes(lib_dir))
self._fix_jquery_in_jmeter(jmeter_dir)


cleaner = JarCleaner(self.log)
cleaner.clean(lib_dir)

Expand Down