summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2023-06-27 19:51:49 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2023-06-27 20:06:04 (EDT)
commit85fba945981a00e6a5e5c95dff31940887456627 (patch)
tree5d86d76b69f3e46337ac56708ae2c90a6137858d
parent12513209157f1933fbd046484f8a7dd411f1bb64 (diff)
tests/mode: Add more test cases
permcopy is broken.
-rw-r--r--tests/mode.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/mode.c b/tests/mode.c
index 3944263..924c332 100644
--- a/tests/mode.c
+++ b/tests/mode.c
@@ -43,8 +43,16 @@ _test(mode_t cur_mode, const char *mode_str, int exp_ret, mode_t exp_mode)
int
main()
{
- puts("1..1");
- _test(0000644, "a+x", OPKG_OPK_OK, 0000755);
+ umask(0022);
+ puts("1..8");
+ _test(0000644, "a+x" , OPKG_OPK_OK, 0000755);
+ _test(0000755, "go-x" , OPKG_OPK_OK, 0000744);
+ _test(0000744, "a=rw", OPKG_OPK_OK, 0000666);
+ _test(0000644, "a+" , OPKG_OPK_OK, 0000644);
+ _test(0000644, "g=u" , OPKG_OPK_OK, 0000664);
+ _test(0000644, "u=o" , OPKG_OPK_OK, 0000444);
+ _test(0000664, "o+g" , OPKG_OPK_OK, 0000666);
+ _test(0000644, "+wx", OPKG_OPK_OK, 0000755); /* Affected by umask. */
return EXIT_SUCCESS;
}