From 6a52723d82456e8e7a8e728bc073a4a59e96581a Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Tue, 24 Apr 2018 16:11:18 -0400 Subject: [PATCH] 13385: login-sync test works even if there is no fuse group Arvados-DCO-1.1-Signed-off-by: Peter Amstutz --- services/login-sync/test/test_add_user.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/services/login-sync/test/test_add_user.rb b/services/login-sync/test/test_add_user.rb index f51509cb5b..db2e24151d 100644 --- a/services/login-sync/test/test_add_user.rb +++ b/services/login-sync/test/test_add_user.rb @@ -15,21 +15,24 @@ class TestAddUser < Minitest::Test File.open(@tmpdir+'/succeed', 'w') do |f| end invoke_sync binstubs: ['new_user'] spied = File.read(@tmpdir+'/spy') - assert_match %r{useradd -m -c active -s /bin/bash -G fuse active}, spied + assert_match %r{useradd -m -c active -s /bin/bash -G (fuse)? active}, spied # BUG(TC): This assertion succeeds only if docker and fuse groups # exist on the host, but is insensitive to the admin group (groups # are quietly ignored by login-sync if they don't exist on the # current host). - assert_match %r{useradd -m -c adminroot -s /bin/bash -G docker(,admin)?,fuse adminroot}, spied + assert_match %r{useradd -m -c adminroot -s /bin/bash -G docker(,admin)?(,fuse)? adminroot}, spied end def test_useradd_success # binstub_new_user/useradd will succeed. File.open(@tmpdir+'/succeed', 'w') do |f| f.puts 'useradd -m -c active -s /bin/bash -G fuse active' + f.puts 'useradd -m -c active -s /bin/bash -G active' # Accept either form; see note about groups in test_useradd_error. f.puts 'useradd -m -c adminroot -s /bin/bash -G docker,fuse adminroot' f.puts 'useradd -m -c adminroot -s /bin/bash -G docker,admin,fuse adminroot' + f.puts 'useradd -m -c adminroot -s /bin/bash -G docker adminroot' + f.puts 'useradd -m -c adminroot -s /bin/bash -G docker,admin adminroot' end $stderr.puts "*** Expect crash after getpwnam() fails:" invoke_sync binstubs: ['new_user'] -- 2.30.2