[
https://issues.apache.org/jira/browse/AMBARI-17047?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15364372#comment-15364372
]
Andrew Onischuk commented on AMBARI-17047:
------------------------------------------
Reverted due to UT failures:
{noformat}
======================================================================
FAIL: test_check_firewall_is_running (TestAmbariServer.TestAmbariServer)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/user/ambari/ambari-common/src/test/python/mock/mock.py", line
1199, in patched
return func(*args, **keywargs)
File "/home/user/ambari/ambari-server/src/test/python/TestAmbariServer.py",
line 1939, in test_check_firewall_is_running
self.assertTrue(firewall_obj.check_firewall())
AssertionError: False is not true
----------------------------------------------------------------------
Ran 261 tests in 6.342s
FAILED (failures=1)
----------------------------------------------------------------------
Failed tests:
FAIL: test_check_firewall_is_running (TestAmbariServer.TestAmbariServer)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/user/ambari/ambari-common/src/test/python/mock/mock.py", line
1199, in patched
return func(*args, **keywargs)
File "/home/user/ambari/ambari-server/src/test/python/TestAmbariServer.py",
line 1939, in test_check_firewall_is_running
self.assertTrue(firewall_obj.check_firewall())
AssertionError: False is not true
----------------------------------------------------------------------
Total run:1014
Total errors:0
Total failures:1
ERROR
INFO: AMBARI_SERVER_LIB is not set, using default /usr/lib/ambari-server
INFO: Return code from stack upgrade command, retcode = 0
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Ambari Views ...................................... SUCCESS [2.109s]
[INFO] Ambari Metrics Common ............................. SUCCESS [1.016s]
[INFO] Ambari Server ..................................... FAILURE [58.144s]
[INFO] Ambari Agent ...................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:02.045s
[INFO] Finished at: Wed Jul 06 17:19:49 EEST 2016
[INFO] Final Memory: 63M/1128M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec
(python-test) on project ambari-server: Command execution failed. Process
exited with an error: 1 (Exit value: 1) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e
switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please
read the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :ambari-server
{noformat}
> Firewall check returns WARNING even if iptables and firewalld are stopped on
> CentOS7
> ------------------------------------------------------------------------------------
>
> Key: AMBARI-17047
> URL: https://issues.apache.org/jira/browse/AMBARI-17047
> Project: Ambari
> Issue Type: Bug
> Components: ambari-agent, ambari-server
> Affects Versions: trunk
> Environment: CentOS7.2
> Reporter: Masahiro Tanaka
> Assignee: Masahiro Tanaka
> Labels: patch
> Attachments: AMBARI-17047.patch
>
>
> In firewall.py, {{"systemctl is-active iptables || systemctl is-active
> firewalld"}} is passed to {{run_in_shell}} function, which splits cmd string
> by using {{shlex.split}}.
> {{run_in_shell}} function finally calls {{subprocess.Popen}} with
> {{shell=True}}, so the cmd string is evaluated like {{Popen(['/bin/sh', '-c',
> 'systemctl', 'is-active', 'iptables', '||', 'systemctl', 'is-active',
> 'firewalld'])}}. This doesn't returns values as expected, because after
> args[1] (in this case, after the first {{is-active}}) are evaluated as sh
> arguements.
> {{systemctl is-active}} can take multiple arugments, so we can use it.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)