Ansible_workstation/roles/user/molecule/default/tests/test_default.py

32 lines
809 B
Python

"""Role testing files using testinfra."""
def test_create_users(host):
""" Validate user creation """
user = host.user("user")
assert user.exists
assert user.uid >= 1000
assert user.shell == "/bin/zsh"
assert user.home == f"/home/{user.name}"
admin = host.user("admin")
assert admin.exists
assert admin.uid < 1000
assert admin.shell == "/bin/bash"
assert admin.home == f"/home/{admin.name}"
def test_install_git_stow(host):
pass
def test_clone_dotfiles(host):
user = host.user("user")
dotfiles = host.file(user.home + "/.dotfiles")
assert dotfiles.exists
assert dotfiles.user == user.name
admin = host.user("admin")
dotfiles = host.file(admin.home + "/.dotfiles")
assert dotfiles.exists
assert dotfiles.user == admin.name