From 246b9cfb26b9b67ae9f6a0609ca84a7853f404b9 Mon Sep 17 00:00:00 2001 From: Mike Conway Date: Mon, 24 Jan 2022 07:57:49 -0500 Subject: [PATCH] #61 release testing/prep activities --- docker-test-framework/4-1/Dockerfile.consumer | 23 +++++------- docker-test-framework/4-1/Dockerfile.provider | 28 +++++---------- .../4-2/for-etc-irods/server_config.json | 2 +- .../core/pub/io/IRODSFileFactoryImpl.java | 14 +------- .../pub/io/IRODSRandomAccessFileTest.java | 31 ---------------- .../datacache/DataCacheServiceImpl.java | 12 +++---- .../NoEncryptDataCacheServiceImpl.java | 12 +++---- .../jargon/ticket/TicketAdminServiceImpl.java | 35 ++++++++----------- .../jargon/ticket/packinstr/TicketInp.java | 1 + .../ticket/TicketAdminServiceImplTest.java | 2 +- 10 files changed, 48 insertions(+), 112 deletions(-) diff --git a/docker-test-framework/4-1/Dockerfile.consumer b/docker-test-framework/4-1/Dockerfile.consumer index 67bc3590b..b9c1b5f06 100644 --- a/docker-test-framework/4-1/Dockerfile.consumer +++ b/docker-test-framework/4-1/Dockerfile.consumer @@ -1,25 +1,20 @@ # # iRODS Provider Image. # -FROM ubuntu:14.04 +# +# iRODS Provider Image. +# +FROM ubuntu:16.04 + +# TODO: Remove this line when apt gets its stuff together +RUN sed --in-place --regexp-extended "s/(\/\/)(archive\.ubuntu)/\1nl.\2/" /etc/apt/sources.list # Install pre-requisites RUN apt-get update && \ - apt-get install -y sudo \ - wget \ - lsb-release \ - apt-transport-https \ - python-pip \ - libfuse2 \ - netcat \ - super \ - python-jsonschema \ - lsof \ - python-psutil \ - curl \ - libjson-perl && \ + apt-get install -y sudo wget lsb-release apt-transport-https postgresql vim python-pip libfuse2 unixodbc rsyslog less && \ pip install xmlrunner + # Grab .debs and install RUN wget https://files.renci.org/pub/irods/releases/4.1.12/ubuntu14/irods-runtime-4.1.12-ubuntu14-x86_64.deb && \ dpkg -i irods-runtime-4.1.12-ubuntu14-x86_64.deb && \ diff --git a/docker-test-framework/4-1/Dockerfile.provider b/docker-test-framework/4-1/Dockerfile.provider index 46bd42748..8d77ca44b 100644 --- a/docker-test-framework/4-1/Dockerfile.provider +++ b/docker-test-framework/4-1/Dockerfile.provider @@ -1,31 +1,21 @@ # # iRODS Provider Image. # -FROM ubuntu:14.04 +FROM ubuntu:16.04 + +# TODO: Remove this line when apt gets its stuff together +RUN sed --in-place --regexp-extended "s/(\/\/)(archive\.ubuntu)/\1nl.\2/" /etc/apt/sources.list # Install pre-requisites RUN apt-get update && \ - apt-get install -y sudo \ - wget \ - lsb-release \ - apt-transport-https \ - postgresql \ - python-pip \ - libfuse2 \ - unixodbc \ - netcat \ - super \ - odbc-postgresql \ - python-jsonschema \ - lsof \ - python-psutil \ - libjson-perl && \ + apt-get install -y sudo wget lsb-release apt-transport-https postgresql vim python-pip libfuse2 unixodbc rsyslog less nano libjson-perl python-psutil python-requests lsof python-jsonschema odbc-postgresql super && \ pip install xmlrunner + # Grab .debs -RUN wget https://files.renci.org/pub/irods/releases/4.1.12/ubuntu14/irods-runtime-4.1.12-ubuntu14-x86_64.deb && \ - wget https://files.renci.org/pub/irods/releases/4.1.12/ubuntu14/irods-icat-4.1.12-ubuntu14-x86_64.deb && \ - wget https://files.renci.org/pub/irods/releases/4.1.12/ubuntu14/irods-database-plugin-postgres-1.12-ubuntu14-x86_64.deb +RUN wget --no-check-certificate https://files.renci.org/pub/irods/releases/4.1.12/ubuntu14/irods-runtime-4.1.12-ubuntu14-x86_64.deb && \ + wget --no-check-certificate https://files.renci.org/pub/irods/releases/4.1.12/ubuntu14/irods-icat-4.1.12-ubuntu14-x86_64.deb && \ + wget --no-check-certificate https://files.renci.org/pub/irods/releases/4.1.12/ubuntu14/irods-database-plugin-postgres-1.12-ubuntu14-x86_64.deb RUN dpkg -i irods-runtime-4.1.12-ubuntu14-x86_64.deb RUN dpkg -i irods-icat-4.1.12-ubuntu14-x86_64.deb diff --git a/docker-test-framework/4-2/for-etc-irods/server_config.json b/docker-test-framework/4-2/for-etc-irods/server_config.json index d0105db6d..9316bdbf5 100644 --- a/docker-test-framework/4-2/for-etc-irods/server_config.json +++ b/docker-test-framework/4-2/for-etc-irods/server_config.json @@ -44,7 +44,7 @@ "plugin_name": "irods_rule_engine_plugin-irods_rule_language", "plugin_specific_configuration": { "re_data_variable_mapping_set": [ - "core","jargon_extras" + "core" ], "re_function_name_mapping_set": [ "core" diff --git a/jargon-core/src/main/java/org/irods/jargon/core/pub/io/IRODSFileFactoryImpl.java b/jargon-core/src/main/java/org/irods/jargon/core/pub/io/IRODSFileFactoryImpl.java index a3df7d71a..9af2d6492 100644 --- a/jargon-core/src/main/java/org/irods/jargon/core/pub/io/IRODSFileFactoryImpl.java +++ b/jargon-core/src/main/java/org/irods/jargon/core/pub/io/IRODSFileFactoryImpl.java @@ -338,20 +338,8 @@ public SessionClosingIRODSFileOutputStream instanceSessionClosingIRODSFileOutput throw new IllegalArgumentException("null irodsFile"); } - FileIOOperations fileIOOperations = new FileIOOperationsAOImpl(getIRODSSession(), getIRODSAccount()); try { - if (!file.exists()) { - log.info("file does not exist, creating a new file"); - file.createNewFileCheckNoResourceFound(OpenFlags.READ_WRITE); - } - - /* - * else if (!file.canWrite()) { - * log.info("this file is not writeable by the current user {}", - * file.getAbsolutePath()); throw new JargonException("file is not writeable:" + - * file.getAbsolutePath()); } - */ - + FileIOOperations fileIOOperations = new FileIOOperationsAOImpl(getIRODSSession(), getIRODSAccount()); return new SessionClosingIRODSFileOutputStream(file, fileIOOperations); } catch (FileNotFoundException e) { log.error("FileNotFound creating output stream", e); diff --git a/jargon-core/src/test/java/org/irods/jargon/core/pub/io/IRODSRandomAccessFileTest.java b/jargon-core/src/test/java/org/irods/jargon/core/pub/io/IRODSRandomAccessFileTest.java index 4cede12fa..1223ecc92 100644 --- a/jargon-core/src/test/java/org/irods/jargon/core/pub/io/IRODSRandomAccessFileTest.java +++ b/jargon-core/src/test/java/org/irods/jargon/core/pub/io/IRODSRandomAccessFileTest.java @@ -12,7 +12,6 @@ import org.irods.jargon.core.checksum.ChecksumValue; import org.irods.jargon.core.connection.IRODSAccount; -import org.irods.jargon.core.packinstr.DataObjInp.OpenFlags; import org.irods.jargon.core.pub.DataTransferOperations; import org.irods.jargon.core.pub.IRODSAccessObjectFactory; import org.irods.jargon.core.pub.IRODSFileSystem; @@ -81,36 +80,6 @@ public final void testCreateAndCloseNoDefResc() throws Exception { } - @Test - public final void testCoordinatedTwoFilesOpenAndClose() throws Exception { - // generate a local scratch file - String testFileName = "testCreateAndCloseNoDefResc.txt"; - String targetIrodsCollection = testingPropertiesHelper - .buildIRODSCollectionAbsolutePathFromTestProperties(testingProperties, IRODS_TEST_SUBDIR_PATH); - - IRODSAccount irodsAccount = testingPropertiesHelper.buildIRODSAccountFromTestProperties(testingProperties); - irodsAccount.setDefaultStorageResource(""); - - IRODSAccessObjectFactory accessObjectFactory = irodsFileSystem.getIRODSAccessObjectFactory(); - - IRODSFileFactory irodsFileFactory = accessObjectFactory.getIRODSFileFactory(irodsAccount); - IRODSFile myFile = irodsFileFactory.instanceIRODSFile(targetIrodsCollection + "/" + testFileName); - - IRODSRandomAccessFile irodsRandomAccessFile = irodsFileFactory.instanceIRODSRandomAccessFile(myFile, - OpenFlags.READ_WRITE_CREATE_IF_NOT_EXISTS, true); - - IRODSFile myFile2 = irodsFileFactory.instanceIRODSFile(targetIrodsCollection + "/" + testFileName); - - IRODSRandomAccessFile irodsRandomAccessFile2 = irodsFileFactory.instanceIRODSRandomAccessFile(myFile2, - OpenFlags.READ_WRITE_CREATE_IF_NOT_EXISTS, true); - - irodsRandomAccessFile.close(); - irodsRandomAccessFile2.close(); - - irodsFileSystem.closeAndEatExceptions(); - - } - @Test public final void testRead() throws Exception { // generate a local scratch file diff --git a/jargon-data-utils/src/main/java/org/irods/jargon/datautils/datacache/DataCacheServiceImpl.java b/jargon-data-utils/src/main/java/org/irods/jargon/datautils/datacache/DataCacheServiceImpl.java index 0ad7d0efb..fff021b24 100644 --- a/jargon-data-utils/src/main/java/org/irods/jargon/datautils/datacache/DataCacheServiceImpl.java +++ b/jargon-data-utils/src/main/java/org/irods/jargon/datautils/datacache/DataCacheServiceImpl.java @@ -114,12 +114,12 @@ public String putStringValueIntoCache(final String stringToCache, final String k * @throws JargonException */ private void createCacheFileAndCacheDir(final IRODSFile cacheFile) throws JargonException { - try { - cacheFile.getParentFile().mkdirs(); - cacheFile.createNewFile(); - } catch (IOException e) { - throw new JargonException("error creating new cache file"); - } + // try { + cacheFile.getParentFile().mkdirs(); + // cacheFile.createNewFile(); + // } catch (IOException e) { + // throw new JargonException("error creating new cache file"); + // } } /* diff --git a/jargon-data-utils/src/main/java/org/irods/jargon/datautils/datacache/NoEncryptDataCacheServiceImpl.java b/jargon-data-utils/src/main/java/org/irods/jargon/datautils/datacache/NoEncryptDataCacheServiceImpl.java index 8804cf7f8..b8613dd6c 100644 --- a/jargon-data-utils/src/main/java/org/irods/jargon/datautils/datacache/NoEncryptDataCacheServiceImpl.java +++ b/jargon-data-utils/src/main/java/org/irods/jargon/datautils/datacache/NoEncryptDataCacheServiceImpl.java @@ -104,12 +104,12 @@ public String putStringValueIntoCache(final String stringToCache, final String k * @throws JargonException */ private void createCacheFileAndCacheDir(final IRODSFile cacheFile) throws JargonException { - try { - cacheFile.getParentFile().mkdirs(); - cacheFile.createNewFile(); - } catch (IOException e) { - throw new JargonException("error creating new cache file"); - } + // try { + cacheFile.getParentFile().mkdirs(); + // cacheFile.createNewFile(); + // } catch (IOException e) { + // throw new JargonException("error creating new cache file"); + // } } /* diff --git a/jargon-ticket/src/main/java/org/irods/jargon/ticket/TicketAdminServiceImpl.java b/jargon-ticket/src/main/java/org/irods/jargon/ticket/TicketAdminServiceImpl.java index e9941de5d..0ee03c75e 100644 --- a/jargon-ticket/src/main/java/org/irods/jargon/ticket/TicketAdminServiceImpl.java +++ b/jargon-ticket/src/main/java/org/irods/jargon/ticket/TicketAdminServiceImpl.java @@ -49,11 +49,10 @@ public final class TicketAdminServiceImpl extends AbstractTicketService implemen * Default constructor takes the objects necessary to communicate with iRODS via * Access Objects * - * @param irodsAccessObjectFactory - * {@link IRODSAccessObjectFactory} that can create various access - * objects - * @param irodsAccount - * {@link IRODSAccount} with login information for the target grid + * @param irodsAccessObjectFactory {@link IRODSAccessObjectFactory} that can + * create various access objects + * @param irodsAccount {@link IRODSAccount} with login information + * for the target grid * @throws JargonException */ TicketAdminServiceImpl(final IRODSAccessObjectFactory irodsAccessObjectFactory, final IRODSAccount irodsAccount) @@ -217,7 +216,6 @@ public String createTicket(final TicketCreateModeEnum mode, final IRODSFile file } TicketAdminInp ticketPI = TicketAdminInp.instanceForCreate(mode, file.getAbsolutePath(), myTicketId); - log.info(EXECUTING_TICKET_PI); ProtocolExtensionPoint pep = irodsAccessObjectFactory.getProtocolExtensionPoint(irodsAccount); Tag ticketOperationResponse = pep.irodsFunction(ticketPI); @@ -1118,15 +1116,13 @@ public boolean deleteAllTicketsForThisUser() throws JargonException { * Given a result row from a ticket query, put the values into the provided * {@code Ticket} common to tickets for collections and data objects * - * @param ticket - * {@link Ticket} object that will be initialized with values from - * the query result row. The provided {@code Ticket} in the method - * parameter will be updated by this method. - * @param row - * {@link IRODSQueryResultRow} from a query for the ticket as - * specified by the methods internal to this object. This is not a - * generally applicable method,, rather it assumes the columns have - * been requested in a certain order. + * @param ticket {@link Ticket} object that will be initialized with values from + * the query result row. The provided {@code Ticket} in the method + * parameter will be updated by this method. + * @param row {@link IRODSQueryResultRow} from a query for the ticket as + * specified by the methods internal to this object. This is not a + * generally applicable method,, rather it assumes the columns + * have been requested in a certain order. * @throws JargonException */ private void putResultDataIntoTicketCommonValues(final Ticket ticket, final IRODSQueryResultRow row) @@ -1164,8 +1160,7 @@ private String buildQuerySelectForLSAllTicketsForCollections() { /** * Add the collection specific elements to a query * - * @param builder - * {@link IRODSGenQueryBuilder} + * @param builder {@link IRODSGenQueryBuilder} * @throws GenQueryBuilderException */ private void addQuerySelectsForListAllTicketsForCollections(final IRODSGenQueryBuilder builder) @@ -1220,8 +1215,7 @@ private String buildQuerySelectForLSAllTicketsForDataObjects() { /** * Add the data object specific elements to a query * - * @param builder - * {@link IRODSGenQueryBuilder} + * @param builder {@link IRODSGenQueryBuilder} * @throws GenQueryBuilderException */ private void addQuerySelectsForListAllTicketsForDataObjects(final IRODSGenQueryBuilder builder) @@ -1273,8 +1267,7 @@ private String buildQuerySelectForTicketsCommon() { * Add selects (which will be in the established order of the passed in builder) * which are the basics for tickets to use in a gen query * - * @param builder - * {@link RIODSGenQueryBuilder} to which the fields will be added + * @param builder {@link RIODSGenQueryBuilder} to which the fields will be added */ private void addSelectsForTicketsCommonToQueryBuilder(final IRODSGenQueryBuilder builder) throws GenQueryBuilderException { diff --git a/jargon-ticket/src/main/java/org/irods/jargon/ticket/packinstr/TicketInp.java b/jargon-ticket/src/main/java/org/irods/jargon/ticket/packinstr/TicketInp.java index 1588cf85d..965de6709 100644 --- a/jargon-ticket/src/main/java/org/irods/jargon/ticket/packinstr/TicketInp.java +++ b/jargon-ticket/src/main/java/org/irods/jargon/ticket/packinstr/TicketInp.java @@ -95,5 +95,6 @@ public Tag getTagValue() throws JargonException { return message; } + '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' } diff --git a/jargon-ticket/src/test/java/org/irods/jargon/ticket/TicketAdminServiceImplTest.java b/jargon-ticket/src/test/java/org/irods/jargon/ticket/TicketAdminServiceImplTest.java index a42161bf2..e50e1a1b1 100644 --- a/jargon-ticket/src/test/java/org/irods/jargon/ticket/TicketAdminServiceImplTest.java +++ b/jargon-ticket/src/test/java/org/irods/jargon/ticket/TicketAdminServiceImplTest.java @@ -2836,7 +2836,7 @@ public void createTicketFromTicketObjectForDataObject() throws Exception { TicketAdminService ticketSvc = new TicketAdminServiceImpl(accessObjectFactory, irodsAccount); Ticket ticket = new Ticket(); - ticket.setTicketString(testFileName); + ticket.setTicketString("createTicketFromTicketObjectF"); ticket.setIrodsAbsolutePath(targetFile.getAbsolutePath()); ticket.setType(TicketCreateModeEnum.READ); Ticket returnedTicket = ticketSvc.createTicketFromTicketObject(ticket);