#
# 1. agendav_test
#
- # +----------------------------+
- # | prefs |
- # +------------------+---------+
- # | username | options |
- # +------------------+---------+
- # | adam@example.net | herp |
- # +------------------+---------+
- #
- #
- # +------------------------------------------------------+
- # | shared |
- # +-----+------------------+----------+------------------+
- # | sid | user_from | calendar | user_which |
- # +-----+------------------+----------+------------------+
- # | 1 | adam@example.net | derp | beth@example.net |
- # +-----+------------------+----------+------------------+
+ # +------------------------------+
+ # | prefs |
+ # +--------------------+---------+
+ # | username | options |
+ # +--------------------+---------+
+ # | adam@example.net | herp |
+ # +--------------------+---------+
+ # | booger@example.com | herp |
+ # +------------------ +---------+
+ #
+ #
+ # +---------------------------------------------------------+
+ # | shared |
+ # +-----+--------------------+----------+-------------------+
+ # | sid | user_from | calendar | user_which |
+ # +-----+--------------------+----------+-------------------+
+ # | 1 | adam@example.net | derp | beth@example.net |
+ # +-----+--------------------+----------+-------------------+
+ # | 2 | booger@example.com | derp | carol@example.net |
+ # +-----+--------------------+----------+-------------------+
#
#
# 2. davical_test
#
- # +-------------------------------------------------------+
- # | usr |
- # +---------+--------+----------------+-------------------+
- # | user_no | active | joined | username |
- # +---------+--------+----------------+-------------------+
- # | 17 | t | 2014-01-04 ... | alice@example.com |
- # +---------+--------+----------------+-------------------+
+ # +--------------------------------------------------------+
+ # | usr |
+ # +---------+--------+----------------+--------------------+
+ # | user_no | active | joined | username |
+ # +---------+--------+----------------+--------------------+
+ # | 17 | t | 2014-01-04 ... | alice@example.com |
+ # +---------+--------+----------------+--------------------+
+ # | 18 | t | 2014-01-04 ... | booger@example.com |
+ # +---------+--------+----------------+--------------------+
#
#
# +-----------------------------------------+
# +---------+--------------+----------------+
# | 17 | dumb setting | its dumb value |
# +---------+--------------+----------------+
+ # | 18 | dumb setting | its dumb value |
+ # +---------+--------------+----------------+
#
#
# 3. postfixadmin_test
# 4. roundcube_test
#
#
- # +---------+-------------------+
- # | user_id | username |
- # +---------+-------------------+
- # | 1 | alice@example.com |
- # +---------+-------------------+
- # | 2 | adam@example.net |
- # +---------+-------------------+
+ # +---------+--------------------+
+ # | user_id | username |
+ # +---------+--------------------+
+ # | 1 | alice@example.com |
+ # +---------+--------------------+
+ # | 2 | booger@example.com |
+ # +---------+--------------------+
+ # | 3 | adam@example.net |
+ # +---------+--------------------+
cfg = configuration()
INSERT INTO prefs (username, options) VALUES ('adam@example.net', 'herp');
INSERT INTO shared (user_from, user_which, calendar)
VALUES ('adam@example.net', 'beth@example.net', 'derp');
+
+/* Just kidding, here's another one! */
+INSERT INTO prefs (username, options) VALUES ('booger@example.com', 'herp');
+INSERT INTO shared (user_from, user_which, calendar)
+ VALUES ('booger@example.com', 'carol@example.net', 'derp');
/* ...and assign it to the new user. */
INSERT INTO principal (type_id, user_no, displayname, default_privileges)
VALUES (1, 17, 'Alice', '000000000001111000000000');
+
+/* Now here's another user. */
+INSERT INTO usr (user_no, username) VALUES (18, 'booger@example.com');
+INSERT INTO usr_setting (user_no, setting_name, setting_value)
+ VALUES (18, 'dumb setting', 'its dumb value');
+INSERT INTO principal (type_id, user_no, displayname, default_privileges)
+ VALUES (1, 18, 'Booger', '000000000001111000000000');
/* Create records for a subset of the five example.com/net users */
INSERT INTO users (username) VALUES ('alice@example.com');
-INSERT INTO users (username) VALUES ('adam@example.net')
+INSERT INTO users (username) VALUES ('booger@example.com');
+INSERT INTO users (username) VALUES ('adam@example.net');
"DovecotRm - Removed user adam@example.net " +
"(#{cfg.dovecot_mail_root}/example.net/adam).\n" +
"PostfixadminRm - Removed user adam@example.net.\n" +
- "RoundcubeRm - Removed user adam@example.net (User ID: 2).\n"
+ "RoundcubeRm - Removed user adam@example.net (User ID: 3).\n"
assert_equal(expected, actual)
arm = AgendavRm.new(cfg)
actual = arm.list_users()
- expected = []
+ expected = [User.new('booger@example.com')]
assert_equal(expected, actual)
drm = DavicalRm.new(cfg)
actual = drm.list_users()
- expected = [User.new('alice@example.com')]
+ expected = [User.new('alice@example.com'), User.new('booger@example.com')]
assert_equal(expected, actual)
pfarm = PostfixadminRm.new(cfg)
rrm = RoundcubeRm.new(cfg)
actual = rrm.list_users()
- expected = [User.new('alice@example.com')]
+ expected = [User.new('alice@example.com'), User.new('booger@example.com')]
assert_equal(expected, actual)
# Check that adam's directory is gone but that the rest remain.
arm = AgendavRm.new(cfg)
actual = arm.list_users()
- expected = []
+ expected = [User.new('booger@example.com')]
assert_equal(expected, actual)
drm = DavicalRm.new(cfg)
actual = drm.list_users()
- expected = [User.new('alice@example.com')]
+ expected = [User.new('alice@example.com'), User.new('booger@example.com')]
assert_equal(expected, actual)
pfarm = PostfixadminRm.new(cfg)
rrm = RoundcubeRm.new(cfg)
actual = rrm.list_users()
- expected = [User.new('alice@example.com')]
+ expected = [User.new('alice@example.com'), User.new('booger@example.com')]
assert_equal(expected, actual)
# Check that example.net's directory is gone but that the rest remain.