Sha256: 5fdbc301d3b8af3559deef9040b238f365cda01db7356de3a73f1e0d9729417e

Contents?: true

Size: 1.28 KB

Versions: 38

Compression:

Stored size: 1.28 KB

Contents

require 'al-test-utils'

class TestGroupmod < Test::Unit::TestCase
  include AlTestUtils

  def setup
    super
    @command = File.join(@examples_dir, "groupmod")
  end

  priority :must

  priority :normal
  def test_non_exist_group
    ensure_delete_group("test-group") do |name|
      assert(!@group_class.exists?(name))
      assert_equal([false, "Group #{name} doesn't exist.\n"],
                   run_command(name, 111111))
      assert(!@group_class.exists?(name))
    end
  end

  def test_modify_group
    make_temporary_group do |group|
      assert_groupmod_successfully(group.cn, group.gid_number.succ)
    end
  end

  private
  def assert_groupmod_successfully(name, gid, *args, &block)
    _wrap_assertion do
      assert(@group_class.exists?(name))
      args.concat([name, gid])
      assert_equal([true, ""], run_command(*args, &block))
      assert(@group_class.exists?(name))

      group = @group_class.find(name)
      assert_equal(name, group.cn)
      assert_equal(gid, group.gid_number)
    end
  end

  def assert_groupmod_failed(name, gid, message, *args, &block)
    _wrap_assertion do
      assert(@group_class.exists?(name))
      args.concat([name, gid])
      assert_equal([false, message], run_command(*args, &block))
      assert(@group_class.exists?(name))
    end
  end
end

Version data entries

38 entries across 38 versions & 3 rubygems

Version Path
activeldap-7.2.1 test/test_groupmod.rb
activeldap-7.2.0 test/test_groupmod.rb
activeldap-7.0.0 test/test_groupmod.rb
activeldap-6.1.0 test/test_groupmod.rb
activeldap-6.0.4 test/test_groupmod.rb
activeldap-6.0.3 test/test_groupmod.rb
activeldap-6.0.2 test/test_groupmod.rb
activeldap-6.0.1 test/test_groupmod.rb
activeldap-6.0.0 test/test_groupmod.rb
activeldap-5.2.4 test/test_groupmod.rb
activeldap-5.2.3 test/test_groupmod.rb
activeldap-5.2.2 test/test_groupmod.rb
activeldap-5.2.1 test/test_groupmod.rb
activeldap-5.2.0 test/test_groupmod.rb
activeldap-5.1.1 test/test_groupmod.rb
activeldap-5.1.0 test/test_groupmod.rb
activeldap-3.2.3 test/test_groupmod.rb
powerhome-activeldap-3.2.3 test/test_groupmod.rb
activeldap-4.0.6 test/test_groupmod.rb
activeldap-4.0.5 test/test_groupmod.rb