@@ -135,11 +135,11 @@ def downloaded_file
135
135
# Execute the tests only for libxml2 tarball
136
136
if filename . include? ( "libxml2" )
137
137
execute_tests ( file_path )
138
- end
139
138
# List files under the directory of the downloaded file with permissions
140
- directory_listing = `ls -l #{ File . dirname ( file_path ) } ` . strip
141
- log . info ( log_key ) { "-----DEBUG-----Contents of the directory of the downloaded file:\n #{ directory_listing } " }
142
- end
139
+ directory_listing = `ls -l #{ File . dirname ( file_path ) } ` . strip
140
+ log . info ( log_key ) { "-----DEBUG-----Contents of the directory of the downloaded file:\n #{ directory_listing } " }
141
+ end
142
+ end
143
143
144
144
file_path
145
145
end
@@ -148,6 +148,7 @@ def execute_tests(file_path)
148
148
# Create a directory under /tmp
149
149
test_dir = "/tmp/testlib"
150
150
FileUtils . mkdir_p ( test_dir )
151
+ log . info ( log_key ) { "-----DEBUG-----Test directory created: #{ Dir . exist? ( test_dir ) } " }
151
152
152
153
# Copy the libxml archive to /tmp/testlib
153
154
FileUtils . cp ( file_path , test_dir )
@@ -158,11 +159,13 @@ def execute_tests(file_path)
158
159
159
160
# Extract the archive
160
161
archive_path = File . join ( test_dir , File . basename ( file_path ) )
161
- system ( "gtar Jxf #{ archive_path } -C #{ extract_dir } " )
162
+ log . info ( log_key ) { "-----DEBUG-----Extracting archive: #{ archive_path } to #{ extract_dir } " }
163
+ returns = [ 0 ] # List of acceptable exit codes
164
+ shellout! ( "gtar -Jxf #{ archive_path } -C #{ extract_dir } " , returns : returns )
162
165
163
- log . info ( log_key ) { "-----DEBUG-----Test directory created at #{ test_dir } " }
164
- log . info ( log_key ) { "-----DEBUG-----Extract directory created at #{ extract_dir } " }
165
- log . info ( log_key ) { "-----DEBUG-----Archive extracted to #{ extract_dir } " }
166
+ # List all files and directories under /tmp
167
+ tmp_listing = `ls -l /tmp` . strip
168
+ log . info ( log_key ) { "-----DEBUG-----Contents of /tmp: \n #{ tmp_listing } " }
166
169
end
167
170
168
171
#
0 commit comments