tast-tests: crostini: add baguette test functionality to basic.go
This patchset introduces changes to the params_test.go crostini scripts,
which will be used to generate automatic test cases for using a baguette
fixture in crostini tests.
At the moment, we utilize an 'opt-in' model, where tests have to
indicate they would like to use the baguette fixture to generate a (or
multiple) tests. In the future, as we go through the process of adding
additional tests in smaller CLs, we will eventually move this to an
opt-out (or just always on) model.
BUG=b:377351450
TEST=tast run $VOLTEER_DUT crostini.Basic.baguette_stable
Cq-Depend: chromium:6618332
Change-Id: I41379977d2b72643ab9616fc309b52647bf1f25a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/tast-tests/+/6637696
Commit-Queue: maciek swiech <drmasquatch@google.com>
Tested-by: maciek swiech <drmasquatch@google.com>
Tast-Review: Seewai Fu <seewaifu@google.com>
Reviewed-by: Zihan Chen <zihanchen@google.com>
diff --git a/src/go.chromium.org/tast-tests/cros/local/bundles/cros/crostini/basic.go b/src/go.chromium.org/tast-tests/cros/local/bundles/cros/crostini/basic.go
index 0d5ccf96..b66eb6a 100644
--- a/src/go.chromium.org/tast-tests/cros/local/bundles/cros/crostini/basic.go
+++ b/src/go.chromium.org/tast-tests/cros/local/bundles/cros/crostini/basic.go
@@ -46,6 +46,16 @@
ExtraHardwareDeps: crostini.CrostiniLowPerf,
Fixture: "crostiniBookwormWithoutArc",
Timeout: 7 * time.Minute,
+ }, {
+ Name: "baguette_stable",
+ ExtraHardwareDeps: crostini.CrostiniOptimalPerf,
+ Fixture: "baguettePolicy",
+ Timeout: 7 * time.Minute,
+ }, {
+ Name: "baguette_lowperf",
+ ExtraHardwareDeps: crostini.CrostiniLowPerf,
+ Fixture: "baguettePolicy",
+ Timeout: 7 * time.Minute,
},
},
})
diff --git a/src/go.chromium.org/tast-tests/cros/local/bundles/cros/crostini/params_test.go b/src/go.chromium.org/tast-tests/cros/local/bundles/cros/crostini/params_test.go
index 3c7d2f6..2d142d0 100644
--- a/src/go.chromium.org/tast-tests/cros/local/bundles/cros/crostini/params_test.go
+++ b/src/go.chromium.org/tast-tests/cros/local/bundles/cros/crostini/params_test.go
@@ -31,7 +31,8 @@
needsAloop bool
// Foundational tests that should run on all devices. These tests should be lightweight enough
// to be stable enough to run on low performance devices and older versions of debian.
- foundation bool
+ foundation bool
+ testBaguette bool
}
const DefaultStandardTimeout = 7 * time.Minute
@@ -44,7 +45,7 @@
// Audio playback configurations took about 6 minutes on model with echo reference
"audio_playback_configurations.go": {timeout: 10 * time.Minute},
"backup_restore.go": {timeout: 10 * time.Minute},
- "basic.go": {foundation: true},
+ "basic.go": {foundation: true, testBaguette: true},
"close_terminal_tabs_and_window.go": {foundation: true},
"command_cd.go": {foundation: true},
"command_ps.go": {foundation: true},
@@ -118,6 +119,7 @@
LowPerfEligible: options.foundation,
MinimumContainerVersion: minimumContainerVersion,
RequiresARC: options.requiresARC,
+ TestBaguette: options.testBaguette,
}})
genparams.Ensure(t, filename, params)
}
diff --git a/src/go.chromium.org/tast-tests/cros/local/crostini/params.go b/src/go.chromium.org/tast-tests/cros/local/crostini/params.go
index 7035d77..def93fc 100644
--- a/src/go.chromium.org/tast-tests/cros/local/crostini/params.go
+++ b/src/go.chromium.org/tast-tests/cros/local/crostini/params.go
@@ -178,6 +178,11 @@
// NeedsAloop indicates whether a test relies on audio loopback to be
// set up
NeedsAloop bool
+
+ // TestBaguette indicates opting in to testing baguette (containerless
+ // crostini install). Will eventually be made the default once all tests
+ // are confirmed passing.
+ TestBaguette bool
}
type generatedParam struct {
@@ -229,6 +234,7 @@
type iterator struct {
debianVersion vm.ContainerDebianVersion
stable bool
+ baguette bool
}
var itChrome = []iterator{}
@@ -237,11 +243,24 @@
itChrome = append(itChrome, iterator{
debianVersion: debianVersion,
stable: stable,
+ baguette: false,
})
}
}
for _, testCase := range baseCases {
+ var testCaseChrome = []iterator{}
+ testCaseChrome = append(testCaseChrome, itChrome...)
+
+ if testCase.TestBaguette {
+ for _, stable := range []bool{true, false} {
+ testCaseChrome = append(testCaseChrome, iterator{
+ debianVersion: vm.DebianBookworm,
+ stable: stable,
+ baguette: true,
+ })
+ }
+ }
iterate := func(i iterator) {
if testCase.LowPerfEligible {
if testCase.OnlyStableBoards {
@@ -274,7 +293,9 @@
}
name := testCase.Name
- if !testCase.MinimalSet && (i.debianVersion == vm.DebianBullseye || i.debianVersion == vm.DebianBookworm) {
+ if i.baguette {
+ name = combineName(name, "baguette")
+ } else if !testCase.MinimalSet && (i.debianVersion == vm.DebianBullseye || i.debianVersion == vm.DebianBookworm) {
// If we're generating a minimal set
// then the debian version is always
// the same and we don't need to
@@ -325,7 +346,9 @@
}
var extraSoftwareDeps []string
- extraSoftwareDeps = append(extraSoftwareDeps, "dlc")
+ if !i.baguette {
+ extraSoftwareDeps = append(extraSoftwareDeps, "dlc")
+ }
var hardwareDeps string
if testCase.UseLargeContainer {
@@ -359,29 +382,33 @@
var testParam generatedParam
var fixture, precondition string
if testCase.UseFixture {
- arcStatus := ""
- if testCase.LowPerfEligible && !i.stable {
- arcStatus = "WithoutArc"
- }
-
- if testCase.SelfManagedInstall {
- fixture = ""
- } else if testCase.UseLargeContainer {
- suffix := ""
- if testCase.DeviceMode == devicemode.TabletMode {
- suffix = "Tablet"
- } else if testCase.DeviceMode == devicemode.ClamshellMode {
- suffix = "Clamshell"
- }
- fixture = fmt.Sprintf("\"crostini%sLargeContainer%s\"", cases.Title(language.Und).String(i.debianVersion.Codename), suffix)
- } else if testCase.UseGaiaLogin {
- fixture = fmt.Sprintf("\"crostini%sGaia%s\"", cases.Title(language.Und).String(i.debianVersion.Codename), arcStatus)
+ if i.baguette {
+ fixture = "\"baguettePolicy\""
} else {
- fixture = fmt.Sprintf("\"crostini%s%s\"", cases.Title(language.Und).String(i.debianVersion.Codename), arcStatus)
- }
+ arcStatus := ""
+ if testCase.LowPerfEligible && !i.stable {
+ arcStatus = "WithoutArc"
+ }
- if testCase.NeedsAloop {
- fixture = fmt.Sprintf("fixture.AloopLoaded{Parent: %s}.Instance()", fixture)
+ if testCase.SelfManagedInstall {
+ fixture = ""
+ } else if testCase.UseLargeContainer {
+ suffix := ""
+ if testCase.DeviceMode == devicemode.TabletMode {
+ suffix = "Tablet"
+ } else if testCase.DeviceMode == devicemode.ClamshellMode {
+ suffix = "Clamshell"
+ }
+ fixture = fmt.Sprintf("\"crostini%sLargeContainer%s\"", cases.Title(language.Und).String(i.debianVersion.Codename), suffix)
+ } else if testCase.UseGaiaLogin {
+ fixture = fmt.Sprintf("\"crostini%sGaia%s\"", cases.Title(language.Und).String(i.debianVersion.Codename), arcStatus)
+ } else {
+ fixture = fmt.Sprintf("\"crostini%s%s\"", cases.Title(language.Und).String(i.debianVersion.Codename), arcStatus)
+ }
+
+ if testCase.NeedsAloop {
+ fixture = fmt.Sprintf("fixture.AloopLoaded{Parent: %s}.Instance()", fixture)
+ }
}
} else {
extraData = append(extraData,
@@ -432,7 +459,7 @@
result = append(result, testParam)
}
- for _, i := range itChrome {
+ for _, i := range testCaseChrome {
iterate(i)
}
}