db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kristian Waagan (JIRA)" <j...@apache.org>
Subject [jira] Updated: (DERBY-4804) Make database used in store.OSReadOnlyTest fully read-only
Date Fri, 17 Sep 2010 11:02:33 GMT

     [ https://issues.apache.org/jira/browse/DERBY-4804?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Kristian Waagan updated DERBY-4804:
-----------------------------------

    Attachment: derby-4804-1a-test_change.diff

Patch 1a changes the test to better simulate a read-only database.

The straight-forward approach of making the directories read-only doesn't work, because Java
version before Java SE 6 cannot make a file writable again after making it read-only. This
makes it impossible to delete the directories/files from Java.

Instead of disabling the test for Java version before Java SE 6, I decided to fool Derby by
touching the db.lck file (if it doesn't exist) and making it read-only. This work-around should
be removed when Java 6 is the lowest Java version we support (might take a while :) ).

Patch ready for review.

I will post a follow-up patch to refactor some of the file system routines, probably by moving
them into PrivilegedFileOpsForTests.

> Make database used in store.OSReadOnlyTest fully read-only
> ----------------------------------------------------------
>
>                 Key: DERBY-4804
>                 URL: https://issues.apache.org/jira/browse/DERBY-4804
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.7.0.0
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-4804-1a-test_change.diff
>
>
> store.OSReadOnlyTest is supposed to emulate running Derby on a read-only media, but it
turns out the database directory isn't made read-only - only the files inside the directories
are.
> See http://db.markmail.org/thread/f3qlfx7teg7yk5hr for more details.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message