Skip to content

Commit

Permalink
test(bootstrap): update integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
d-loose committed Mar 1, 2024
1 parent 8b28de3 commit e01df98
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,81 @@ void main() {
);
});

testWidgets('ZFS encrypted', (tester) async {
const identity = Identity(
realname: 'User',
hostname: 'ubuntu',
username: 'user',
);

await tester.runApp(() => app.main(<String>[]));
await tester.pumpAndSettle();

await tester.testLocalePage();
await tester.tapNext();
await tester.pumpAndSettle();

await tester.testAccessibilityPage();
await tester.tapNext();
await tester.pumpAndSettle();

await tester.testKeyboardPage();
await tester.tapNext();
await tester.pumpAndSettle();

await tester.testNetworkPage(mode: ConnectMode.none);
await tester.tapNext();
await tester.pumpAndSettle();

await tester.testRefreshPage();
await tester.tapSkip();
await tester.pumpAndSettle();

await tester.testSourceSelectionPage();
await tester.tapNext();
await tester.pumpAndSettle();

await tester.testCodecsAndDriversPage();
await tester.tapNext();
await tester.pumpAndSettle();

await tester.testStoragePage(
type: StorageType.erase,
guidedCapability: GuidedCapability.ZFS_LUKS_KEYSTORE,
);
await tester.tapNext();
await tester.pumpAndSettle();

await tester.testSecurityKeyPage(securityKey: 'password');
await tester.tapNext();
await tester.pumpAndSettle();

await tester.testIdentityPage(identity: identity, password: 'password');
await tester.tapNext();
await tester.pumpAndSettle();
await expectIdentity(identity);

await tester.testTimezonePage();
await tester.tapNext();
await tester.pumpAndSettle();

await tester.testConfirmPage();
await tester.tapConfirm();
await tester.pumpAndSettle();

await tester.testInstallPage();
await tester.pumpAndSettle();

final windowClosed = YaruTestWindow.waitForClosed();
await tester.tapContinueTesting();
await expectLater(windowClosed, completes);

await verifySubiquityConfig(
identity: identity,
capability: GuidedCapability.ZFS_LUKS_KEYSTORE,
);
});

testWidgets('tpm', (tester) async {
const identity = Identity(
realname: 'User',
Expand Down Expand Up @@ -653,6 +728,12 @@ Future<void> verifySubiquityConfig({
expect(actualStorage.where((config) => config['type'] == 'zpool'),
isNotEmpty);
break;
case GuidedCapability.ZFS_LUKS_KEYSTORE:
expect(actualStorage.where((config) => config['type'] == 'zpool'),
isNotEmpty);
expect(actualStorage.where((config) => config['type'] == 'dm_crypt'),
isNotEmpty);
break;
case GuidedCapability.CORE_BOOT_ENCRYPTED:
expect(
actualStorage
Expand Down
8 changes: 4 additions & 4 deletions packages/ubuntu_provision_test/lib/src/bootstrap_tester.dart
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,13 @@ extension UbuntuBootstrapPageTester on WidgetTester {
await tap(find.text(l10n.installationTypeLVM('Ubuntu')));
break;
case GuidedCapability.LVM_LUKS:
await tap(find.text(l10n.installationTypeLVM('Ubuntu')));
await pump();
await tap(find.text(l10n.installationTypeEncrypt('Ubuntu')));
await tap(find.text(l10n.installationTypeLVMEncryption('Ubuntu')));
break;
case GuidedCapability.ZFS:
await tap(find.text(l10n.installationTypeZFS));
await pump();
break;
case GuidedCapability.ZFS_LUKS_KEYSTORE:
await tap(find.text(l10n.installationTypeZFSEncryption));
break;
default:
break;
Expand Down

0 comments on commit e01df98

Please sign in to comment.