blob: e35d000f8130a410bba5e828e1ed46394f4e51e8 [file] [log] [blame]
// Copyright 2019 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package crostini
import (
"context"
"time"
"chromiumos/tast/local/crostini"
"chromiumos/tast/testing"
)
func init() {
testing.AddTest(&testing.Test{
Func: Basic,
Desc: "Tests basic Crostini startup only (where crostini was shipped with the build)",
Contacts: []string{"smbarber@chromium.org", "cros-containers-dev@google.com"},
SoftwareDeps: []string{"chrome", "vm_host"},
Attr: []string{"group:mainline"},
Vars: []string{"keepState"},
VarDeps: []string{"ui.gaiaPoolDefault"},
Params: []testing.Param{
// Parameters generated by params_test.go. DO NOT EDIT.
{
Name: "stretch_stable",
ExtraData: []string{crostini.GetContainerMetadataArtifact("stretch", false), crostini.GetContainerRootfsArtifact("stretch", false)},
ExtraSoftwareDeps: []string{"dlc"},
ExtraHardwareDeps: crostini.CrostiniStable,
Pre: crostini.StartedByDlcStretch(),
Timeout: 7 * time.Minute,
}, {
Name: "stretch_unstable",
ExtraAttr: []string{"informational"},
ExtraData: []string{crostini.GetContainerMetadataArtifact("stretch", false), crostini.GetContainerRootfsArtifact("stretch", false)},
ExtraSoftwareDeps: []string{"dlc"},
ExtraHardwareDeps: crostini.CrostiniUnstable,
Pre: crostini.StartedByDlcStretch(),
Timeout: 7 * time.Minute,
}, {
Name: "buster_stable",
ExtraData: []string{crostini.GetContainerMetadataArtifact("buster", false), crostini.GetContainerRootfsArtifact("buster", false)},
ExtraSoftwareDeps: []string{"dlc"},
ExtraHardwareDeps: crostini.CrostiniStable,
Pre: crostini.StartedByDlcBuster(),
Timeout: 7 * time.Minute,
}, {
Name: "buster_unstable",
ExtraAttr: []string{"informational"},
ExtraData: []string{crostini.GetContainerMetadataArtifact("buster", false), crostini.GetContainerRootfsArtifact("buster", false)},
ExtraSoftwareDeps: []string{"dlc"},
ExtraHardwareDeps: crostini.CrostiniUnstable,
Pre: crostini.StartedByDlcBuster(),
Timeout: 7 * time.Minute,
}, {
Name: "bullseye_stable",
ExtraAttr: []string{"informational"},
ExtraData: []string{crostini.GetContainerMetadataArtifact("bullseye", false), crostini.GetContainerRootfsArtifact("bullseye", false)},
ExtraSoftwareDeps: []string{"dlc"},
ExtraHardwareDeps: crostini.CrostiniStable,
Pre: crostini.StartedByDlcBullseye(),
Timeout: 7 * time.Minute,
}, {
Name: "bullseye_unstable",
ExtraAttr: []string{"informational"},
ExtraData: []string{crostini.GetContainerMetadataArtifact("bullseye", false), crostini.GetContainerRootfsArtifact("bullseye", false)},
ExtraSoftwareDeps: []string{"dlc"},
ExtraHardwareDeps: crostini.CrostiniUnstable,
Pre: crostini.StartedByDlcBullseye(),
Timeout: 7 * time.Minute,
},
},
})
}
func Basic(ctx context.Context, s *testing.State) {
cont := s.PreValue().(crostini.PreData).Container
defer crostini.RunCrostiniPostTest(ctx, s.PreValue().(crostini.PreData))
if err := crostini.BasicCommandWorks(ctx, cont); err != nil {
s.Fatal("Failed to run a command in the container: ", err)
}
}