def test_hdfs_home():
hdfs3 = pytest.importorskip('hdfs3')
hdfs = hdfs3.HDFileSystem()
d = '/tmp/test'
try:
hdfs.mkdir(d)
k = Knit(nn='localhost', rm='localhost', nn_port=8020, rm_port=8088,
replication_factor=1, hdfs_home=d)
env_zip = k.create_env(env_name='dev', packages=['python=2.7'], remove=True)
k.start('env', files=[env_zip], memory=128)
assert d + '/.knitDeps' in hdfs.ls(d, False)
assert d + "/.knitDeps/knit-1.0-SNAPSHOT.jar" in hdfs.ls(d + '/.knitDeps', False)
assert d + "/.knitDeps/dev.zip" in hdfs.ls(d + '/.knitDeps', False)
if not k.wait_for_completion(30):
k.kill()
finally:
hdfs.rm(d, True)
k.kill()
评论列表
文章目录