@@ -35,7 +35,8 @@ import (
35
35
mantleUtil "github.com/coreos/mantle/util"
36
36
)
37
37
38
- const ostreeRepo = "/srv/ostree"
38
+ const workdir = "/var/srv/upgrade"
39
+ const ostreeRepo = workdir + "/repo"
39
40
const zincatiMetricsSocket = "/run/zincati/public/metrics.promsock"
40
41
41
42
var plog = capnslog .NewPackageLogger ("github.com/coreos/mantle" , "kola/tests/upgrade" )
@@ -114,15 +115,15 @@ func init() {
114
115
],
115
116
"directories": [
116
117
{
117
- "path": "OSTREE_REPO ",
118
+ "path": "WORKDIR ",
118
119
"mode": 493,
119
120
"user": {
120
121
"name": "core"
121
122
}
122
123
}
123
124
]
124
125
}
125
- }` , "OSTREE_REPO " , ostreeRepo , - 1 )),
126
+ }` , "WORKDIR " , workdir , - 1 )),
126
127
})
127
128
}
128
129
@@ -133,20 +134,34 @@ func fcosUpgradeBasic(c cluster.TestCluster) {
133
134
graph := new (Graph )
134
135
135
136
c .Run ("setup" , func (c cluster.TestCluster ) {
137
+ ostreeblob := kola .CosaBuild .Meta .BuildArtifacts .Ostree .Path
138
+ ostreeref := kola .CosaBuild .Meta .BuildRef
136
139
// this is the only heavy-weight part, though remember this test is
137
140
// optimized for qemu testing locally where this won't leave localhost at
138
141
// all. cloud testing should mostly be a pipeline thing, where the infra
139
142
// connection should be much faster
140
- ostreeTarPath := filepath .Join (kola .CosaBuild .Dir , kola . CosaBuild . Meta . BuildArtifacts . Ostree . Path )
143
+ ostreeTarPath := filepath .Join (kola .CosaBuild .Dir , ostreeblob )
141
144
if err := cluster .DropFile (c .Machines (), ostreeTarPath ); err != nil {
142
145
c .Fatal (err )
143
146
}
144
147
145
- // XXX: Note the '&& sync' here; this is to work around sysroot
148
+ // See https://github.com/coreos/fedora-coreos-tracker/issues/812
149
+ if strings .HasSuffix (ostreeblob , ".ociarchive" ) {
150
+ tmprepo := workdir + "/repo-bare"
151
+ // TODO: https://github.com/ostreedev/ostree-rs-ext/issues/34
152
+ c .RunCmdSyncf (m , "ostree --repo=%s init --mode=bare-user" , tmprepo )
153
+ c .RunCmdSyncf (m , "rpm-ostree ex-container import --repo=%s --write-ref %s oci-archive:%s" , tmprepo , ostreeref , ostreeblob )
154
+ c .RunCmdSyncf (m , "ostree --repo=%s init --mode=archive" , ostreeRepo )
155
+ c .RunCmdSyncf (m , "ostree --repo=%s pull-local %s %s" , ostreeRepo , tmprepo , ostreeref )
156
+ } else {
157
+ c .RunCmdSyncf (m , "mkdir -p %s && tar -xf %s -C %s" , ostreeRepo , ostreeblob , ostreeRepo )
158
+ }
159
+
160
+ // XXX: This is to work around sysroot
146
161
// remounting in libostree forcing a cache flush and blocking D-Bus.
147
162
// Should drop this once we fix it more properly in {rpm-,}ostree.
148
163
// https://github.com/coreos/coreos-assembler/issues/1301
149
- c .RunCmdSyncf (m , "tar -xf %s -C %s && sync" , kola . CosaBuild . Meta . BuildArtifacts . Ostree . Path , ostreeRepo )
164
+ c .RunCmdSync (m , "time sudo sync" )
150
165
151
166
// disable zincati; from now on, we'll start it manually whenenever we
152
167
// want to upgrade via Zincati
0 commit comments