def skel_test_run(self, docker_image): """Create dummy analysis tree, run driver scripts and check output""" with tempfile.TemporaryDirectory() as tmpdirname: try: print('NAME', __name__) cur_dir = os.getcwd() os.chdir(tmpdirname) self.write_dummy_tree_and_init_git() rflib.run( Namespace(node='.', recursive=True, verbose=True, dry_run=False, docker_image=docker_image)) command = '''export LC_ALL=C; find . -name '*.txt' | sort | md5sum''' o = subprocess.check_output(command, shell=True).decode() self.assertTrue( o.startswith('2be88994681ecef36d02636683a6bc9e')) command = '''export LC_ALL=C; cat `find . -name '*.txt'` | sort | md5sum''' o = subprocess.check_output(command, shell=True).decode() self.assertTrue( o.startswith('43682754c874d40b3667b2c7c7dc0e65')) finally: os.chdir(cur_dir)
def run(args): """ Runs driver scripts throughout the tree :param args: :return: """ rflib.run(node=args.node, recursive=args.recursive, verbose=args.verbose, dry_run=args.dry_run, docker_image=args.docker_image)
def skel_test_run(self, docker_image): """Create dummy analysis tree, run driver scripts and check output""" with tempfile.TemporaryDirectory() as tmpdirname: try: print('NAME', __name__) cur_dir = os.getcwd() os.chdir(tmpdirname) self.write_dummy_tree_and_init_git() rflib.run(Namespace(node='.', recursive=True, verbose=True, dry_run=False, docker_image=docker_image)) command = '''export LC_ALL=C; find . -name '*.txt' | sort | md5sum''' o = subprocess.check_output(command, shell=True).decode() self.assertTrue(o.startswith('2be88994681ecef36d02636683a6bc9e')) command = '''export LC_ALL=C; cat `find . -name '*.txt'` | sort | md5sum''' o = subprocess.check_output(command, shell=True).decode() self.assertTrue(o.startswith('43682754c874d40b3667b2c7c7dc0e65')) finally: os.chdir(cur_dir)