Граф коммитов

27 Коммитов

Автор SHA1 Сообщение Дата
Peter Zhu 850448abd5 Fix leaked file descriptor in passwd test 2021-03-24 13:02:54 +09:00
Marc-Andre Lafortune cd63f0358f [ruby/etc] Make Ractor safe 2020-12-22 19:46:07 -05:00
Yusuke Endoh 2090011dbd test/etc/test_etc.rb: skip some tests on Android
Android user management seems different from normal Unix system.
2020-02-12 17:28:29 +09:00
sonots b5b2bd86f1 test_etc.rb: fix test_getgrnam for duplicated group names
* test/etc/test_etc.rb: Etc.getgrnam would not return the first entry in the order of Etc.group for duplicated group names.

follow-up: [Bug #6935]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-29 17:19:37 +00:00
kazu b9d8758e26 {ext,test}/etc: Specify frozen_string_literal: true.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-29 01:35:23 +00:00
naruse 3e92b635fb Add frozen_string_literal: false for all files
When you change this to true, you may need to add more tests.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16 05:07:31 +00:00
nobu 8ed8e0ba41 test_etc.rb: relax comparisons
* test/etc/test_etc.rb (test_getgrgid, test_getgrnam): relax
  comparisons.  getgrent() does not return mem properly in some
  circumstances (possibly, involved in Open Directory on OSX).

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-10 07:15:12 +00:00
nobu 6ccf3d68c2 win32.c: login name encoding
* ext/etc/etc.c (etc_getlogin): set login name encoding properly.
  [ruby-core:66163] [Bug #10493]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-10 08:24:36 +00:00
akr 7b25bd8ba2 * ext/etc/etc.c (etc_nprocessors): New method.
Accepted by matz at RubyKaigi 2014.
  [ruby-core:65142] [Feature #10267]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-02 03:23:26 +00:00
nobu 6ff56256c3 test_etc.rb: omit unrunnable tests
* test/etc/test_etc.rb (test_sysconf, test_confstr, test_pathconf):
  define test cases only if corresponding constants are available.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46009 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-18 23:35:04 +00:00
akr 4f3432f9cb [DOC]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-18 02:06:15 +00:00
akr ea1a4f2929 * ext/etc/etc.c: Etc.sysconf, Etc.confstr and IO#pathconf implemented.
* ext/etc/extconf.rb: Check sysconf(), confstr() and fpathconf().

* ext/etc/mkconstants.rb: New file.

 [ruby-core:62600] [Feature #9842]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-18 01:48:47 +00:00
akr 63a23dc678 * ext/etc/etc.c: Etc.uname method implemented.
* ext/etc/extconf.rb: Check uname() function.

  [ruby-core:62139] [Feature #9770]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-18 00:58:34 +00:00
shirosaki a5849245c6 test_etc.rb: fix for non unique GID
* test/etc/test_etc.rb (TestEtc#test_getgrgid): fix for non unique GID.
  No unixen systems guarantee that GID is unique. Etc.getgrgid would
  not return the first entry in the order of Etc.group for shared GID.
  [ruby-core:47312] [Bug #6935]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-27 11:57:43 +00:00
usa 7c5336b8f9 * test/etc/test_etc.rb (TestEtc#test_getpwuid): `s' is never set to nil.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36636 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-06 02:20:47 +00:00
nobu 800d9a7ac1 test_etc.rb: remove implicit assumption
* test/etc/test_etc.rb (TestEtc#test_getpwuid): remove implicit
  assumption, that getpwuid() would return the first entry in the
  order of getpw(), for shared UID.  apparently it is not true on
  MacOS X 10.8.  [ruby-core:46975][Bug #6831]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-05 05:14:35 +00:00
nobu 61a34d625e * test/etc/test_etc.rb (TestEtc#test_get{pw,gr}nam): skip entries
start with + sign, which means NIS.  these are returned in the
  case that passwd and group entries in /etc/nsswitch.conf are set
  to use "nis" explicitly on Debian.  fixed #3683

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-26 16:34:20 +00:00
nobu a6e33fd71c * test/etc/test_etc.rb: assert only when any value is given.
[Bug #1575] [ruby-core:23722]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-05 06:11:04 +00:00
nobu d89dbc4d3b * test/etc/test_etc.rb: trivial.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-06 15:26:36 +00:00
mame c07b4ef145 * test/etc/test_etc.rb(test_getpwnam, test_getgrgid, test_getgrnam):
support an envirionment that has duplicative entries.  a patch from
  Tomoyuki Chikanaga <chikanag at nippon-control-system.co.jp> in
  [ruby-dev:37882].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-03 15:39:44 +00:00
mame c309cda903 * test/etc/test_etc.rb (test_getpwuid, test_getgrgid): use
Process.euid and egid instead of Etc.getlogin to identify current
  user which may be different from a login one (e.g., su command).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03 15:02:22 +00:00
mame 65b1544649 * test/etc/test_etc.rb: check only typical use of
setpwent/getpwent/endpwent and setgrent/getgrent/endgrent.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03 14:54:14 +00:00
mame 8da30b8928 * test/etc/test_etc.rb (test_passwd): age field may be string under
some environments.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18258 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-29 12:36:28 +00:00
naruse f783b8d204 * test/etc/test_etc.rb (test_getpwuid): fix for users whose uid is
shared.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-29 04:21:32 +00:00
mame 33e5cfee7b * test/etc/test_etc.rb: avoid infinite loop. [ruby-dev:35158]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17420 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-18 15:34:46 +00:00
akr 205e542a89 avoid infinite loop on FreeBSD 6.3.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16801 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-04 06:04:38 +00:00
mame 87050da59f * test/etc/test_etc.rb: new tests for etc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-03 13:26:38 +00:00