Commit b286488c by Venkatesh Seetharam

Fix broken python tests as a result of refactoring to atlas

parents 4ad5c42d 1a7dba9f
......@@ -34,8 +34,8 @@ if [ -z "$METADATA_CONF" ]; then
fi
export METADATA_CONF
if [ -f "${METADATA_CONF}/metadata-env.sh" ]; then
. "${METADATA_CONF}/metadata-env.sh"
if [ -f "${METADATA_CONF}/atlas-env.sh" ]; then
. "${METADATA_CONF}/atlas-env.sh"
fi
if test -z ${JAVA_HOME}
......
......@@ -65,7 +65,7 @@ def logDir(dir):
def pidFile(dir):
localPid = os.path.join(dir, LOG)
return os.path.join(os.environ.get(METADATA_PID, localPid), 'metadata.pid')
return os.path.join(os.environ.get(METADATA_PID, localPid), 'atlas.pid')
def dataDir(dir):
data = os.path.join(dir, DATA)
......@@ -77,7 +77,7 @@ def webAppDir(dir):
def expandWebApp(dir):
webappDir = webAppDir(dir)
webAppMetadataDir = os.path.join(webappDir, "metadata")
webAppMetadataDir = os.path.join(webappDir, "atlas")
d = os.sep
if not os.path.exists(os.path.join(webAppMetadataDir, "WEB-INF")):
try:
......@@ -95,7 +95,7 @@ def dirMustExist(dirname):
return dirname
def executeEnvSh(confDir):
envscript = '%s/metadata-env.sh' % confDir
envscript = '%s/atlas-env.sh' % confDir
if not IS_WINDOWS and os.path.exists(envscript):
envCmd = 'source %s && env' % envscript
command = ['bash', '-c', envCmd]
......
......@@ -21,7 +21,7 @@ import traceback
import atlas_config as mc
METADATA_LOG_OPTS="-Dmetadata.log.dir=%s -Dmetadata.log.file=application.log"
METADATA_LOG_OPTS="-Datlas.log.dir=%s -Datlas.log.file=application.log"
METADATA_COMMAND_OPTS="-Dmetadata.home=%s"
METADATA_CONFIG_OPTS="-Dmetadata.conf=%s"
DEFAULT_JVM_OPTS="-Xmx1024m"
......@@ -52,8 +52,8 @@ def main():
p = os.pathsep
metadata_classpath = confdir + p \
+ os.path.join(web_app_dir, "metadata", "WEB-INF", "classes" ) + p \
+ os.path.join(web_app_dir, "metadata", "WEB-INF", "lib", "*" ) + p \
+ os.path.join(web_app_dir, "atlas", "WEB-INF", "classes" ) + p \
+ os.path.join(web_app_dir, "atlas", "WEB-INF", "lib", "*" ) + p \
+ os.path.join(metadata_home, "libext", "*")
metadata_pid_file = mc.pidFile(metadata_home)
......@@ -62,7 +62,7 @@ def main():
print "%s already exists, exiting" % metadata_pid_file
sys.exit()
args = ["-app", os.path.join(web_app_dir, "metadata")]
args = ["-app", os.path.join(web_app_dir, "atlas")]
args.extend(sys.argv[1:])
process = mc.java("org.apache.atlas.Main", args, metadata_classpath, jvm_opts_list, logdir)
......
......@@ -41,8 +41,8 @@ def main():
p = os.pathsep
metadata_classpath = confdir + p \
+ os.path.join(web_app_dir, "metadata", "WEB-INF", "classes" ) + p \
+ os.path.join(web_app_dir, "metadata", "WEB-INF", "lib", "*" ) + p \
+ os.path.join(web_app_dir, "atlas", "WEB-INF", "classes" ) + p \
+ os.path.join(web_app_dir, "atlas", "WEB-INF", "lib", "*" ) + p \
+ os.path.join(metadata_home, "libext", "*")
process = mc.java("org.apache.atlas.util.CredentialProviderUtility", sys.argv[1:], metadata_classpath, jvm_opts_list)
......
......@@ -20,7 +20,7 @@ import sys
import atlas_config as mc
METADATA_LOG_OPTS="-Dmetadata.log.dir=%s"
METADATA_LOG_OPTS="-Datlas.log.dir=%s"
METADATA_COMMAND_OPTS="-Dmetadata.home=%s"
DEFAULT_JVM_OPTS="-Xmx1024m"
......@@ -47,8 +47,8 @@ def main():
p = os.pathsep
metadata_classpath = confdir + p \
+ os.path.join(web_app_dir, "metadata", "WEB-INF", "classes" ) + p \
+ os.path.join(web_app_dir, "metadata", "WEB-INF", "lib", "*" ) + p \
+ os.path.join(web_app_dir, "atlas", "WEB-INF", "classes" ) + p \
+ os.path.join(web_app_dir, "atlas", "WEB-INF", "lib", "*" ) + p \
+ os.path.join(metadata_home, "libext", "*")
process = mc.java("org.apache.atlas.examples.QuickStart", sys.argv[1:], metadata_classpath, jvm_opts_list)
......
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# The java implementation to use. If JAVA_HOME is not found we expect java and jar to be in path
#export JAVA_HOME=
# any additional java opts you want to set. This will apply to both client and server operations
#export METADATA_OPTS=
# any additional java opts that you want to set for client only
#export METADATA_CLIENT_OPTS=
# java heap size we want to set for the client. Default is 1024MB
#export METADATA_CLIENT_HEAP=
# any additional opts you want to set for falcon service.
#export METADATA_SERVER_OPTS=
# java heap size we want to set for the falcon server. Default is 1024MB
#export METADATA_SERVER_HEAP=
# What is is considered as falcon home dir. Default is the base locaion of the installed software
#export METADATA_HOME_DIR=
# Where log files are stored. Defatult is logs directory under the base install location
#export METADATA_LOG_DIR=
# Where pid files are stored. Defatult is logs directory under the base install location
#export METADATA_PID_DIR=
# where the falcon active mq data is stored. Defatult is logs/data directory under the base install location
#export METADATA_DATA_DIR=
# Where do you want to expand the war file. By Default it is in /server/webapp dir under the base install dir.
#export METADATA_EXPANDED_WEBAPP_DIR=
......@@ -23,7 +23,7 @@ from mock import patch
import unittest
import logging
import atlas_config as mc
import metadata_start as metadata
import atlas_start as metadata
import platform
IS_WINDOWS = platform.system() == "Windows"
......@@ -48,15 +48,15 @@ class TestMetadata(unittest.TestCase):
if IS_WINDOWS:
java_mock.assert_called_with(
'org.apache.atlas.Main',
['-app', 'metadata_home/server/webapp/metadata'],
'metadata_home/conf:metadata_home/server/webapp/metadata/WEB-INF/classes:metadata_home/server/webapp/metadata/WEB-INF/lib\\*:metadata_home/libext\\*',
['-Dmetadata.log.dir=metadata_home/logs', '-Dmetadata.log.file=application.log', '-Dmetadata.home=metadata_home', '-Dmetadata.conf=metadata_home/conf', '-Xmx1024m'], 'metadata_home/logs')
['-app', 'metadata_home/server/webapp/atlas'],
'metadata_home/conf:metadata_home/server/webapp/atlas/WEB-INF/classes:metadata_home/server/webapp/atlas/WEB-INF/lib\\*:metadata_home/libext\\*',
['-Datlas.log.dir=metadata_home/logs', '-Datlas.log.file=application.log', '-Dmetadata.home=metadata_home', '-Dmetadata.conf=metadata_home/conf', '-Xmx1024m'], 'metadata_home/logs')
else:
java_mock.assert_called_with(
'org.apache.atlas.Main',
['-app', 'metadata_home/server/webapp/metadata'],
'metadata_home/conf:metadata_home/server/webapp/metadata/WEB-INF/classes:metadata_home/server/webapp/metadata/WEB-INF/lib/*:metadata_home/libext/*',
['-Dmetadata.log.dir=metadata_home/logs', '-Dmetadata.log.file=application.log', '-Dmetadata.home=metadata_home', '-Dmetadata.conf=metadata_home/conf', '-Xmx1024m'], 'metadata_home/logs')
['-app', 'metadata_home/server/webapp/atlas'],
'metadata_home/conf:metadata_home/server/webapp/atlas/WEB-INF/classes:metadata_home/server/webapp/atlas/WEB-INF/lib/*:metadata_home/libext/*',
['-Datlas.log.dir=metadata_home/logs', '-Datlas.log.file=application.log', '-Dmetadata.home=metadata_home', '-Dmetadata.conf=metadata_home/conf', '-Xmx1024m'], 'metadata_home/logs')
pass
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment