nixos/tests/pam-lastlog: test legacy lastlog importer
This commit is contained in:
@@ -13,9 +13,18 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
testScript = ''
|
testScript = ''
|
||||||
machine.wait_for_unit("multi-user.target")
|
with subtest("Test legacy lastlog import"):
|
||||||
machine.succeed("run0 --pty true") # perform full login
|
# create old lastlog file to test import
|
||||||
print(machine.succeed("lastlog2 --active --user root"))
|
# empty = nothing will actually be imported, but the service will run
|
||||||
machine.succeed("stat /var/lib/lastlog/lastlog2.db")
|
machine.succeed("touch /var/log/lastlog")
|
||||||
|
machine.wait_for_unit("lastlog2-import.service")
|
||||||
|
machine.succeed("journalctl -b --grep 'Starting Import lastlog data into lastlog2 database'")
|
||||||
|
machine.succeed("stat /var/log/lastlog.migrated")
|
||||||
|
|
||||||
|
with subtest("Test lastlog entries are created by logins"):
|
||||||
|
machine.wait_for_unit("multi-user.target")
|
||||||
|
machine.succeed("run0 --pty true") # perform full login
|
||||||
|
print(machine.succeed("lastlog2 --active --user root"))
|
||||||
|
machine.succeed("stat /var/lib/lastlog/lastlog2.db")
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user