You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oodt.apache.org by "Scott Konzem (JIRA)" <ji...@apache.org> on 2011/01/11 19:04:47 UTC

[jira] Created: (OODT-110) TestExternMetExtractor fails if temp directory is mounted noexec

TestExternMetExtractor fails if temp directory is mounted noexec
----------------------------------------------------------------

                 Key: OODT-110
                 URL: https://issues.apache.org/jira/browse/OODT-110
             Project: OODT
          Issue Type: Bug
          Components: build proces
    Affects Versions: 0.2
         Environment: Linux with Sun JDK 6 and /tmp mounted with noexec option
            Reporter: Scott Konzem


The setup() method in the test class org.apache.oodt.cas.metadata.extractors.TestExternMetExtractor writes an executable file to the default Java temp directory, which on my system is /tmp.  For security reasons, /tmp on my system has been mounted noexec, meaning no files on this partition can be executed (for the most part).  When the testExtractor() method then tries to run the executable, it causes a test failure that prevents me from moving further in the build process.  That's as far as I've gotten with installation, so I don't know if this is how the program would work in production.  The output is as follows:

Running org.apache.oodt.cas.metadata.extractors.TestExternMetExtractor
Jan 11, 2011 8:15:58 AM org.apache.oodt.cas.metadata.extractors.ExternMetExtractor extrMetadata
INFO: Generating met file for product file: [/tmp/metadata5254850749474468821.tests/testfile.txt]
Jan 11, 2011 8:15:58 AM org.apache.oodt.cas.metadata.extractors.ExternMetExtractor extrMetadata
INFO: Executing command line: [/tmp/metadata5254850749474468821.tests/testExtractor /tmp/metadata5254850749474468821.tests/testfile.txt /tmp/metadata5254850749474468821.tests/testfile.txt.met -Dtrue=always foo bar /home/scott/test\ boo ] with workingDir: [/tmp/metadata5254850749474468821.tests] to extract metadata
Jan 11, 2011 8:15:58 AM org.apache.oodt.cas.metadata.extractors.ExternMetExtractor extrMetadata
WARNING: IOException running met extraction: commandLine: [/tmp/metadata5254850749474468821.tests/testExtractor /tmp/metadata5254850749474468821.tests/testfile.txt /tmp/metadata5254850749474468821.tests/testfile.txt.met -Dtrue=always foo bar /home/scott/test\ boo ]: Message: Cannot run program "/tmp/metadata5254850749474468821.tests/testExtractor" (in directory "/tmp/metadata5254850749474468821.tests"): java.io.IOException: error=13, Permission denied
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.387 sec <<< FAILURE!

I'd also note that org.apache.oodt.cas.metadata.extractors.TestExternMetExtractor.setup() runs a "chmod +x" on the temp executable file.  This means the test will likely fail on a non-*nix system and halt the build process.  The associated comment in the code is "yes this is ghetto" (line 123).

I'm not sure if it's possible to change Java's temp directory with an environment variable; so far the only way I've found to change it is by setting -Djava.io.tmpdir. See http://stackoverflow.com/questions/1924136/environment-variable-to-control-java-io-tmpdir

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


[jira] Commented: (OODT-110) TestExternMetExtractor fails if temp directory is mounted noexec

Posted by "Sean McCleese (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OODT-110?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12980234#action_12980234 ] 

Sean McCleese commented on OODT-110:
------------------------------------

I can confirm that this fails on non-*nix systems, as I'm encountering the same error on Windows 7. This is likely due to the issue identified on line 124 of TestExternMetExtractor.java

> TestExternMetExtractor fails if temp directory is mounted noexec
> ----------------------------------------------------------------
>
>                 Key: OODT-110
>                 URL: https://issues.apache.org/jira/browse/OODT-110
>             Project: OODT
>          Issue Type: Bug
>          Components: build proces
>    Affects Versions: 0.2
>         Environment: Linux with Sun JDK 6 and /tmp mounted with noexec option
>            Reporter: Scott Konzem
>
> The setup() method in the test class org.apache.oodt.cas.metadata.extractors.TestExternMetExtractor writes an executable file to the default Java temp directory, which on my system is /tmp.  For security reasons, /tmp on my system has been mounted noexec, meaning no files on this partition can be executed (for the most part).  When the testExtractor() method then tries to run the executable, it causes a test failure that prevents me from moving further in the build process.  That's as far as I've gotten with installation, so I don't know if this is how the program would work in production.  The output is as follows:
> Running org.apache.oodt.cas.metadata.extractors.TestExternMetExtractor
> Jan 11, 2011 8:15:58 AM org.apache.oodt.cas.metadata.extractors.ExternMetExtractor extrMetadata
> INFO: Generating met file for product file: [/tmp/metadata5254850749474468821.tests/testfile.txt]
> Jan 11, 2011 8:15:58 AM org.apache.oodt.cas.metadata.extractors.ExternMetExtractor extrMetadata
> INFO: Executing command line: [/tmp/metadata5254850749474468821.tests/testExtractor /tmp/metadata5254850749474468821.tests/testfile.txt /tmp/metadata5254850749474468821.tests/testfile.txt.met -Dtrue=always foo bar /home/scott/test\ boo ] with workingDir: [/tmp/metadata5254850749474468821.tests] to extract metadata
> Jan 11, 2011 8:15:58 AM org.apache.oodt.cas.metadata.extractors.ExternMetExtractor extrMetadata
> WARNING: IOException running met extraction: commandLine: [/tmp/metadata5254850749474468821.tests/testExtractor /tmp/metadata5254850749474468821.tests/testfile.txt /tmp/metadata5254850749474468821.tests/testfile.txt.met -Dtrue=always foo bar /home/scott/test\ boo ]: Message: Cannot run program "/tmp/metadata5254850749474468821.tests/testExtractor" (in directory "/tmp/metadata5254850749474468821.tests"): java.io.IOException: error=13, Permission denied
> Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.387 sec <<< FAILURE!
> I'd also note that org.apache.oodt.cas.metadata.extractors.TestExternMetExtractor.setup() runs a "chmod +x" on the temp executable file.  This means the test will likely fail on a non-*nix system and halt the build process.  The associated comment in the code is "yes this is ghetto" (line 123).
> I'm not sure if it's possible to change Java's temp directory with an environment variable; so far the only way I've found to change it is by setting -Djava.io.tmpdir. See http://stackoverflow.com/questions/1924136/environment-variable-to-control-java-io-tmpdir

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


[jira] Updated: (OODT-110) TestExternMetExtractor fails if temp directory is mounted noexec

Posted by "Paul Ramirez (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OODT-110?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul Ramirez updated OODT-110:
------------------------------

    Fix Version/s:     (was: 0.2)
                   0.3

Pushing off to 0.3 release.

> TestExternMetExtractor fails if temp directory is mounted noexec
> ----------------------------------------------------------------
>
>                 Key: OODT-110
>                 URL: https://issues.apache.org/jira/browse/OODT-110
>             Project: OODT
>          Issue Type: Bug
>          Components: build proces
>    Affects Versions: 0.1-incubating
>         Environment: Linux with Sun JDK 6 and /tmp mounted with noexec option
>            Reporter: Scott Konzem
>            Priority: Minor
>             Fix For: 0.3
>
>         Attachments: TestExternMetExtractor.patch
>
>
> The setup() method in the test class org.apache.oodt.cas.metadata.extractors.TestExternMetExtractor writes an executable file to the default Java temp directory, which on my system is /tmp.  For security reasons, /tmp on my system has been mounted noexec, meaning no files on this partition can be executed (for the most part).  When the testExtractor() method then tries to run the executable, it causes a test failure that prevents me from moving further in the build process.  That's as far as I've gotten with installation, so I don't know if this is how the program would work in production.  The output is as follows:
> Running org.apache.oodt.cas.metadata.extractors.TestExternMetExtractor
> Jan 11, 2011 8:15:58 AM org.apache.oodt.cas.metadata.extractors.ExternMetExtractor extrMetadata
> INFO: Generating met file for product file: [/tmp/metadata5254850749474468821.tests/testfile.txt]
> Jan 11, 2011 8:15:58 AM org.apache.oodt.cas.metadata.extractors.ExternMetExtractor extrMetadata
> INFO: Executing command line: [/tmp/metadata5254850749474468821.tests/testExtractor /tmp/metadata5254850749474468821.tests/testfile.txt /tmp/metadata5254850749474468821.tests/testfile.txt.met -Dtrue=always foo bar /home/scott/test\ boo ] with workingDir: [/tmp/metadata5254850749474468821.tests] to extract metadata
> Jan 11, 2011 8:15:58 AM org.apache.oodt.cas.metadata.extractors.ExternMetExtractor extrMetadata
> WARNING: IOException running met extraction: commandLine: [/tmp/metadata5254850749474468821.tests/testExtractor /tmp/metadata5254850749474468821.tests/testfile.txt /tmp/metadata5254850749474468821.tests/testfile.txt.met -Dtrue=always foo bar /home/scott/test\ boo ]: Message: Cannot run program "/tmp/metadata5254850749474468821.tests/testExtractor" (in directory "/tmp/metadata5254850749474468821.tests"): java.io.IOException: error=13, Permission denied
> Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.387 sec <<< FAILURE!
> I'd also note that org.apache.oodt.cas.metadata.extractors.TestExternMetExtractor.setup() runs a "chmod +x" on the temp executable file.  This means the test will likely fail on a non-*nix system and halt the build process.  The associated comment in the code is "yes this is ghetto" (line 123).
> I'm not sure if it's possible to change Java's temp directory with an environment variable; so far the only way I've found to change it is by setting -Djava.io.tmpdir. See http://stackoverflow.com/questions/1924136/environment-variable-to-control-java-io-tmpdir

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


[jira] Updated: (OODT-110) TestExternMetExtractor fails if temp directory is mounted noexec

Posted by "Chris A. Mattmann (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OODT-110?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris A. Mattmann updated OODT-110:
-----------------------------------

             Priority: Minor  (was: Major)
    Affects Version/s:     (was: 0.2)
                       0.1-incubating
        Fix Version/s: 0.2

- schedule and classify

> TestExternMetExtractor fails if temp directory is mounted noexec
> ----------------------------------------------------------------
>
>                 Key: OODT-110
>                 URL: https://issues.apache.org/jira/browse/OODT-110
>             Project: OODT
>          Issue Type: Bug
>          Components: build proces
>    Affects Versions: 0.1-incubating
>         Environment: Linux with Sun JDK 6 and /tmp mounted with noexec option
>            Reporter: Scott Konzem
>            Priority: Minor
>             Fix For: 0.2
>
>         Attachments: TestExternMetExtractor.patch
>
>
> The setup() method in the test class org.apache.oodt.cas.metadata.extractors.TestExternMetExtractor writes an executable file to the default Java temp directory, which on my system is /tmp.  For security reasons, /tmp on my system has been mounted noexec, meaning no files on this partition can be executed (for the most part).  When the testExtractor() method then tries to run the executable, it causes a test failure that prevents me from moving further in the build process.  That's as far as I've gotten with installation, so I don't know if this is how the program would work in production.  The output is as follows:
> Running org.apache.oodt.cas.metadata.extractors.TestExternMetExtractor
> Jan 11, 2011 8:15:58 AM org.apache.oodt.cas.metadata.extractors.ExternMetExtractor extrMetadata
> INFO: Generating met file for product file: [/tmp/metadata5254850749474468821.tests/testfile.txt]
> Jan 11, 2011 8:15:58 AM org.apache.oodt.cas.metadata.extractors.ExternMetExtractor extrMetadata
> INFO: Executing command line: [/tmp/metadata5254850749474468821.tests/testExtractor /tmp/metadata5254850749474468821.tests/testfile.txt /tmp/metadata5254850749474468821.tests/testfile.txt.met -Dtrue=always foo bar /home/scott/test\ boo ] with workingDir: [/tmp/metadata5254850749474468821.tests] to extract metadata
> Jan 11, 2011 8:15:58 AM org.apache.oodt.cas.metadata.extractors.ExternMetExtractor extrMetadata
> WARNING: IOException running met extraction: commandLine: [/tmp/metadata5254850749474468821.tests/testExtractor /tmp/metadata5254850749474468821.tests/testfile.txt /tmp/metadata5254850749474468821.tests/testfile.txt.met -Dtrue=always foo bar /home/scott/test\ boo ]: Message: Cannot run program "/tmp/metadata5254850749474468821.tests/testExtractor" (in directory "/tmp/metadata5254850749474468821.tests"): java.io.IOException: error=13, Permission denied
> Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.387 sec <<< FAILURE!
> I'd also note that org.apache.oodt.cas.metadata.extractors.TestExternMetExtractor.setup() runs a "chmod +x" on the temp executable file.  This means the test will likely fail on a non-*nix system and halt the build process.  The associated comment in the code is "yes this is ghetto" (line 123).
> I'm not sure if it's possible to change Java's temp directory with an environment variable; so far the only way I've found to change it is by setting -Djava.io.tmpdir. See http://stackoverflow.com/questions/1924136/environment-variable-to-control-java-io-tmpdir

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


[jira] Commented: (OODT-110) TestExternMetExtractor fails if temp directory is mounted noexec

Posted by "Paul Ramirez (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OODT-110?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12980261#action_12980261 ] 

Paul Ramirez commented on OODT-110:
-----------------------------------

You could try setting the java.io.tmpdir when building. This should be as easy as adding the following on the command line:

-Djava.io.tmpdir=C:\mydir

This will not resolve the "chmod +x" issue as I'm not sure File object in Java had a setExecutable until 1.6.

That said if you wish to build and skip unit tests you can pass -DskipTests=true and that will stop maven from running the unit tests. This is only a work around. 

> TestExternMetExtractor fails if temp directory is mounted noexec
> ----------------------------------------------------------------
>
>                 Key: OODT-110
>                 URL: https://issues.apache.org/jira/browse/OODT-110
>             Project: OODT
>          Issue Type: Bug
>          Components: build proces
>    Affects Versions: 0.2
>         Environment: Linux with Sun JDK 6 and /tmp mounted with noexec option
>            Reporter: Scott Konzem
>
> The setup() method in the test class org.apache.oodt.cas.metadata.extractors.TestExternMetExtractor writes an executable file to the default Java temp directory, which on my system is /tmp.  For security reasons, /tmp on my system has been mounted noexec, meaning no files on this partition can be executed (for the most part).  When the testExtractor() method then tries to run the executable, it causes a test failure that prevents me from moving further in the build process.  That's as far as I've gotten with installation, so I don't know if this is how the program would work in production.  The output is as follows:
> Running org.apache.oodt.cas.metadata.extractors.TestExternMetExtractor
> Jan 11, 2011 8:15:58 AM org.apache.oodt.cas.metadata.extractors.ExternMetExtractor extrMetadata
> INFO: Generating met file for product file: [/tmp/metadata5254850749474468821.tests/testfile.txt]
> Jan 11, 2011 8:15:58 AM org.apache.oodt.cas.metadata.extractors.ExternMetExtractor extrMetadata
> INFO: Executing command line: [/tmp/metadata5254850749474468821.tests/testExtractor /tmp/metadata5254850749474468821.tests/testfile.txt /tmp/metadata5254850749474468821.tests/testfile.txt.met -Dtrue=always foo bar /home/scott/test\ boo ] with workingDir: [/tmp/metadata5254850749474468821.tests] to extract metadata
> Jan 11, 2011 8:15:58 AM org.apache.oodt.cas.metadata.extractors.ExternMetExtractor extrMetadata
> WARNING: IOException running met extraction: commandLine: [/tmp/metadata5254850749474468821.tests/testExtractor /tmp/metadata5254850749474468821.tests/testfile.txt /tmp/metadata5254850749474468821.tests/testfile.txt.met -Dtrue=always foo bar /home/scott/test\ boo ]: Message: Cannot run program "/tmp/metadata5254850749474468821.tests/testExtractor" (in directory "/tmp/metadata5254850749474468821.tests"): java.io.IOException: error=13, Permission denied
> Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.387 sec <<< FAILURE!
> I'd also note that org.apache.oodt.cas.metadata.extractors.TestExternMetExtractor.setup() runs a "chmod +x" on the temp executable file.  This means the test will likely fail on a non-*nix system and halt the build process.  The associated comment in the code is "yes this is ghetto" (line 123).
> I'm not sure if it's possible to change Java's temp directory with an environment variable; so far the only way I've found to change it is by setting -Djava.io.tmpdir. See http://stackoverflow.com/questions/1924136/environment-variable-to-control-java-io-tmpdir

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


[jira] Commented: (OODT-110) TestExternMetExtractor fails if temp directory is mounted noexec

Posted by "Scott Konzem (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OODT-110?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12980284#action_12980284 ] 

Scott Konzem commented on OODT-110:
-----------------------------------

Setting -Djava.io.tmpdir as part of the "mvn install" command was an effective workaround, and my build is proceeding.  Thanks -- I didn't know you could do that.

> TestExternMetExtractor fails if temp directory is mounted noexec
> ----------------------------------------------------------------
>
>                 Key: OODT-110
>                 URL: https://issues.apache.org/jira/browse/OODT-110
>             Project: OODT
>          Issue Type: Bug
>          Components: build proces
>    Affects Versions: 0.2
>         Environment: Linux with Sun JDK 6 and /tmp mounted with noexec option
>            Reporter: Scott Konzem
>         Attachments: TestExternMetExtractor.patch
>
>
> The setup() method in the test class org.apache.oodt.cas.metadata.extractors.TestExternMetExtractor writes an executable file to the default Java temp directory, which on my system is /tmp.  For security reasons, /tmp on my system has been mounted noexec, meaning no files on this partition can be executed (for the most part).  When the testExtractor() method then tries to run the executable, it causes a test failure that prevents me from moving further in the build process.  That's as far as I've gotten with installation, so I don't know if this is how the program would work in production.  The output is as follows:
> Running org.apache.oodt.cas.metadata.extractors.TestExternMetExtractor
> Jan 11, 2011 8:15:58 AM org.apache.oodt.cas.metadata.extractors.ExternMetExtractor extrMetadata
> INFO: Generating met file for product file: [/tmp/metadata5254850749474468821.tests/testfile.txt]
> Jan 11, 2011 8:15:58 AM org.apache.oodt.cas.metadata.extractors.ExternMetExtractor extrMetadata
> INFO: Executing command line: [/tmp/metadata5254850749474468821.tests/testExtractor /tmp/metadata5254850749474468821.tests/testfile.txt /tmp/metadata5254850749474468821.tests/testfile.txt.met -Dtrue=always foo bar /home/scott/test\ boo ] with workingDir: [/tmp/metadata5254850749474468821.tests] to extract metadata
> Jan 11, 2011 8:15:58 AM org.apache.oodt.cas.metadata.extractors.ExternMetExtractor extrMetadata
> WARNING: IOException running met extraction: commandLine: [/tmp/metadata5254850749474468821.tests/testExtractor /tmp/metadata5254850749474468821.tests/testfile.txt /tmp/metadata5254850749474468821.tests/testfile.txt.met -Dtrue=always foo bar /home/scott/test\ boo ]: Message: Cannot run program "/tmp/metadata5254850749474468821.tests/testExtractor" (in directory "/tmp/metadata5254850749474468821.tests"): java.io.IOException: error=13, Permission denied
> Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.387 sec <<< FAILURE!
> I'd also note that org.apache.oodt.cas.metadata.extractors.TestExternMetExtractor.setup() runs a "chmod +x" on the temp executable file.  This means the test will likely fail on a non-*nix system and halt the build process.  The associated comment in the code is "yes this is ghetto" (line 123).
> I'm not sure if it's possible to change Java's temp directory with an environment variable; so far the only way I've found to change it is by setting -Djava.io.tmpdir. See http://stackoverflow.com/questions/1924136/environment-variable-to-control-java-io-tmpdir

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


[jira] Updated: (OODT-110) TestExternMetExtractor fails if temp directory is mounted noexec

Posted by "Sean McCleese (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OODT-110?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sean McCleese updated OODT-110:
-------------------------------

    Attachment: TestExternMetExtractor.patch

This should fix the Windows-side error at least, using the Java 1.6 setExecutable method rather than a system call

> TestExternMetExtractor fails if temp directory is mounted noexec
> ----------------------------------------------------------------
>
>                 Key: OODT-110
>                 URL: https://issues.apache.org/jira/browse/OODT-110
>             Project: OODT
>          Issue Type: Bug
>          Components: build proces
>    Affects Versions: 0.2
>         Environment: Linux with Sun JDK 6 and /tmp mounted with noexec option
>            Reporter: Scott Konzem
>         Attachments: TestExternMetExtractor.patch
>
>
> The setup() method in the test class org.apache.oodt.cas.metadata.extractors.TestExternMetExtractor writes an executable file to the default Java temp directory, which on my system is /tmp.  For security reasons, /tmp on my system has been mounted noexec, meaning no files on this partition can be executed (for the most part).  When the testExtractor() method then tries to run the executable, it causes a test failure that prevents me from moving further in the build process.  That's as far as I've gotten with installation, so I don't know if this is how the program would work in production.  The output is as follows:
> Running org.apache.oodt.cas.metadata.extractors.TestExternMetExtractor
> Jan 11, 2011 8:15:58 AM org.apache.oodt.cas.metadata.extractors.ExternMetExtractor extrMetadata
> INFO: Generating met file for product file: [/tmp/metadata5254850749474468821.tests/testfile.txt]
> Jan 11, 2011 8:15:58 AM org.apache.oodt.cas.metadata.extractors.ExternMetExtractor extrMetadata
> INFO: Executing command line: [/tmp/metadata5254850749474468821.tests/testExtractor /tmp/metadata5254850749474468821.tests/testfile.txt /tmp/metadata5254850749474468821.tests/testfile.txt.met -Dtrue=always foo bar /home/scott/test\ boo ] with workingDir: [/tmp/metadata5254850749474468821.tests] to extract metadata
> Jan 11, 2011 8:15:58 AM org.apache.oodt.cas.metadata.extractors.ExternMetExtractor extrMetadata
> WARNING: IOException running met extraction: commandLine: [/tmp/metadata5254850749474468821.tests/testExtractor /tmp/metadata5254850749474468821.tests/testfile.txt /tmp/metadata5254850749474468821.tests/testfile.txt.met -Dtrue=always foo bar /home/scott/test\ boo ]: Message: Cannot run program "/tmp/metadata5254850749474468821.tests/testExtractor" (in directory "/tmp/metadata5254850749474468821.tests"): java.io.IOException: error=13, Permission denied
> Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.387 sec <<< FAILURE!
> I'd also note that org.apache.oodt.cas.metadata.extractors.TestExternMetExtractor.setup() runs a "chmod +x" on the temp executable file.  This means the test will likely fail on a non-*nix system and halt the build process.  The associated comment in the code is "yes this is ghetto" (line 123).
> I'm not sure if it's possible to change Java's temp directory with an environment variable; so far the only way I've found to change it is by setting -Djava.io.tmpdir. See http://stackoverflow.com/questions/1924136/environment-variable-to-control-java-io-tmpdir

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


[jira] Resolved: (OODT-110) TestExternMetExtractor fails if temp directory is mounted noexec

Posted by "Chris A. Mattmann (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OODT-110?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris A. Mattmann resolved OODT-110.
------------------------------------

    Resolution: Fixed

Sounds like we have an effective workaround. I'm marking this as closed. Committed a change log entry for the item in r1078045. If this is an issue for anyone else or the work around doesn't "work" for them, let us know and open up a new issue.

> TestExternMetExtractor fails if temp directory is mounted noexec
> ----------------------------------------------------------------
>
>                 Key: OODT-110
>                 URL: https://issues.apache.org/jira/browse/OODT-110
>             Project: OODT
>          Issue Type: Bug
>          Components: build proces
>    Affects Versions: 0.1-incubating
>         Environment: Linux with Sun JDK 6 and /tmp mounted with noexec option
>            Reporter: Scott Konzem
>            Priority: Minor
>             Fix For: 0.3
>
>         Attachments: TestExternMetExtractor.patch
>
>
> The setup() method in the test class org.apache.oodt.cas.metadata.extractors.TestExternMetExtractor writes an executable file to the default Java temp directory, which on my system is /tmp.  For security reasons, /tmp on my system has been mounted noexec, meaning no files on this partition can be executed (for the most part).  When the testExtractor() method then tries to run the executable, it causes a test failure that prevents me from moving further in the build process.  That's as far as I've gotten with installation, so I don't know if this is how the program would work in production.  The output is as follows:
> Running org.apache.oodt.cas.metadata.extractors.TestExternMetExtractor
> Jan 11, 2011 8:15:58 AM org.apache.oodt.cas.metadata.extractors.ExternMetExtractor extrMetadata
> INFO: Generating met file for product file: [/tmp/metadata5254850749474468821.tests/testfile.txt]
> Jan 11, 2011 8:15:58 AM org.apache.oodt.cas.metadata.extractors.ExternMetExtractor extrMetadata
> INFO: Executing command line: [/tmp/metadata5254850749474468821.tests/testExtractor /tmp/metadata5254850749474468821.tests/testfile.txt /tmp/metadata5254850749474468821.tests/testfile.txt.met -Dtrue=always foo bar /home/scott/test\ boo ] with workingDir: [/tmp/metadata5254850749474468821.tests] to extract metadata
> Jan 11, 2011 8:15:58 AM org.apache.oodt.cas.metadata.extractors.ExternMetExtractor extrMetadata
> WARNING: IOException running met extraction: commandLine: [/tmp/metadata5254850749474468821.tests/testExtractor /tmp/metadata5254850749474468821.tests/testfile.txt /tmp/metadata5254850749474468821.tests/testfile.txt.met -Dtrue=always foo bar /home/scott/test\ boo ]: Message: Cannot run program "/tmp/metadata5254850749474468821.tests/testExtractor" (in directory "/tmp/metadata5254850749474468821.tests"): java.io.IOException: error=13, Permission denied
> Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.387 sec <<< FAILURE!
> I'd also note that org.apache.oodt.cas.metadata.extractors.TestExternMetExtractor.setup() runs a "chmod +x" on the temp executable file.  This means the test will likely fail on a non-*nix system and halt the build process.  The associated comment in the code is "yes this is ghetto" (line 123).
> I'm not sure if it's possible to change Java's temp directory with an environment variable; so far the only way I've found to change it is by setting -Djava.io.tmpdir. See http://stackoverflow.com/questions/1924136/environment-variable-to-control-java-io-tmpdir

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira