Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

t/oracle.t fails on FreeBSD systems (chmod issue) #807

Closed
eserte opened this issue Dec 17, 2023 · 2 comments
Closed

t/oracle.t fails on FreeBSD systems (chmod issue) #807

eserte opened this issue Dec 17, 2023 · 2 comments

Comments

@eserte
Copy link

eserte commented Dec 17, 2023

On my FreeBSD smokers (various versions, seen on 9, 12, 13, 14 and 15) oracle.t fails:

#   Failed test 'client should use $ORACLE_HOME'
#   at t/oracle.t line 164.
#          got: 'sqlplus'
#     expected: '/var/tmp/cpansmoker-1023/2023121608/yPv7q1gQQQ/sqlplus'

#   Failed test 'client should use $ORACLE_HOME/bin'
#   at t/oracle.t line 175.
#          got: 'sqlplus'
#     expected: '/var/tmp/cpansmoker-1023/2023121608/yPv7q1gQQQ/bin/sqlplus'
# Looks like you failed 2 tests of 132.
t/oracle.t .......... 
Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/132 subtests 
	(less 1 skipped subtest: 129 okay)

I think the problem is wrong usage of chmod() in the test script. With truss the system call looks like this:

87184: 0.729083011 0.000026309 chmod("/tmp/Ca9o1AqBVT/sqlplus",01363) ERR#79 'Inappropriate file type or format'

The mode looks strange here. Actually it should be 0755. The wrong mode happens because strings are used instead of real octal numbers. This seems to fix it:

diff --git a/t/oracle.t b/t/oracle.t
index 587a1d4..8cfece5 100644
--- a/t/oracle.t
+++ b/t/oracle.t
@@ -158,3 +158,3 @@ ORACLE_HOME: {
     $sqlplus->touch;
-    chmod '0755', $sqlplus unless $iswin;
+    chmod 0755, $sqlplus unless $iswin;
 
@@ -170,3 +170,3 @@ ORACLE_HOME: {
     $sqlplus->touch;
-    chmod '0755', $sqlplus unless $iswin;
+    chmod 0755, $sqlplus unless $iswin;
 

See also the chmod documentation:

chmod LIST
       ... The first element of
       the list must be the numeric mode, which should probably be an
       octal number, and which definitely should not be a string of octal
       digits: 0644 is okay, but "0644" is not ...
@theory theory closed this as completed in 7edc536 Dec 18, 2023
@theory
Copy link
Collaborator

theory commented Dec 18, 2023

Thank you, @eserte!

@theory
Copy link
Collaborator

theory commented Jan 16, 2024

FYI @bingos.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants