File: spec_helper_acceptance_local.rb

package info (click to toggle)
puppet-agent 8.10.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 27,392 kB
  • sloc: ruby: 286,820; sh: 492; xml: 116; makefile: 88; cs: 68
file content (19 lines) | stat: -rw-r--r-- 461 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

def add_test_user
  username = "test_user_#{rand(999).to_i}"
  password = 'password!@#123'

  command_string = "net user /add #{username} #{password}"
  run_shell(command_string) do |r|
    raise r.stderr unless r.stderr.empty?
  end
  [username, password]
end

def remove_test_user(username)
  command_string = "net user /delete #{username}"
  run_shell(command_string) do |r|
    raise r.stderr unless r.stderr.empty?
  end
end