Skip to content

Commit

Permalink
wip: teach upgrades about oci-archive
Browse files Browse the repository at this point in the history
Blocks on new rpm-ostree in rawhide etc.
  • Loading branch information
cgwalters committed Jul 16, 2021
1 parent 4074803 commit 61e904e
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions mantle/kola/tests/upgrade/basic.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,20 +133,34 @@ func fcosUpgradeBasic(c cluster.TestCluster) {
graph := new(Graph)

c.Run("setup", func(c cluster.TestCluster) {
ostreeblob := kola.CosaBuild.Meta.BuildArtifacts.Ostree.Path
// this is the only heavy-weight part, though remember this test is
// optimized for qemu testing locally where this won't leave localhost at
// all. cloud testing should mostly be a pipeline thing, where the infra
// connection should be much faster
ostreeTarPath := filepath.Join(kola.CosaBuild.Dir, kola.CosaBuild.Meta.BuildArtifacts.Ostree.Path)
ostreeTarPath := filepath.Join(kola.CosaBuild.Dir, ostreeblob)
if err := cluster.DropFile(c.Machines(), ostreeTarPath); err != nil {
c.Fatal(err)
}

// XXX: Note the '&& sync' here; this is to work around sysroot
// See https://github.com/coreos/fedora-coreos-tracker/issues/812
if strings.HasSuffix(ostreeblob, ".ociarchive") {
tmprepo := "/var/srv/repo.bare"
// TODO: https://github.com/ostreedev/ostree-rs-ext/issues/34
c.RunCmdSyncf(m, "sudo ostree --repo=%s init --mode=bare-user", tmprepo)
c.RunCmdSyncf(m, "sudo rpm-ostree ex-container import --repo=%s oci-archive:%s", tmprepo, ostreeblob)
c.RunCmdSyncf(m, "sudo ostree --repo=%s init --mode=archive", ostreeRepo)
c.RunCmdSyncf(m, "sudo ostree --repo=%s pull-local %s", ostreeRepo, tmprepo)
c.RunCmdSyncf(m, "sudo rm -rf %s %s", ostreeblob, tmprepo)
} else {
c.RunCmdSyncf(m, "tar -xf %s -C %s", ostreeblob, ostreeRepo)
}

// XXX: This is to work around sysroot
// remounting in libostree forcing a cache flush and blocking D-Bus.
// Should drop this once we fix it more properly in {rpm-,}ostree.
// https://github.com/coreos/coreos-assembler/issues/1301
c.RunCmdSyncf(m, "tar -xf %s -C %s && sync", kola.CosaBuild.Meta.BuildArtifacts.Ostree.Path, ostreeRepo)
c.RunCmdSyncf(m, "time sync")

// disable zincati; from now on, we'll start it manually whenenever we
// want to upgrade via Zincati
Expand Down

0 comments on commit 61e904e

Please sign in to comment.