diff options
Diffstat (limited to 'src/account/test/methods.py')
-rw-r--r-- | src/account/test/methods.py | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/src/account/test/methods.py b/src/account/test/methods.py index 9659d4f..ce05e7e 100644 --- a/src/account/test/methods.py +++ b/src/account/test/methods.py @@ -19,22 +19,6 @@ # import random -import string -import subprocess - -def user_exists(username): - """ - Return true/false if user does/does not exists - """ - got = field_in_passwd(username, 0) - return got == username - -def group_exists(groupname): - """ - Return true/false if user does/does not exists - """ - got = field_in_group(groupname, 0) - return got == groupname def field_in_passwd(username, number): """ @@ -60,43 +44,6 @@ def field_in_group(groupname, number): if line.startswith(groupname): return line.split(":")[number].strip() -def clean_account(user_name): - """ - Force to delete testing account and remove home dir - """ - if user_exists(user_name): - subprocess.check_call(["userdel", "-fr", user_name]) - if group_exists(user_name): - # groups should be expicitely deleted - subprocess.check_call(["groupdel", user_name]) - -def add_user_to_group(user_name, group_name): - """ - Will add user to group - """ - subprocess.check_call(["usermod", "-a", "-G", group_name, user_name]) - -def create_account(user_name): - """ - Force to create account; run clean_account before creation - """ - if not user_exists(user_name): - subprocess.check_call(["useradd", user_name]) - -def clean_group(group_name): - """ - Force to delete testing group - """ - if group_exists(group_name): - subprocess.check_call(["groupdel", group_name]) - -def create_group(group_name): - """ - Force to create group - """ - if not group_exists(group_name): - subprocess.check_call(["groupadd", group_name]) - def random_shell(): """ Make up a funny shell |