[PATCH] D64302: [test] [llvm-objcopy] Fix broken test case

Alex Brachet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 7 17:35:27 PDT 2019


abrachet created this revision.
abrachet added reviewers: jhenderson, rupprecht, MaskRay.
Herald added subscribers: llvm-commits, jakehehrlich, arichardson, emaste.
Herald added a reviewer: espindola.
Herald added a reviewer: alexshap.
Herald added a project: LLVM.

The test case added in D62718 <https://reviews.llvm.org/D62718> did not work unless the user was root because write bits were not set for the output file. This change uses only permissions with user write (0200) to ensure tests pass regardless of the users permissions.


https://reviews.llvm.org/D64302

Files:
  llvm/test/tools/llvm-objcopy/ELF/respect-umask.test


Index: llvm/test/tools/llvm-objcopy/ELF/respect-umask.test
===================================================================
--- llvm/test/tools/llvm-objcopy/ELF/respect-umask.test
+++ llvm/test/tools/llvm-objcopy/ELF/respect-umask.test
@@ -9,19 +9,29 @@
 # RUN: touch %t
 # RUN: chmod 0755 %t
 # RUN: ls -l %t | cut -f 1 -d ' ' > %t.0755
-# RUN: chmod 0500 %t
-# RUN: ls -l %t | cut -f 1 -d ' ' > %t.0500
-# RUN: chmod 0555 %t
-# RUN: ls -l %t | cut -f 1 -d ' ' > %t.0555
+# RUN: chmod 0600 %t
+# RUN: ls -l %t | cut -f 1 -d ' ' > %t.0600
+# RUN: chmod 0655 %t
+# RUN: ls -l %t | cut -f 1 -d ' ' > %t.0655
 
-# RUN: rm -f %t; yaml2obj %s -o %t
+# RUN: yaml2obj %s -o %t
 
 # RUN: umask 0022
 # RUN: chmod 0777 %t
-# RUN: rm -f %t1; llvm-objcopy %t %t1
+# RUN: llvm-objcopy %t %t1
 # RUN: ls -l %t1 | cut -f 1 -d ' ' > %t1.perms
 # RUN: cmp %t1.perms %t.0755
 
+# RUN: umask 0177
+# RUN: llvm-objcopy %t %t2
+# RUN: ls -l %t2 | cut -f 1 -d ' ' > %t2.perms
+# RUN: cmp %t2.perms %t.0600
+
+# RUN: umask 0122
+# RUN: llvm-objcopy %t %t3
+# RUN: ls -l %t3 | cut -f 1 -d ' ' > %t3.perms
+# RUN: cmp %t3.perms %t.0655
+
 --- !ELF
 FileHeader:
   Class:   ELFCLASS64


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64302.208303.patch
Type: text/x-patch
Size: 1163 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190708/2c38ce67/attachment.bin>


More information about the llvm-commits mailing list