@docker_only
    def test_connector_add_wrong_permissions(self):
        self.setup_cluster(NoHadoopBareImageProvider(),
                           self.STANDALONE_PRESTO_CLUSTER)

        # test add connector without read permissions on file
        script = 'chmod 600 /etc/opt/prestoadmin/connectors/tpch.properties;' \
                 ' su app-admin -c "./presto-admin connector add tpch"'
        output = self.run_script_from_prestoadmin_dir(script)
        with open(os.path.join(LOCAL_RESOURCES_DIR,
                               'connector_permissions_warning.txt'), 'r') as f:
            expected = f.read() + \
                {'master': self.cluster.internal_master,
                 'slave1': self.cluster.internal_slaves[0],
                 'slave2': self.cluster.internal_slaves[1],
                 'slave3': self.cluster.internal_slaves[2]}

        self.assertEqualIgnoringOrder(expected, output)

        # test add connector directory without read permissions on directory
        script = 'chmod 600 /etc/opt/prestoadmin/connectors; ' \
                 'su app-admin -c "./presto-admin connector add"'
        output = self.run_script_from_prestoadmin_dir(script)
        permission_error = '\nWarning: [slave3] Permission denied\n\n\n' \
                           'Warning: [slave2] Permission denied\n\n\n' \
                           'Warning: [slave1] Permission denied\n\n\n' \
                           'Warning: [master] Permission denied\n\n'
        self.assertEqualIgnoringOrder(output, permission_error)

        # test add connector by file without read permissions on directory
        script = 'chmod 600 /etc/opt/prestoadmin/connectors; ' \
                 'su app-admin -c "./presto-admin connector add tpch"'
        not_found_error = self.fatal_error(
            'Configuration for connector tpch not found')
        self.assertRaisesRegexp(OSError, not_found_error,
                                self.run_script_from_prestoadmin_dir, script)
dataset/ETHPy150Open prestodb/presto-admin/tests/product/test_connectors.py/TestConnectors.test_connector_add_wrong_permissions/operator `%` -> `+`