Sha256: 2966a8e594f9f98fa971786451f9ee77872da5834172a277dd26d9d6a7c7ffd9

Contents?: true

Size: 710 Bytes

Versions: 154

Compression:

Stored size: 710 Bytes

Contents

module Aix::User
  include Beaker::CommandFactory

  def user_list(&block)
    execute("lsuser ALL") do |result|
      users = []
      result.stdout.each_line do |line|
        users << line.split(' ')[0]
      end

      yield result if block_given?

      users
    end
  end

  def user_get(name, &block)
    execute("lsuser #{name}") do |result|
      fail_test "failed to get user #{name}" unless result.stdout =~  /^#{name} id/

      yield result if block_given?
    end
  end

  def user_present(name, &block)
    execute("if ! lsuser #{name}; then mkuser #{name}; fi", {}, &block)
  end

  def user_absent(name, &block)
    execute("if lsuser #{name}; then rmuser #{name}; fi", {}, &block)
  end
end

Version data entries

154 entries across 154 versions & 1 rubygems

Version Path
beaker-1.6.1 lib/beaker/host/aix/user.rb
beaker-1.6.0 lib/beaker/host/aix/user.rb
beaker-1.5.0 lib/beaker/host/aix/user.rb
beaker-1.4.1 lib/beaker/host/aix/user.rb
beaker-1.4.0 lib/beaker/host/aix/user.rb
beaker-1.3.2 lib/beaker/host/aix/user.rb
beaker-1.3.1 lib/beaker/host/aix/user.rb
beaker-1.3.0 lib/beaker/host/aix/user.rb
beaker-1.2.0 lib/beaker/host/aix/user.rb
beaker-1.1.0 lib/beaker/host/aix/user.rb
beaker-1.0.1 lib/beaker/host/aix/user.rb
beaker-1.0.1.pre lib/beaker/host/aix/user.rb
beaker-1.0.0 lib/beaker/host/aix/user.rb
beaker-0.0.0 lib/beaker/host/aix/user.rb