*: rename master to main in tests & examples

This commit is contained in:
Timothée Ravier 2021-05-07 16:42:37 +02:00
parent b8cca6cef1
commit 02527f115e
38 changed files with 209 additions and 209 deletions

View File

@ -25,8 +25,8 @@ implements this.
To begin a simple upgrade, OSTree fetches the contents of the ref from To begin a simple upgrade, OSTree fetches the contents of the ref from
the remote server. Suppose we're tracking a ref named the remote server. Suppose we're tracking a ref named
`exampleos/buildmaster/x86_64-runtime`. OSTree fetches the URL `exampleos/buildmain/x86_64-runtime`. OSTree fetches the URL
`http://example.com/repo/refs/heads/exampleos/buildmaster/x86_64-runtime`, `http://example.com/repo/refs/heads/exampleos/buildmain/x86_64-runtime`,
which contains a SHA256 checksum. This determines the tree to deploy, which contains a SHA256 checksum. This determines the tree to deploy,
and `/etc` will be merged from currently booted tree. and `/etc` will be merged from currently booted tree.

View File

@ -123,16 +123,16 @@ commits. See the
for information on how git uses them. Unlike git though, it doesn't for information on how git uses them. Unlike git though, it doesn't
usually make sense to have a "main" branch. There is a convention usually make sense to have a "main" branch. There is a convention
for references in OSTree that looks like this: for references in OSTree that looks like this:
`exampleos/buildmaster/x86_64-runtime` and `exampleos/buildmain/x86_64-runtime` and
`exampleos/buildmaster/x86_64-devel-debug`. These two refs point to `exampleos/buildmain/x86_64-devel-debug`. These two refs point to
two different generated filesystem trees. In this example, the two different generated filesystem trees. In this example, the
"runtime" tree contains just enough to run a basic system, and "runtime" tree contains just enough to run a basic system, and
"devel-debug" contains all of the developer tools and debuginfo. "devel-debug" contains all of the developer tools and debuginfo.
The `ostree` supports a simple syntax using the caret `^` to refer to The `ostree` supports a simple syntax using the caret `^` to refer to
the parent of a given commit. For example, the parent of a given commit. For example,
`exampleos/buildmaster/x86_64-runtime^` refers to the previous build, `exampleos/buildmain/x86_64-runtime^` refers to the previous build,
and `exampleos/buildmaster/x86_64-runtime^^` refers to the one before and `exampleos/buildmain/x86_64-runtime^^` refers to the one before
that. that.
## The summary file ## The summary file

View File

@ -80,7 +80,7 @@ Then, what you'll want to do is promote content from "dev" to "prod".
We'll discuss this later, but first, let's talk about promotion We'll discuss this later, but first, let's talk about promotion
*inside* our "dev" repository. *inside* our "dev" repository.
## Promoting content along OSTree branches - "buildmaster", "smoketested" ## Promoting content along OSTree branches - "buildmain", "smoketested"
Besides multiple repositories, OSTree also supports multiple branches Besides multiple repositories, OSTree also supports multiple branches
inside one repository, equivalent to git's branches. We saw in an inside one repository, equivalent to git's branches. We saw in an
@ -88,16 +88,16 @@ earlier section an example branch name like
`exampleos/x86_64/standard`. Choosing the branch name for your "prod" `exampleos/x86_64/standard`. Choosing the branch name for your "prod"
repository is absolutely critical as client systems will reference it. repository is absolutely critical as client systems will reference it.
It becomes an important part of your face to the world, in the same It becomes an important part of your face to the world, in the same
way the "master" branch in a git repository is. way the "main" branch in a git repository is.
But with your "dev" repository internally, it can be very useful to But with your "dev" repository internally, it can be very useful to
use OSTree's branching concepts to represent different stages in a use OSTree's branching concepts to represent different stages in a
software delivery pipeline. software delivery pipeline.
Deriving from `exampleos/x86_64/standard`, let's say our "dev" Deriving from `exampleos/x86_64/standard`, let's say our "dev"
repository contains `exampleos/x86_64/buildmaster/standard`. We choose the repository contains `exampleos/x86_64/buildmain/standard`. We choose the
term "buildmaster" to represent something that came straight from git term "buildmain" to represent something that came straight from git
master. It may not be tested very much. main. It may not be tested very much.
Our next step should be to hook up a testing system (Jenkins, Our next step should be to hook up a testing system (Jenkins,
Buildbot, etc.) to this. When a build (commit) passes some tests, we Buildbot, etc.) to this. When a build (commit) passes some tests, we
@ -106,14 +106,14 @@ want to "promote" that commit. Let's create a new branch called
complete system. This might be where human testers get involved, for complete system. This might be where human testers get involved, for
example. example.
This is a basic way to "promote" the `buildmaster` commit that passed testing: This is a basic way to "promote" the `buildmain` commit that passed testing:
``` ```
ostree commit -b exampleos/x86_64/smoketested/standard -s 'Passed tests' --tree=ref=aec070645fe53... ostree commit -b exampleos/x86_64/smoketested/standard -s 'Passed tests' --tree=ref=aec070645fe53...
``` ```
Here we're generating a new commit object (perhaps include in the commit Here we're generating a new commit object (perhaps include in the commit
log links to build logs, etc.), but we're reusing the *content* from the `buildmaster` log links to build logs, etc.), but we're reusing the *content* from the `buildmain`
commit `aec070645fe53` that passed the smoketests. commit `aec070645fe53` that passed the smoketests.
For a more sophisticated implementation of this model, see the For a more sophisticated implementation of this model, see the

View File

@ -146,12 +146,12 @@ Boston, MA 02111-1307, USA.
<para><command>$ ostree admin status</command></para> <para><command>$ ostree admin status</command></para>
<programlisting> <programlisting>
* gnome-ostree 67e382b11d213a402a5313e61cbc69dfd5ab93cb07.0 * gnome-ostree 67e382b11d213a402a5313e61cbc69dfd5ab93cb07.0
origin refspec: gnome-ostree/buildmaster/x86_64-runtime origin refspec: gnome-ostree/buildmain/x86_64-runtime
gnome-ostree ce19c41036cc45e49b0cecf6b157523c2105c4de1ce3.0 gnome-ostree ce19c41036cc45e49b0cecf6b157523c2105c4de1ce3.0
origin refspec: gnome-ostree/buildmaster/x86_64-runtime origin refspec: gnome-ostree/buildmain/x86_64-runtime
</programlisting> </programlisting>
<para><command>$ ostree admin deploy gnome-ostree/buildmaster/x86_64-runtime</command></para> <para><command>$ ostree admin deploy gnome-ostree/buildmain/x86_64-runtime</command></para>
<programlisting> <programlisting>
ostadmin: Creating deployment /ostree/deploy/gnome-ostree/deploy/7e382b11d213a402a5313e61cbc69dfd5ab93cb07.1 ostadmin: Creating deployment /ostree/deploy/gnome-ostree/deploy/7e382b11d213a402a5313e61cbc69dfd5ab93cb07.1
ostadmin: Processing /etc: 3 modified, 0 removed, 29 added ostadmin: Processing /etc: 3 modified, 0 removed, 29 added
@ -161,9 +161,9 @@ Boston, MA 02111-1307, USA.
<para><command>$ ostree admin status</command></para> <para><command>$ ostree admin status</command></para>
<programlisting> <programlisting>
gnome-ostree 67e382b11d213a402a5313e61cbc69dfd5ab93cb07.1 gnome-ostree 67e382b11d213a402a5313e61cbc69dfd5ab93cb07.1
origin refspec: gnome-ostree/buildmaster/x86_64-runtime origin refspec: gnome-ostree/buildmain/x86_64-runtime
* gnome-ostree 67e382b11d213a402a5313e61cbc69dfd5ab93cb07.0 * gnome-ostree 67e382b11d213a402a5313e61cbc69dfd5ab93cb07.0
origin refspec: gnome-ostree/buildmaster/x86_64-runtime origin refspec: gnome-ostree/buildmain/x86_64-runtime
</programlisting> </programlisting>
</refsect1> </refsect1>

View File

@ -93,6 +93,6 @@ Boston, MA 02111-1307, USA.
<refsect1> <refsect1>
<title>Example</title> <title>Example</title>
<para><command>$ ostree admin set-origin exampleos http://os.example.com/repo exampleos/10.0/master/router</command></para> <para><command>$ ostree admin set-origin exampleos http://os.example.com/repo exampleos/10.0/main/router</command></para>
</refsect1> </refsect1>
</refentry> </refentry>

View File

@ -68,9 +68,9 @@ Boston, MA 02111-1307, USA.
<para><command>$ ostree admin status</command></para> <para><command>$ ostree admin status</command></para>
<programlisting> <programlisting>
* gnome-ostree 67e382b11d213a402a5313e61cbc69dfd5ab93cb07.0 * gnome-ostree 67e382b11d213a402a5313e61cbc69dfd5ab93cb07.0
origin refspec: gnome-ostree/buildmaster/x86_64-runtime origin refspec: gnome-ostree/buildmain/x86_64-runtime
gnome-ostree ce19c41036cc45e49b0cecf6b157523c2105c4de1c.0 gnome-ostree ce19c41036cc45e49b0cecf6b157523c2105c4de1c.0
origin refspec: gnome-ostree/buildmaster/x86_64-runtime origin refspec: gnome-ostree/buildmain/x86_64-runtime
</programlisting> </programlisting>
</refsect1> </refsect1>
</refentry> </refentry>

View File

@ -68,9 +68,9 @@ Boston, MA 02111-1307, USA.
<para><command>$ ostree admin status</command></para> <para><command>$ ostree admin status</command></para>
<programlisting> <programlisting>
* gnome-ostree 67e382b11d213a402a5313e61cbc69dfd5ab93cb07.0 * gnome-ostree 67e382b11d213a402a5313e61cbc69dfd5ab93cb07.0
origin refspec: gnome-ostree/buildmaster/x86_64-runtime origin refspec: gnome-ostree/buildmain/x86_64-runtime
gnome-ostree ce19c41036cc45e49b0cecf6b157523c2105c4de1c.0 gnome-ostree ce19c41036cc45e49b0cecf6b157523c2105c4de1c.0
origin refspec: gnome-ostree/buildmaster/x86_64-runtime origin refspec: gnome-ostree/buildmain/x86_64-runtime
</programlisting> </programlisting>
<para><command>$ ostree admin undeploy 1</command></para> <para><command>$ ostree admin undeploy 1</command></para>
<programlisting> <programlisting>
@ -81,7 +81,7 @@ Boston, MA 02111-1307, USA.
<para><command>$ ostree admin status</command></para> <para><command>$ ostree admin status</command></para>
<programlisting> <programlisting>
* gnome-ostree 67e382b11d213a402a5313e61cbc69dfd5ab93cb07.0 * gnome-ostree 67e382b11d213a402a5313e61cbc69dfd5ab93cb07.0
origin refspec: gnome-ostree/buildmaster/x86_64-runtime origin refspec: gnome-ostree/buildmain/x86_64-runtime
</programlisting> </programlisting>
</refsect1> </refsect1>
</refentry> </refentry>

View File

@ -144,7 +144,7 @@ Boston, MA 02111-1307, USA.
<para><command>$ ostree refs</command></para> <para><command>$ ostree refs</command></para>
<programlisting> <programlisting>
my-branch my-branch
gnome-ostree/buildmaster/x86_64-runtime gnome-ostree/buildmain/x86_64-runtime
</programlisting> </programlisting>
</refsect1> </refsect1>
</refentry> </refentry>

View File

@ -160,11 +160,11 @@ ostree_validate_checksum_string (const char *sha256,
* @out_ref: (out) (not nullable) (optional): Return location for the ref name * @out_ref: (out) (not nullable) (optional): Return location for the ref name
* @error: Error * @error: Error
* *
* Split a refspec like `gnome-ostree:gnome-ostree/buildmaster` or just * Split a refspec like `gnome-ostree:gnome-ostree/buildmain` or just
* `gnome-ostree/buildmaster` into two parts. In the first case, @out_remote * `gnome-ostree/buildmain` into two parts. In the first case, @out_remote
* will be set to `gnome-ostree`, and @out_ref to `gnome-ostree/buildmaster`. * will be set to `gnome-ostree`, and @out_ref to `gnome-ostree/buildmain`.
* In the second case (a local ref), @out_remote will be %NULL, and @out_ref * In the second case (a local ref), @out_remote will be %NULL, and @out_ref
* will be `gnome-ostree/buildmaster`. In both cases, %TRUE will be returned. * will be `gnome-ostree/buildmain`. In both cases, %TRUE will be returned.
* *
* Returns: %TRUE on successful parsing, %FALSE otherwise * Returns: %TRUE on successful parsing, %FALSE otherwise
*/ */

View File

@ -53,11 +53,11 @@ assert_ostree_deployment_refs() {
} }
orig_mtime=$(stat -c '%.Y' sysroot/ostree/deploy) orig_mtime=$(stat -c '%.Y' sysroot/ostree/deploy)
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull-local --remote=testos testos-repo testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull-local --remote=testos testos-repo testos/buildmain/x86_64-runtime
rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime) rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmain/x86_64-runtime)
export rev export rev
# This initial deployment gets kicked off with some kernel arguments # This initial deployment gets kicked off with some kernel arguments
${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmain/x86_64-runtime
new_mtime=$(stat -c '%.Y' sysroot/ostree/deploy) new_mtime=$(stat -c '%.Y' sysroot/ostree/deploy)
assert_not_streq "${orig_mtime}" "${new_mtime}" assert_not_streq "${orig_mtime}" "${new_mtime}"
${CMD_PREFIX} ostree admin status | tee status.txt ${CMD_PREFIX} ostree admin status | tee status.txt
@ -66,9 +66,9 @@ assert_not_file_has_content status.txt "rollback"
validate_bootloader validate_bootloader
# Test the bootable and linux keys # Test the bootable and linux keys
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo --print-metadata-key=ostree.linux show testos:testos/buildmaster/x86_64-runtime >out.txt ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo --print-metadata-key=ostree.linux show testos:testos/buildmain/x86_64-runtime >out.txt
assert_file_has_content_literal out.txt 3.6.0 assert_file_has_content_literal out.txt 3.6.0
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo --print-metadata-key=ostree.bootable show testos:testos/buildmaster/x86_64-runtime >out.txt ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo --print-metadata-key=ostree.bootable show testos:testos/buildmain/x86_64-runtime >out.txt
assert_file_has_content_literal out.txt true assert_file_has_content_literal out.txt true
echo "ok deploy command" echo "ok deploy command"
@ -92,14 +92,14 @@ assert_ostree_deployment_refs 1/1/0
${CMD_PREFIX} ostree admin status ${CMD_PREFIX} ostree admin status
echo "ok layout" echo "ok layout"
if ${CMD_PREFIX} ostree admin deploy --stage --os=testos testos:testos/buildmaster/x86_64-runtime 2>err.txt; then if ${CMD_PREFIX} ostree admin deploy --stage --os=testos testos:testos/buildmain/x86_64-runtime 2>err.txt; then
fatal "staged when not booted" fatal "staged when not booted"
fi fi
assert_file_has_content_literal err.txt "Cannot stage deployment: Not currently booted into an OSTree system" assert_file_has_content_literal err.txt "Cannot stage deployment: Not currently booted into an OSTree system"
echo "ok staging does not work when not booted" echo "ok staging does not work when not booted"
orig_mtime=$(stat -c '%.Y' sysroot/ostree/deploy) orig_mtime=$(stat -c '%.Y' sysroot/ostree/deploy)
${CMD_PREFIX} ostree admin deploy --os=testos testos:testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree admin deploy --os=testos testos:testos/buildmain/x86_64-runtime
new_mtime=$(stat -c '%.Y' sysroot/ostree/deploy) new_mtime=$(stat -c '%.Y' sysroot/ostree/deploy)
assert_not_streq "${orig_mtime}" "${new_mtime}" assert_not_streq "${orig_mtime}" "${new_mtime}"
# Need a new bootversion, sine we now have two deployments # Need a new bootversion, sine we now have two deployments
@ -119,7 +119,7 @@ validate_bootloader
echo "ok second deploy" echo "ok second deploy"
${CMD_PREFIX} ostree admin deploy --os=testos testos:testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree admin deploy --os=testos testos:testos/buildmain/x86_64-runtime
# Keep the same bootversion # Keep the same bootversion
assert_has_dir sysroot/boot/loader.0 assert_has_dir sysroot/boot/loader.0
assert_not_has_dir sysroot/boot/loader.1 assert_not_has_dir sysroot/boot/loader.1
@ -134,7 +134,7 @@ echo "ok third deploy (swap)"
${CMD_PREFIX} ostree admin os-init otheros ${CMD_PREFIX} ostree admin os-init otheros
${CMD_PREFIX} ostree admin deploy --os=otheros testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree admin deploy --os=otheros testos/buildmain/x86_64-runtime
assert_not_has_dir sysroot/boot/loader.0 assert_not_has_dir sysroot/boot/loader.0
assert_has_dir sysroot/boot/loader.1 assert_has_dir sysroot/boot/loader.1
assert_has_file sysroot/boot/loader/entries/ostree-2-testos.conf assert_has_file sysroot/boot/loader/entries/ostree-2-testos.conf
@ -147,7 +147,7 @@ validate_bootloader
echo "ok independent deploy" echo "ok independent deploy"
${CMD_PREFIX} ostree admin deploy --retain --os=testos testos:testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree admin deploy --retain --os=testos testos:testos/buildmain/x86_64-runtime
assert_has_dir sysroot/boot/loader.0 assert_has_dir sysroot/boot/loader.0
assert_not_has_dir sysroot/boot/loader.1 assert_not_has_dir sysroot/boot/loader.1
assert_has_file sysroot/boot/loader/entries/ostree-4-testos.conf assert_has_file sysroot/boot/loader/entries/ostree-4-testos.conf
@ -164,7 +164,7 @@ echo "a new local config file" > sysroot/ostree/deploy/testos/deploy/${rev}.3/et
rm -r sysroot/ostree/deploy/testos/deploy/${rev}.3/etc/testdirectory rm -r sysroot/ostree/deploy/testos/deploy/${rev}.3/etc/testdirectory
rm sysroot/ostree/deploy/testos/deploy/${rev}.3/etc/aconfigfile rm sysroot/ostree/deploy/testos/deploy/${rev}.3/etc/aconfigfile
ln -s /ENOENT sysroot/ostree/deploy/testos/deploy/${rev}.3/etc/a-new-broken-symlink ln -s /ENOENT sysroot/ostree/deploy/testos/deploy/${rev}.3/etc/a-new-broken-symlink
${CMD_PREFIX} ostree admin deploy --retain --os=testos testos:testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree admin deploy --retain --os=testos testos:testos/buildmain/x86_64-runtime
assert_not_has_dir sysroot/boot/loader.0 assert_not_has_dir sysroot/boot/loader.0
assert_has_dir sysroot/boot/loader.1 assert_has_dir sysroot/boot/loader.1
link=sysroot/ostree/deploy/testos/deploy/${rev}.4/etc/a-new-broken-symlink link=sysroot/ostree/deploy/testos/deploy/${rev}.4/etc/a-new-broken-symlink
@ -189,7 +189,7 @@ done
assert_has_file sysroot/boot/loader/entries/ostree-1-testos.conf assert_has_file sysroot/boot/loader/entries/ostree-1-testos.conf
assert_not_has_file sysroot/boot/loader/entries/ostree-2-testos.conf assert_not_has_file sysroot/boot/loader/entries/ostree-2-testos.conf
assert_not_has_file sysroot/boot/loader/entries/ostree-3-otheros.conf assert_not_has_file sysroot/boot/loader/entries/ostree-3-otheros.conf
${CMD_PREFIX} ostree admin deploy --not-as-default --os=otheros testos:testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree admin deploy --not-as-default --os=otheros testos:testos/buildmain/x86_64-runtime
assert_has_dir sysroot/boot/loader.0 assert_has_dir sysroot/boot/loader.0
assert_not_has_dir sysroot/boot/loader.1 assert_not_has_dir sysroot/boot/loader.1
assert_has_file sysroot/boot/loader/entries/ostree-2-testos.conf assert_has_file sysroot/boot/loader/entries/ostree-2-testos.conf
@ -199,7 +199,7 @@ validate_bootloader
echo "ok deploy --not-as-default" echo "ok deploy --not-as-default"
${CMD_PREFIX} ostree admin deploy --retain-rollback --os=otheros testos:testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree admin deploy --retain-rollback --os=otheros testos:testos/buildmain/x86_64-runtime
assert_not_has_dir sysroot/boot/loader.0 assert_not_has_dir sysroot/boot/loader.0
assert_has_dir sysroot/boot/loader.1 assert_has_dir sysroot/boot/loader.1
assert_has_file sysroot/boot/loader/entries/ostree-3-otheros.conf assert_has_file sysroot/boot/loader/entries/ostree-3-otheros.conf
@ -211,12 +211,12 @@ validate_bootloader
echo "ok deploy --retain-rollback" echo "ok deploy --retain-rollback"
os_repository_new_commit os_repository_new_commit
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull-local --remote=testos testos-repo testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull-local --remote=testos testos-repo testos/buildmain/x86_64-runtime
newrev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos:testos/buildmaster/x86_64-runtime) newrev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos:testos/buildmain/x86_64-runtime)
export newrev export newrev
assert_not_streq ${rev} ${newrev} assert_not_streq ${rev} ${newrev}
${CMD_PREFIX} ostree admin deploy --os=testos testos:testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree admin deploy --os=testos testos:testos/buildmain/x86_64-runtime
assert_file_has_content sysroot/ostree/deploy/testos/deploy/${newrev}.0/etc/os-release 'NAME=TestOS' assert_file_has_content sysroot/ostree/deploy/testos/deploy/${newrev}.0/etc/os-release 'NAME=TestOS'
# New files in /usr/etc # New files in /usr/etc
assert_file_has_content sysroot/ostree/deploy/testos/deploy/${newrev}.0/etc/a-new-default-config-file "a new default config file" assert_file_has_content sysroot/ostree/deploy/testos/deploy/${newrev}.0/etc/a-new-default-config-file "a new default config file"
@ -234,24 +234,24 @@ if env OSTREE_EX_STAGE_DEPLOYMENTS=1 ${CMD_PREFIX} ostree admin upgrade --os=tes
fi fi
echo "ok upgrade failed when staged" echo "ok upgrade failed when staged"
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo remote add --set=gpg-verify=false testos file://$(pwd)/testos-repo testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo remote add --set=gpg-verify=false testos file://$(pwd)/testos-repo testos/buildmain/x86_64-runtime
${CMD_PREFIX} ostree admin upgrade --os=testos ${CMD_PREFIX} ostree admin upgrade --os=testos
origrev=${rev} origrev=${rev}
rev=${newrev} rev=${newrev}
newrev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime) newrev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmain/x86_64-runtime)
assert_not_streq ${rev} ${newrev} assert_not_streq ${rev} ${newrev}
assert_file_has_content sysroot/ostree/deploy/testos/deploy/${newrev}.0/etc/os-release 'NAME=TestOS' assert_file_has_content sysroot/ostree/deploy/testos/deploy/${newrev}.0/etc/os-release 'NAME=TestOS'
${CMD_PREFIX} ostree admin status ${CMD_PREFIX} ostree admin status
validate_bootloader validate_bootloader
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo refs testos:testos > reftest.txt ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo refs testos:testos > reftest.txt
assert_file_has_content reftest.txt testos:buildmaster/x86_64-runtime assert_file_has_content reftest.txt testos:buildmain/x86_64-runtime
echo "ok upgrade" echo "ok upgrade"
originfile=$(${CMD_PREFIX} ostree admin --print-current-dir).origin originfile=$(${CMD_PREFIX} ostree admin --print-current-dir).origin
cp ${originfile} saved-origin cp ${originfile} saved-origin
${CMD_PREFIX} ostree admin set-origin --index=0 bacon --set=gpg-verify=false http://tasty.com ${CMD_PREFIX} ostree admin set-origin --index=0 bacon --set=gpg-verify=false http://tasty.com
assert_file_has_content "${originfile}" "bacon:testos/buildmaster/x86_64-runtime" assert_file_has_content "${originfile}" "bacon:testos/buildmain/x86_64-runtime"
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo remote list -u > remotes.txt ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo remote list -u > remotes.txt
assert_file_has_content remotes.txt 'bacon.*http://tasty\.com' assert_file_has_content remotes.txt 'bacon.*http://tasty\.com'
cp saved-origin ${originfile} cp saved-origin ${originfile}
@ -272,22 +272,22 @@ validate_bootloader
echo "ok undeploy" echo "ok undeploy"
if ${CMD_PREFIX} ostree admin deploy --os=unknown testos:testos/buildmaster/x86_64-runtime; then if ${CMD_PREFIX} ostree admin deploy --os=unknown testos:testos/buildmain/x86_64-runtime; then
assert_not_reached "Unexpected successful deploy of unknown OS" assert_not_reached "Unexpected successful deploy of unknown OS"
fi fi
echo "ok deploy with unknown OS" echo "ok deploy with unknown OS"
${CMD_PREFIX} ostree admin deploy --os=testos --karg-append=console=/dev/foo --karg-append=console=/dev/bar testos:testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree admin deploy --os=testos --karg-append=console=/dev/foo --karg-append=console=/dev/bar testos:testos/buildmain/x86_64-runtime
${CMD_PREFIX} ostree admin deploy --os=testos testos:testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree admin deploy --os=testos testos:testos/buildmain/x86_64-runtime
assert_file_has_content sysroot/boot/loader/entries/ostree-4-testos.conf 'console=/dev/foo.*console=/dev/bar' assert_file_has_content sysroot/boot/loader/entries/ostree-4-testos.conf 'console=/dev/foo.*console=/dev/bar'
validate_bootloader validate_bootloader
echo "ok deploy with multiple kernel args" echo "ok deploy with multiple kernel args"
origrev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime) origrev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmain/x86_64-runtime)
os_repository_new_commit 0 "test upgrade multiple kernel args" os_repository_new_commit 0 "test upgrade multiple kernel args"
${CMD_PREFIX} ostree admin upgrade --os=testos ${CMD_PREFIX} ostree admin upgrade --os=testos
newrev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime) newrev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmain/x86_64-runtime)
assert_not_streq ${origrev} ${newrev} assert_not_streq ${origrev} ${newrev}
assert_file_has_content sysroot/boot/loader/entries/ostree-4-testos.conf 'console=/dev/foo.*console=/dev/bar' assert_file_has_content sysroot/boot/loader/entries/ostree-4-testos.conf 'console=/dev/foo.*console=/dev/bar'
validate_bootloader validate_bootloader
@ -297,7 +297,7 @@ echo "ok upgrade with multiple kernel args"
os_repository_new_commit os_repository_new_commit
${CMD_PREFIX} ostree admin upgrade --os=testos ${CMD_PREFIX} ostree admin upgrade --os=testos
assert_file_has_content sysroot/boot/loader/entries/ostree-4-testos.conf "^title TestOS 42 ${version} (ostree:testos:0)$" assert_file_has_content sysroot/boot/loader/entries/ostree-4-testos.conf "^title TestOS 42 ${version} (ostree:testos:0)$"
os_repository_new_commit 0 0 testos/buildmaster/x86_64-runtime 42 os_repository_new_commit 0 0 testos/buildmain/x86_64-runtime 42
${CMD_PREFIX} ostree admin upgrade --os=testos ${CMD_PREFIX} ostree admin upgrade --os=testos
assert_file_has_content sysroot/boot/loader/entries/ostree-4-testos.conf "^title TestOS 42 (ostree:testos:0)$" assert_file_has_content sysroot/boot/loader/entries/ostree-4-testos.conf "^title TestOS 42 (ostree:testos:0)$"
@ -310,8 +310,8 @@ sleep 1
os_repository_new_commit os_repository_new_commit
# upgrade to the latest # upgrade to the latest
${CMD_PREFIX} ostree admin upgrade --os=testos ${CMD_PREFIX} ostree admin upgrade --os=testos
head_rev=$(${CMD_PREFIX} ostree rev-parse --repo=sysroot/ostree/repo testos/buildmaster/x86_64-runtime) head_rev=$(${CMD_PREFIX} ostree rev-parse --repo=sysroot/ostree/repo testos/buildmain/x86_64-runtime)
prev_rev=$(${CMD_PREFIX} ostree rev-parse --repo=sysroot/ostree/repo testos/buildmaster/x86_64-runtime^) prev_rev=$(${CMD_PREFIX} ostree rev-parse --repo=sysroot/ostree/repo testos/buildmain/x86_64-runtime^)
assert_not_streq ${head_rev} ${prev_rev} assert_not_streq ${head_rev} ${prev_rev}
# Don't use `ostree admin status | head -n 1` directly here because `head` # Don't use `ostree admin status | head -n 1` directly here because `head`
# exiting early might cause SIGPIPE to ostree, which with `set -euo pipefail` # exiting early might cause SIGPIPE to ostree, which with `set -euo pipefail`
@ -342,14 +342,14 @@ sleep 1
os_repository_new_commit os_repository_new_commit
sleep 1 sleep 1
os_repository_new_commit os_repository_new_commit
${CMD_PREFIX} ostree pull --repo=sysroot/ostree/repo --commit-metadata-only --depth=-1 testos:testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree pull --repo=sysroot/ostree/repo --commit-metadata-only --depth=-1 testos:testos/buildmain/x86_64-runtime
curr_rev=$(${CMD_PREFIX} ostree rev-parse --repo=sysroot/ostree/repo testos/buildmaster/x86_64-runtime) curr_rev=$(${CMD_PREFIX} ostree rev-parse --repo=sysroot/ostree/repo testos/buildmain/x86_64-runtime)
prev_rev=$(${CMD_PREFIX} ostree rev-parse --repo=sysroot/ostree/repo testos/buildmaster/x86_64-runtime^) prev_rev=$(${CMD_PREFIX} ostree rev-parse --repo=sysroot/ostree/repo testos/buildmain/x86_64-runtime^)
${CMD_PREFIX} ostree admin upgrade --os=testos --override-commit=${prev_rev} ${CMD_PREFIX} ostree admin upgrade --os=testos --override-commit=${prev_rev}
echo "ok upgrade to newer version older than branch tip" echo "ok upgrade to newer version older than branch tip"
${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo commit --add-metadata-string "version=${version}" \ ${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo commit --add-metadata-string "version=${version}" \
--add-metadata-string 'ostree.source-title=libtest os_repository_new_commit()' -b testos/buildmaster/x86_64-runtime \ --add-metadata-string 'ostree.source-title=libtest os_repository_new_commit()' -b testos/buildmain/x86_64-runtime \
-s "Build" --tree=dir=${test_tmpdir}/osdata -s "Build" --tree=dir=${test_tmpdir}/osdata
${CMD_PREFIX} ostree admin upgrade --os=testos ${CMD_PREFIX} ostree admin upgrade --os=testos
${CMD_PREFIX} ostree admin status | tee status.txt ${CMD_PREFIX} ostree admin status | tee status.txt
@ -381,7 +381,7 @@ assert_file_has_content sysroot/ostree/repo/config remote-test-config-dir
echo "ok remote add nonphysical sysroot add-remotes-config-dir false" echo "ok remote add nonphysical sysroot add-remotes-config-dir false"
if env OSTREE_SYSROOT_DEBUG="${OSTREE_SYSROOT_DEBUG},test-fifreeze" \ if env OSTREE_SYSROOT_DEBUG="${OSTREE_SYSROOT_DEBUG},test-fifreeze" \
${CMD_PREFIX} ostree admin deploy --os=testos testos:testos/buildmaster/x86_64-runtime 2>err.txt; then ${CMD_PREFIX} ostree admin deploy --os=testos testos:testos/buildmain/x86_64-runtime 2>err.txt; then
fatal "fifreeze-test exited successfully?" fatal "fifreeze-test exited successfully?"
fi fi
assert_file_has_content err.txt "fifreeze watchdog was run" assert_file_has_content err.txt "fifreeze watchdog was run"

View File

@ -1017,7 +1017,7 @@ if ! skip_one_without_user_xattrs; then
fi fi
cd ${test_tmpdir} cd ${test_tmpdir}
${CMD_PREFIX} ostree --repo=repo remote --set=tls-permissive=true add aremote http://remote.example.com/repo testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree --repo=repo remote --set=tls-permissive=true add aremote http://remote.example.com/repo testos/buildmain/x86_64-runtime
assert_file_has_content repo/config 'tls-permissive=true' assert_file_has_content repo/config 'tls-permissive=true'
assert_file_has_content repo/config 'remote\.example\.com' assert_file_has_content repo/config 'remote\.example\.com'
echo "ok remote add with set" echo "ok remote add with set"

View File

@ -455,12 +455,12 @@ EOF
mkdir -p usr/etc/testdirectory mkdir -p usr/etc/testdirectory
echo "a default daemon file" > usr/etc/testdirectory/test echo "a default daemon file" > usr/etc/testdirectory/test
${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo commit ${bootable_flag} --add-metadata-string version=1.0.9 -b testos/buildmaster/x86_64-runtime -s "Build" ${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo commit ${bootable_flag} --add-metadata-string version=1.0.9 -b testos/buildmain/x86_64-runtime -s "Build"
# Ensure these commits have distinct second timestamps # Ensure these commits have distinct second timestamps
sleep 2 sleep 2
echo "a new executable" > usr/bin/sh echo "a new executable" > usr/bin/sh
${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo commit ${bootable_flag} --add-metadata-string version=1.0.10 -b testos/buildmaster/x86_64-runtime -s "Build" ${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo commit ${bootable_flag} --add-metadata-string version=1.0.10 -b testos/buildmain/x86_64-runtime -s "Build"
cd ${test_tmpdir} cd ${test_tmpdir}
rm -rf osdata-devel rm -rf osdata-devel
@ -469,7 +469,7 @@ EOF
cd osdata-devel cd osdata-devel
mkdir -p usr/include mkdir -p usr/include
echo "a development header" > usr/include/foo.h echo "a development header" > usr/include/foo.h
${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo commit ${bootable_flag} --add-metadata-string version=1.0.9 -b testos/buildmaster/x86_64-devel -s "Build" ${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo commit ${bootable_flag} --add-metadata-string version=1.0.9 -b testos/buildmain/x86_64-devel -s "Build"
${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo fsck -q ${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo fsck -q
@ -516,7 +516,7 @@ os_repository_new_commit ()
{ {
boot_checksum_iteration=${1:-0} boot_checksum_iteration=${1:-0}
content_iteration=${2:-0} content_iteration=${2:-0}
branch=${3:-testos/buildmaster/x86_64-runtime} branch=${3:-testos/buildmain/x86_64-runtime}
export version=${4:-$(date "+%Y%m%d.${content_iteration}")} export version=${4:-$(date "+%Y%m%d.${content_iteration}")}
echo "BOOT ITERATION: $boot_checksum_iteration" echo "BOOT ITERATION: $boot_checksum_iteration"
cd ${test_tmpdir}/osdata cd ${test_tmpdir}/osdata

View File

@ -28,11 +28,11 @@ setup_os_repository "archive" "syslinux"
echo "1..8" echo "1..8"
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull-local --remote=testos testos-repo testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull-local --remote=testos testos-repo testos/buildmain/x86_64-runtime
rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime) rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmain/x86_64-runtime)
export rev export rev
# This initial deployment gets kicked off with some kernel arguments # This initial deployment gets kicked off with some kernel arguments
${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmain/x86_64-runtime
assert_has_dir sysroot/boot/ostree/testos-${bootcsum} assert_has_dir sysroot/boot/ostree/testos-${bootcsum}
echo "ok deploy command" echo "ok deploy command"
@ -40,14 +40,14 @@ echo "ok deploy command"
# Commit + upgrade twice, so that we'll rotate out the original deployment # Commit + upgrade twice, so that we'll rotate out the original deployment
bootcsum1=${bootcsum} bootcsum1=${bootcsum}
os_repository_new_commit os_repository_new_commit
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo remote add --set=gpg-verify=false testos file://$(pwd)/testos-repo testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo remote add --set=gpg-verify=false testos file://$(pwd)/testos-repo testos/buildmain/x86_64-runtime
${CMD_PREFIX} ostree admin upgrade --os=testos ${CMD_PREFIX} ostree admin upgrade --os=testos
bootcsum2=${bootcsum} bootcsum2=${bootcsum}
os_repository_new_commit "1" os_repository_new_commit "1"
bootcsum3=${bootcsum} bootcsum3=${bootcsum}
${CMD_PREFIX} ostree admin upgrade --os=testos ${CMD_PREFIX} ostree admin upgrade --os=testos
newrev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime) newrev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmain/x86_64-runtime)
assert_not_streq ${rev} ${newrev} assert_not_streq ${rev} ${newrev}
assert_not_streq ${bootcsum1} ${bootcsum2} assert_not_streq ${bootcsum1} ${bootcsum2}
assert_not_streq ${bootcsum2} ${bootcsum3} assert_not_streq ${bootcsum2} ${bootcsum3}

View File

@ -28,16 +28,16 @@ setup_os_repository "archive" "syslinux"
echo "1..1" echo "1..1"
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull-local --remote=testos testos-repo testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull-local --remote=testos testos-repo testos/buildmain/x86_64-runtime
rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime) rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmain/x86_64-runtime)
export rev export rev
${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmain/x86_64-runtime
os_repository_new_commit os_repository_new_commit
rm sysroot/ostree/repo/tmp/* -rf rm sysroot/ostree/repo/tmp/* -rf
export TEST_BOOTID=4072029c-8b10-60d1-d31b-8422eeff9b42 export TEST_BOOTID=4072029c-8b10-60d1-d31b-8422eeff9b42
if env OSTREE_REPO_TEST_ERROR=pre-commit OSTREE_BOOTID=${TEST_BOOTID} \ if env OSTREE_REPO_TEST_ERROR=pre-commit OSTREE_BOOTID=${TEST_BOOTID} \
${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmaster/x86_64-runtime 2>err.txt; then ${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmain/x86_64-runtime 2>err.txt; then
assert_not_reached "Should have hit OSTREE_REPO_TEST_ERROR_PRE_COMMIT" assert_not_reached "Should have hit OSTREE_REPO_TEST_ERROR_PRE_COMMIT"
fi fi
stagepath=$(ls -d sysroot/ostree/repo/tmp/staging-${TEST_BOOTID}-*) stagepath=$(ls -d sysroot/ostree/repo/tmp/staging-${TEST_BOOTID}-*)
@ -47,12 +47,12 @@ assert_has_dir "${stagepath}"
export NEW_TEST_BOOTID=5072029c-8b10-60d1-d31b-8422eeff9b42 export NEW_TEST_BOOTID=5072029c-8b10-60d1-d31b-8422eeff9b42
if env OSTREE_REPO_TEST_ERROR=pre-commit OSTREE_BOOTID=${NEW_TEST_BOOTID} \ if env OSTREE_REPO_TEST_ERROR=pre-commit OSTREE_BOOTID=${NEW_TEST_BOOTID} \
${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=FOO --karg=quiet --os=testos testos:testos/buildmaster/x86_64-runtime 2>err.txt; then ${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=FOO --karg=quiet --os=testos testos:testos/buildmain/x86_64-runtime 2>err.txt; then
assert_not_reached "Should have hit OSTREE_REPO_TEST_ERROR_PRE_COMMIT" assert_not_reached "Should have hit OSTREE_REPO_TEST_ERROR_PRE_COMMIT"
fi fi
newstagepath=$(ls -d sysroot/ostree/repo/tmp/staging-${NEW_TEST_BOOTID}-*) newstagepath=$(ls -d sysroot/ostree/repo/tmp/staging-${NEW_TEST_BOOTID}-*)
assert_has_dir "${newstagepath}" assert_has_dir "${newstagepath}"
env OSTREE_BOOTID=${NEW_TEST_BOOTID} ${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmaster/x86_64-runtime env OSTREE_BOOTID=${NEW_TEST_BOOTID} ${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmain/x86_64-runtime
newstagepath=$(echo sysroot/ostree/repo/tmp/staging-${NEW_TEST_BOOTID}-*) newstagepath=$(echo sysroot/ostree/repo/tmp/staging-${NEW_TEST_BOOTID}-*)
assert_not_has_dir "${stagepath}" assert_not_has_dir "${stagepath}"
assert_not_has_dir "${newstagepath}" assert_not_has_dir "${newstagepath}"

View File

@ -28,10 +28,10 @@ setup_os_repository "archive" "syslinux"
echo "1..1" echo "1..1"
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull-local --remote=testos testos-repo testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull-local --remote=testos testos-repo testos/buildmain/x86_64-runtime
rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime) rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmain/x86_64-runtime)
export rev export rev
${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmain/x86_64-runtime
${CMD_PREFIX} ostree admin undeploy 0 ${CMD_PREFIX} ostree admin undeploy 0
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo refs > refs.txt ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo refs > refs.txt
assert_not_file_has_content refs.txt '^ostree/' assert_not_file_has_content refs.txt '^ostree/'

View File

@ -28,12 +28,12 @@ setup_os_repository "archive" "syslinux"
echo "1..2" echo "1..2"
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull-local --remote=testos testos-repo testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull-local --remote=testos testos-repo testos/buildmain/x86_64-runtime
rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime) rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmain/x86_64-runtime)
export rev export rev
echo "rev=${rev}" echo "rev=${rev}"
# This initial deployment gets kicked off with some kernel arguments # This initial deployment gets kicked off with some kernel arguments
${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmain/x86_64-runtime
assert_has_dir sysroot/boot/ostree/testos-${bootcsum} assert_has_dir sysroot/boot/ostree/testos-${bootcsum}
etc=sysroot/ostree/deploy/testos/deploy/${rev}.0/etc etc=sysroot/ostree/deploy/testos/deploy/${rev}.0/etc
@ -58,9 +58,9 @@ rm ${etc}/testdirectory -rf
# Now deploy a new commit # Now deploy a new commit
os_repository_new_commit os_repository_new_commit
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo remote add --set=gpg-verify=false testos file://$(pwd)/testos-repo testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo remote add --set=gpg-verify=false testos file://$(pwd)/testos-repo testos/buildmain/x86_64-runtime
${CMD_PREFIX} ostree admin upgrade --os=testos ${CMD_PREFIX} ostree admin upgrade --os=testos
newrev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime) newrev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmain/x86_64-runtime)
echo "newrev=${newrev}" echo "newrev=${newrev}"
newroot=sysroot/ostree/deploy/testos/deploy/${newrev}.0 newroot=sysroot/ostree/deploy/testos/deploy/${newrev}.0
newetc=${newroot}/etc newetc=${newroot}/etc
@ -94,32 +94,32 @@ echo "ok"
# Add /etc/initially-empty # Add /etc/initially-empty
cd "${test_tmpdir}/osdata" cd "${test_tmpdir}/osdata"
mkdir -p usr/etc/initially-empty mkdir -p usr/etc/initially-empty
${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo commit -b testos/buildmaster/x86_64-runtime -s "Add empty directory" ${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo commit -b testos/buildmain/x86_64-runtime -s "Add empty directory"
cd ${test_tmpdir} cd ${test_tmpdir}
# Upgrade, check that we have it # Upgrade, check that we have it
${CMD_PREFIX} ostree admin upgrade --os=testos ${CMD_PREFIX} ostree admin upgrade --os=testos
rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime) rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmain/x86_64-runtime)
assert_has_dir sysroot/ostree/deploy/testos/deploy/$rev.0/etc/initially-empty assert_has_dir sysroot/ostree/deploy/testos/deploy/$rev.0/etc/initially-empty
# Now add a two files in initially-empty # Now add a two files in initially-empty
cd "${test_tmpdir}/osdata" cd "${test_tmpdir}/osdata"
touch usr/etc/initially-empty/{afile,bfile} touch usr/etc/initially-empty/{afile,bfile}
${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo commit -b testos/buildmaster/x86_64-runtime -s "Add empty directory" ${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo commit -b testos/buildmain/x86_64-runtime -s "Add empty directory"
# Upgrade, check that we have the two new files # Upgrade, check that we have the two new files
cd ${test_tmpdir} cd ${test_tmpdir}
${CMD_PREFIX} ostree admin upgrade --os=testos ${CMD_PREFIX} ostree admin upgrade --os=testos
rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime) rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmain/x86_64-runtime)
assert_has_file sysroot/ostree/deploy/testos/deploy/$rev.0/etc/initially-empty/afile assert_has_file sysroot/ostree/deploy/testos/deploy/$rev.0/etc/initially-empty/afile
assert_has_file sysroot/ostree/deploy/testos/deploy/$rev.0/etc/initially-empty/bfile assert_has_file sysroot/ostree/deploy/testos/deploy/$rev.0/etc/initially-empty/bfile
# Replace config file with default directory # Replace config file with default directory
cd "${test_tmpdir}/osdata" cd "${test_tmpdir}/osdata"
mkdir usr/etc/somenewdir mkdir usr/etc/somenewdir
${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo commit -b testos/buildmaster/x86_64-runtime -s "Add default dir" ${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo commit -b testos/buildmain/x86_64-runtime -s "Add default dir"
cd ${test_tmpdir} cd ${test_tmpdir}
rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime) rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmain/x86_64-runtime)
newconfpath=sysroot/ostree/deploy/testos/deploy/${rev}.0/etc/somenewdir newconfpath=sysroot/ostree/deploy/testos/deploy/${rev}.0/etc/somenewdir
echo "some content blah" > ${newconfpath} echo "some content blah" > ${newconfpath}
if ${CMD_PREFIX} ostree admin upgrade --os=testos 2>err.txt; then if ${CMD_PREFIX} ostree admin upgrade --os=testos 2>err.txt; then
@ -131,12 +131,12 @@ rm ${newconfpath}
# Remove parent directory of modified config file # Remove parent directory of modified config file
cd "${test_tmpdir}/osdata" cd "${test_tmpdir}/osdata"
rm -rf usr/etc/initially-empty rm -rf usr/etc/initially-empty
${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo commit -b testos/buildmaster/x86_64-runtime -s "Remove default dir" ${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo commit -b testos/buildmain/x86_64-runtime -s "Remove default dir"
cd ${test_tmpdir} cd ${test_tmpdir}
newconfpath=sysroot/ostree/deploy/testos/deploy/${rev}.0/etc/initially-empty/mynewfile newconfpath=sysroot/ostree/deploy/testos/deploy/${rev}.0/etc/initially-empty/mynewfile
touch ${newconfpath} touch ${newconfpath}
${CMD_PREFIX} ostree admin upgrade --os=testos ${CMD_PREFIX} ostree admin upgrade --os=testos
rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime) rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmain/x86_64-runtime)
assert_not_has_file sysroot/ostree/deploy/testos/deploy/${rev}.0/usr/etc/initially-empty assert_not_has_file sysroot/ostree/deploy/testos/deploy/${rev}.0/usr/etc/initially-empty
assert_has_file sysroot/ostree/deploy/testos/deploy/${rev}.0/etc/initially-empty/mynewfile assert_has_file sysroot/ostree/deploy/testos/deploy/${rev}.0/etc/initially-empty/mynewfile
rm ${newconfpath} rm ${newconfpath}

View File

@ -28,23 +28,23 @@ setup_os_repository "archive" "syslinux"
echo "1..3" echo "1..3"
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull-local --remote=testos testos-repo testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull-local --remote=testos testos-repo testos/buildmain/x86_64-runtime
rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime) rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmain/x86_64-runtime)
export rev export rev
# This initial deployment gets kicked off with some kernel arguments # This initial deployment gets kicked off with some kernel arguments
${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmain/x86_64-runtime
${CMD_PREFIX} ostree admin deploy --karg=FOO=BAR --os=testos testos:testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree admin deploy --karg=FOO=BAR --os=testos testos:testos/buildmain/x86_64-runtime
${CMD_PREFIX} ostree admin deploy --karg=TESTARG=TESTVALUE --os=testos testos:testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree admin deploy --karg=TESTARG=TESTVALUE --os=testos testos:testos/buildmain/x86_64-runtime
assert_file_has_content sysroot/boot/loader/entries/ostree-1-testos.conf 'options.*FOO=BAR' assert_file_has_content sysroot/boot/loader/entries/ostree-1-testos.conf 'options.*FOO=BAR'
assert_file_has_content sysroot/boot/loader/entries/ostree-2-testos.conf 'options.*FOO=BAR' assert_file_has_content sysroot/boot/loader/entries/ostree-2-testos.conf 'options.*FOO=BAR'
assert_file_has_content sysroot/boot/loader/entries/ostree-2-testos.conf 'options.*TESTARG=TESTVALUE' assert_file_has_content sysroot/boot/loader/entries/ostree-2-testos.conf 'options.*TESTARG=TESTVALUE'
${CMD_PREFIX} ostree admin deploy --karg=ANOTHERARG=ANOTHERVALUE --os=testos testos:testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree admin deploy --karg=ANOTHERARG=ANOTHERVALUE --os=testos testos:testos/buildmain/x86_64-runtime
assert_file_has_content sysroot/boot/loader/entries/ostree-2-testos.conf 'options.*TESTARG=TESTVALUE' assert_file_has_content sysroot/boot/loader/entries/ostree-2-testos.conf 'options.*TESTARG=TESTVALUE'
assert_file_has_content sysroot/boot/loader/entries/ostree-2-testos.conf 'options.*ANOTHERARG=ANOTHERVALUE' assert_file_has_content sysroot/boot/loader/entries/ostree-2-testos.conf 'options.*ANOTHERARG=ANOTHERVALUE'
echo "ok deploy with --karg, but same config" echo "ok deploy with --karg, but same config"
${CMD_PREFIX} ostree admin deploy --karg-proc-cmdline --os=testos testos:testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree admin deploy --karg-proc-cmdline --os=testos testos:testos/buildmain/x86_64-runtime
for arg in $(cat /proc/cmdline); do for arg in $(cat /proc/cmdline); do
case "$arg" in case "$arg" in
ostree=*) # Skip ostree arg that gets stripped out ostree=*) # Skip ostree arg that gets stripped out
@ -61,13 +61,13 @@ echo "ok deploy --karg-proc-cmdline"
${CMD_PREFIX} ostree admin status ${CMD_PREFIX} ostree admin status
${CMD_PREFIX} ostree admin undeploy 0 ${CMD_PREFIX} ostree admin undeploy 0
${CMD_PREFIX} ostree admin deploy --os=testos --karg-append=APPENDARG=VALAPPEND --karg-append=APPENDARG=2NDAPPEND testos:testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree admin deploy --os=testos --karg-append=APPENDARG=VALAPPEND --karg-append=APPENDARG=2NDAPPEND testos:testos/buildmain/x86_64-runtime
assert_file_has_content sysroot/boot/loader/entries/ostree-2-testos.conf 'options.*FOO=BAR' assert_file_has_content sysroot/boot/loader/entries/ostree-2-testos.conf 'options.*FOO=BAR'
assert_file_has_content sysroot/boot/loader/entries/ostree-2-testos.conf 'options.*TESTARG=TESTVALUE' assert_file_has_content sysroot/boot/loader/entries/ostree-2-testos.conf 'options.*TESTARG=TESTVALUE'
assert_file_has_content sysroot/boot/loader/entries/ostree-2-testos.conf 'options.*APPENDARG=VALAPPEND .*APPENDARG=2NDAPPEND' assert_file_has_content sysroot/boot/loader/entries/ostree-2-testos.conf 'options.*APPENDARG=VALAPPEND .*APPENDARG=2NDAPPEND'
# Check correct ordering of different-valued args of the same key. # Check correct ordering of different-valued args of the same key.
${CMD_PREFIX} ostree admin deploy --os=testos --karg-append=FOO=TESTORDERED --karg-append=APPENDARG=3RDAPPEND testos:testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree admin deploy --os=testos --karg-append=FOO=TESTORDERED --karg-append=APPENDARG=3RDAPPEND testos:testos/buildmain/x86_64-runtime
assert_file_has_content sysroot/boot/loader/entries/ostree-2-testos.conf 'options.*APPENDARG=VALAPPEND .*APPENDARG=2NDAPPEND .*FOO=TESTORDERED .*APPENDARG=3RDAPPEND' assert_file_has_content sysroot/boot/loader/entries/ostree-2-testos.conf 'options.*APPENDARG=VALAPPEND .*APPENDARG=2NDAPPEND .*FOO=TESTORDERED .*APPENDARG=3RDAPPEND'
echo "ok deploy --karg-append" echo "ok deploy --karg-append"

View File

@ -25,15 +25,15 @@ set -euo pipefail
# Exports OSTREE_SYSROOT so --sysroot not needed. # Exports OSTREE_SYSROOT so --sysroot not needed.
setup_os_repository "archive" "syslinux" setup_os_repository "archive" "syslinux"
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull-local --remote=testos testos-repo testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull-local --remote=testos testos-repo testos/buildmain/x86_64-runtime
echo "1..1" echo "1..1"
${CMD_PREFIX} ostree admin deploy --os=testos --karg=root=LABEL=foo --karg=testkarg=1 testos:testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree admin deploy --os=testos --karg=root=LABEL=foo --karg=testkarg=1 testos:testos/buildmain/x86_64-runtime
origdeployment=$(${CMD_PREFIX} ostree admin --sysroot=sysroot --print-current-dir) origdeployment=$(${CMD_PREFIX} ostree admin --sysroot=sysroot --print-current-dir)
testconfig=etc/modified-config-file-that-will-be-removed testconfig=etc/modified-config-file-that-will-be-removed
touch "${origdeployment}"/"${testconfig}" touch "${origdeployment}"/"${testconfig}"
assert_file_has_content sysroot/boot/loader/entries/ostree-1-testos.conf "^options.*root=LABEL=foo.*testkarg" assert_file_has_content sysroot/boot/loader/entries/ostree-1-testos.conf "^options.*root=LABEL=foo.*testkarg"
${CMD_PREFIX} ostree admin deploy --os=testos --no-merge --karg=root=LABEL=bar testos:testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree admin deploy --os=testos --no-merge --karg=root=LABEL=bar testos:testos/buildmain/x86_64-runtime
deployment=$(${CMD_PREFIX} ostree admin --sysroot=sysroot --print-current-dir) deployment=$(${CMD_PREFIX} ostree admin --sysroot=sysroot --print-current-dir)
assert_not_streq "${origdeployment}" "${deployment}" assert_not_streq "${origdeployment}" "${deployment}"
assert_not_has_file "${deployment}/${testconfig}" assert_not_has_file "${deployment}/${testconfig}"

View File

@ -34,12 +34,12 @@ extra_admin_tests=1
cd ${test_tmpdir} cd ${test_tmpdir}
rm httpd osdata testos-repo sysroot -rf rm httpd osdata testos-repo sysroot -rf
setup_os_repository "archive" "sysroot.bootloader none" setup_os_repository "archive" "sysroot.bootloader none"
${CMD_PREFIX} ostree pull-local --repo=sysroot/ostree/repo --remote testos testos-repo testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree pull-local --repo=sysroot/ostree/repo --remote testos testos-repo testos/buildmain/x86_64-runtime
# Test that configuring sysroot.bootloader="none" is a workaround for previous # Test that configuring sysroot.bootloader="none" is a workaround for previous
# grub2 bootloader issue (see https://github.com/ostreedev/ostree/issues/1774) # grub2 bootloader issue (see https://github.com/ostreedev/ostree/issues/1774)
mkdir -p sysroot/boot/grub2 mkdir -p sysroot/boot/grub2
touch sysroot/boot/grub2/grub.cfg touch sysroot/boot/grub2/grub.cfg
${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os testos testos/buildmaster/x86_64-runtime > out.txt ${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os testos testos/buildmain/x86_64-runtime > out.txt
assert_file_has_content out.txt "Bootloader updated.*" assert_file_has_content out.txt "Bootloader updated.*"
assert_file_has_content sysroot/boot/loader/entries/ostree-1-testos.conf 'options.* root=LABEL=MOO' assert_file_has_content sysroot/boot/loader/entries/ostree-1-testos.conf 'options.* root=LABEL=MOO'
assert_file_has_content sysroot/boot/ostree/testos-${bootcsum}/vmlinuz-3.6.0 'a kernel' assert_file_has_content sysroot/boot/ostree/testos-${bootcsum}/vmlinuz-3.6.0 'a kernel'

View File

@ -29,23 +29,23 @@ setup_os_repository "archive" "syslinux"
echo "1..4" echo "1..4"
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo remote add --set=gpg-verify=false testos file://$(pwd)/testos-repo ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo remote add --set=gpg-verify=false testos file://$(pwd)/testos-repo
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull testos testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull testos testos/buildmain/x86_64-runtime
${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmain/x86_64-runtime
newrev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos:testos/buildmaster/x86_64-runtime) newrev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos:testos/buildmain/x86_64-runtime)
assert_not_has_file sysroot/ostree/deploy/testos/deploy/$newrev.0/usr/include/foo.h assert_not_has_file sysroot/ostree/deploy/testos/deploy/$newrev.0/usr/include/foo.h
if ${CMD_PREFIX} ostree admin switch --os=testos testos/buildmaster/x86_64-runtime; then if ${CMD_PREFIX} ostree admin switch --os=testos testos/buildmain/x86_64-runtime; then
assert_not_reached "Switch to same ref unexpectedly succeeded" assert_not_reached "Switch to same ref unexpectedly succeeded"
fi fi
echo "ok switch expected error" echo "ok switch expected error"
${CMD_PREFIX} ostree admin switch --os=testos testos/buildmaster/x86_64-devel ${CMD_PREFIX} ostree admin switch --os=testos testos/buildmain/x86_64-devel
newrev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos:testos/buildmaster/x86_64-devel) newrev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos:testos/buildmain/x86_64-devel)
assert_file_has_content sysroot/ostree/deploy/testos/deploy/$newrev.0/usr/include/foo.h 'header' assert_file_has_content sysroot/ostree/deploy/testos/deploy/$newrev.0/usr/include/foo.h 'header'
echo "ok switch" echo "ok switch"
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo remote add --set=gpg-verify=false anothertestos file://$(pwd)/testos-repo ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo remote add --set=gpg-verify=false anothertestos file://$(pwd)/testos-repo
${CMD_PREFIX} ostree admin switch --os=testos anothertestos:testos/buildmaster/x86_64-devel ${CMD_PREFIX} ostree admin switch --os=testos anothertestos:testos/buildmain/x86_64-devel
# Ok this is lame, need a better shell command to extract config, or switch to gjs # Ok this is lame, need a better shell command to extract config, or switch to gjs
${CMD_PREFIX} ostree admin status > status.txt ${CMD_PREFIX} ostree admin status > status.txt
assert_file_has_content status.txt anothertestos assert_file_has_content status.txt anothertestos

View File

@ -35,9 +35,9 @@ for test_bootdir in "boot" "usr/lib/ostree-boot"; do
cd ${test_tmpdir} cd ${test_tmpdir}
rm httpd osdata testos-repo sysroot -rf rm httpd osdata testos-repo sysroot -rf
setup_os_repository "archive" "syslinux" $test_bootdir setup_os_repository "archive" "syslinux" $test_bootdir
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull-local --remote=testos testos-repo testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull-local --remote=testos testos-repo testos/buildmain/x86_64-runtime
rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime) rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmain/x86_64-runtime)
${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmain/x86_64-runtime
assert_file_has_content sysroot/boot/loader/entries/ostree-1-testos.conf 'options.* root=LABEL=MOO' assert_file_has_content sysroot/boot/loader/entries/ostree-1-testos.conf 'options.* root=LABEL=MOO'
assert_file_has_content sysroot/boot/loader/entries/ostree-1-testos.conf 'options.* quiet' assert_file_has_content sysroot/boot/loader/entries/ostree-1-testos.conf 'options.* quiet'
assert_file_has_content sysroot/boot/ostree/testos-${bootcsum}/vmlinuz-3.6.0 'a kernel' assert_file_has_content sysroot/boot/ostree/testos-${bootcsum}/vmlinuz-3.6.0 'a kernel'
@ -59,11 +59,11 @@ setup_os_repository "archive" "syslinux" "usr/lib/ostree-boot"
cd osdata cd osdata
echo "this is a kernel without an initramfs like Fedora 26" > usr/lib/modules/3.6.0/vmlinuz echo "this is a kernel without an initramfs like Fedora 26" > usr/lib/modules/3.6.0/vmlinuz
usrlib_modules_bootcsum=$(cat usr/lib/modules/3.6.0/vmlinuz | sha256sum | cut -f 1 -d ' ') usrlib_modules_bootcsum=$(cat usr/lib/modules/3.6.0/vmlinuz | sha256sum | cut -f 1 -d ' ')
${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo commit --add-metadata-string version=1.0.9 -b testos/buildmaster/x86_64-runtime -s "Build" ${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo commit --add-metadata-string version=1.0.9 -b testos/buildmain/x86_64-runtime -s "Build"
cd ${test_tmpdir} cd ${test_tmpdir}
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull-local --remote=testos testos-repo testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull-local --remote=testos testos-repo testos/buildmain/x86_64-runtime
rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime) rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmain/x86_64-runtime)
${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmain/x86_64-runtime
assert_file_has_content sysroot/boot/loader/entries/ostree-1-testos.conf 'options.* root=LABEL=MOO' assert_file_has_content sysroot/boot/loader/entries/ostree-1-testos.conf 'options.* root=LABEL=MOO'
assert_file_has_content sysroot/boot/ostree/testos-${bootcsum}/vmlinuz-3.6.0 'a kernel' assert_file_has_content sysroot/boot/ostree/testos-${bootcsum}/vmlinuz-3.6.0 'a kernel'
assert_file_has_content sysroot/boot/ostree/testos-${bootcsum}/initramfs-3.6.0.img 'an initramfs' assert_file_has_content sysroot/boot/ostree/testos-${bootcsum}/initramfs-3.6.0.img 'an initramfs'

View File

@ -46,7 +46,7 @@ loadramdisk=load mmc ${bootpart} ${rdaddr} ${ramdisk_image}
mmcargs=setenv bootargs $bootargs console=${console} ${optargs} root=${mmcroot} rootfstype=${mmcrootfstype} mmcargs=setenv bootargs $bootargs console=${console} ${optargs} root=${mmcroot} rootfstype=${mmcrootfstype}
mmcboot=run loadramdisk; echo Booting from mmc ....; run mmcargs; bootz ${loadaddr} ${rdaddr} ${fdtaddr} mmcboot=run loadramdisk; echo Booting from mmc ....; run mmcargs; bootz ${loadaddr} ${rdaddr} ${fdtaddr}
EOF EOF
${CMD_PREFIX} ostree --repo=testos-repo commit --tree=dir=osdata/ -b testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree --repo=testos-repo commit --tree=dir=osdata/ -b testos/buildmain/x86_64-runtime
${CMD_PREFIX} ostree admin upgrade --os=testos ${CMD_PREFIX} ostree admin upgrade --os=testos
assert_file_has_content sysroot/boot/uEnv.txt "loadfdt=" assert_file_has_content sysroot/boot/uEnv.txt "loadfdt="
assert_file_has_content sysroot/boot/uEnv.txt "kernel_image=" assert_file_has_content sysroot/boot/uEnv.txt "kernel_image="
@ -71,7 +71,7 @@ bootcsum=$(
cat ${devicetree_path} ${devicetree_overlay_path} ) | cat ${devicetree_path} ${devicetree_overlay_path} ) |
sha256sum | cut -f 1 -d ' ') sha256sum | cut -f 1 -d ' ')
${CMD_PREFIX} ostree --repo=testos-repo commit --tree=dir=osdata/ -b testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree --repo=testos-repo commit --tree=dir=osdata/ -b testos/buildmain/x86_64-runtime
${CMD_PREFIX} ostree admin upgrade --os=testos ${CMD_PREFIX} ostree admin upgrade --os=testos
assert_file_has_content sysroot/boot/uEnv.txt "fdtdir=" assert_file_has_content sysroot/boot/uEnv.txt "fdtdir="
assert_file_has_content sysroot/boot/ostree/testos-${bootcsum}/dtb/asoc-board.dtb 'a device tree' assert_file_has_content sysroot/boot/ostree/testos-${bootcsum}/dtb/asoc-board.dtb 'a device tree'

View File

@ -82,12 +82,12 @@ EOF
mkdir -p usr/etc/testdirectory mkdir -p usr/etc/testdirectory
echo "a default daemon file" > usr/etc/testdirectory/test echo "a default daemon file" > usr/etc/testdirectory/test
${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo commit --add-metadata-string version=1.0.9 -b testos/buildmaster/x86_64-runtime -s "Build" --gpg-sign=$keyid --gpg-homedir=${test_tmpdir}/gpghome ${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo commit --add-metadata-string version=1.0.9 -b testos/buildmain/x86_64-runtime -s "Build" --gpg-sign=$keyid --gpg-homedir=${test_tmpdir}/gpghome
# Ensure these commits have distinct second timestamps # Ensure these commits have distinct second timestamps
sleep 2 sleep 2
echo "a new executable" > usr/bin/sh echo "a new executable" > usr/bin/sh
${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo commit --add-metadata-string version=1.0.10 -b testos/buildmaster/x86_64-runtime -s "Build" --gpg-sign=$keyid --gpg-homedir=${test_tmpdir}/gpghome ${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo commit --add-metadata-string version=1.0.10 -b testos/buildmain/x86_64-runtime -s "Build" --gpg-sign=$keyid --gpg-homedir=${test_tmpdir}/gpghome
cd ${test_tmpdir} cd ${test_tmpdir}
rm -rf osdata-devel rm -rf osdata-devel
@ -96,7 +96,7 @@ EOF
cd osdata-devel cd osdata-devel
mkdir -p usr/include mkdir -p usr/include
echo "a development header" > usr/include/foo.h echo "a development header" > usr/include/foo.h
${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo commit --add-metadata-string version=1.0.9 -b testos/buildmaster/x86_64-devel -s "Build" --gpg-sign=$keyid --gpg-homedir=${test_tmpdir}/gpghome ${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo commit --add-metadata-string version=1.0.9 -b testos/buildmain/x86_64-devel -s "Build" --gpg-sign=$keyid --gpg-homedir=${test_tmpdir}/gpghome
${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo fsck -q ${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo fsck -q
@ -137,9 +137,9 @@ setup_os_repository_signed "archive" "syslinux"
echo "1..2" echo "1..2"
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo remote add testos $(cat httpd-address)/ostree/testos-repo ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo remote add testos $(cat httpd-address)/ostree/testos-repo
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull-local --gpg-verify=true --remote=testos testos-repo testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull-local --gpg-verify=true --remote=testos testos-repo testos/buildmain/x86_64-runtime
# This initial deployment gets kicked off with some kernel arguments # This initial deployment gets kicked off with some kernel arguments
${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmain/x86_64-runtime
assert_has_dir sysroot/boot/ostree/testos-${bootcsum} assert_has_dir sysroot/boot/ostree/testos-${bootcsum}
echo "ok deploy command" echo "ok deploy command"

View File

@ -29,8 +29,8 @@ setup_os_repository "archive" "syslinux"
echo "1..5" echo "1..5"
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull-local --remote=testos testos-repo testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull-local --remote=testos testos-repo testos/buildmain/x86_64-runtime
${CMD_PREFIX} ostree admin deploy --os=testos testos:testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree admin deploy --os=testos testos:testos/buildmain/x86_64-runtime
${CMD_PREFIX} ostree admin instutil set-kargs FOO=BAR ${CMD_PREFIX} ostree admin instutil set-kargs FOO=BAR
${CMD_PREFIX} ostree admin instutil set-kargs FOO=BAZ FOO=BIF TESTARG=TESTVALUE KEYWORD EMPTYLIST= ${CMD_PREFIX} ostree admin instutil set-kargs FOO=BAZ FOO=BIF TESTARG=TESTVALUE KEYWORD EMPTYLIST=
@ -50,7 +50,7 @@ assert_file_has_content sysroot/boot/loader/entries/ostree-1-testos.conf 'option
assert_file_has_content sysroot/boot/loader/entries/ostree-1-testos.conf 'options.*TESTARG=TESTVALUE KEYWORD EMPTYLIST=' assert_file_has_content sysroot/boot/loader/entries/ostree-1-testos.conf 'options.*TESTARG=TESTVALUE KEYWORD EMPTYLIST='
echo "ok instutil set-kargs --replace" echo "ok instutil set-kargs --replace"
${CMD_PREFIX} ostree admin instutil set-kargs --merge --append=FOO=BAR --append=APPENDARG=VALAPPEND --append=APPENDARG=2NDAPPEND testos:testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree admin instutil set-kargs --merge --append=FOO=BAR --append=APPENDARG=VALAPPEND --append=APPENDARG=2NDAPPEND testos:testos/buildmain/x86_64-runtime
assert_file_has_content sysroot/boot/loader/entries/ostree-1-testos.conf 'options.*FOO=XXX.*FOO=BAR' assert_file_has_content sysroot/boot/loader/entries/ostree-1-testos.conf 'options.*FOO=XXX.*FOO=BAR'
assert_file_has_content sysroot/boot/loader/entries/ostree-1-testos.conf 'options.*APPENDARG=VALAPPEND .*APPENDARG=2NDAPPEND' assert_file_has_content sysroot/boot/loader/entries/ostree-1-testos.conf 'options.*APPENDARG=VALAPPEND .*APPENDARG=2NDAPPEND'
echo "ok instutil set-kargs --append" echo "ok instutil set-kargs --append"

View File

@ -36,12 +36,12 @@ echo "1..1"
cd ${test_tmpdir} cd ${test_tmpdir}
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo remote add --set=gpg-verify=false testos $(cat httpd-address)/ostree/testos-repo ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo remote add --set=gpg-verify=false testos $(cat httpd-address)/ostree/testos-repo
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull testos testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull testos testos/buildmain/x86_64-runtime
rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime) rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmain/x86_64-runtime)
export rev export rev
echo "rev=${rev}" echo "rev=${rev}"
# This initial deployment gets kicked off with some kernel arguments # This initial deployment gets kicked off with some kernel arguments
${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmain/x86_64-runtime
assert_has_dir sysroot/boot/ostree/testos-${bootcsum} assert_has_dir sysroot/boot/ostree/testos-${bootcsum}
parallel_cmd="parallel --gnu" parallel_cmd="parallel --gnu"
@ -50,7 +50,7 @@ if parallel --help | grep -q -e --no-notice; then
fi fi
count=$(($(getconf _NPROCESSORS_ONLN) * 2)) count=$(($(getconf _NPROCESSORS_ONLN) * 2))
seq "${count}" | ${parallel_cmd} -n0 ${CMD_PREFIX} ostree admin deploy --retain --os=testos testos:testos/buildmaster/x86_64-runtime seq "${count}" | ${parallel_cmd} -n0 ${CMD_PREFIX} ostree admin deploy --retain --os=testos testos:testos/buildmain/x86_64-runtime
${CMD_PREFIX} ostree admin status > status.txt ${CMD_PREFIX} ostree admin status > status.txt
grep "testos ${rev}" status.txt | wc -l > status-matches.txt grep "testos ${rev}" status.txt | wc -l > status-matches.txt

View File

@ -31,8 +31,8 @@ setup_os_repository "archive" "syslinux"
cd ${test_tmpdir} cd ${test_tmpdir}
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo remote add --set=gpg-verify=false testos $(cat httpd-address)/ostree/testos-repo ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo remote add --set=gpg-verify=false testos $(cat httpd-address)/ostree/testos-repo
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull testos testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull testos testos/buildmain/x86_64-runtime
rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime) rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmain/x86_64-runtime)
parent_rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse ${rev}^) parent_rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse ${rev}^)
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull testos ${parent_rev} ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull testos ${parent_rev}
${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os=testos ${parent_rev} ${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os=testos ${parent_rev}

View File

@ -31,11 +31,11 @@ setup_os_repository "archive" "syslinux"
cd ${test_tmpdir} cd ${test_tmpdir}
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo remote add --set=gpg-verify=false testos $(cat httpd-address)/ostree/testos-repo ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo remote add --set=gpg-verify=false testos $(cat httpd-address)/ostree/testos-repo
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull testos testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull testos testos/buildmain/x86_64-runtime
rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime) rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmain/x86_64-runtime)
parent_rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse ${rev}^) parent_rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse ${rev}^)
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull testos testos/buildmaster/x86_64-runtime@${parent_rev} ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull testos testos/buildmain/x86_64-runtime@${parent_rev}
${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmain/x86_64-runtime
assert_has_dir sysroot/ostree/deploy/testos/deploy/${parent_rev}.0 assert_has_dir sysroot/ostree/deploy/testos/deploy/${parent_rev}.0
assert_not_has_dir sysroot/ostree/deploy/testos/deploy/${rev}.0 assert_not_has_dir sysroot/ostree/deploy/testos/deploy/${rev}.0
# Do a pull, this one should get us new content # Do a pull, this one should get us new content
@ -47,7 +47,7 @@ assert_not_file_has_content out.txt 'No update available'
assert_has_dir sysroot/ostree/deploy/testos/deploy/${parent_rev}.0 assert_has_dir sysroot/ostree/deploy/testos/deploy/${parent_rev}.0
assert_not_has_dir sysroot/ostree/deploy/testos/deploy/${rev}.0 assert_not_has_dir sysroot/ostree/deploy/testos/deploy/${rev}.0
assert_file_has_content sysroot/boot/loader/entries/ostree-1-testos.conf 'TestOS 42 1\.0\.9' assert_file_has_content sysroot/boot/loader/entries/ostree-1-testos.conf 'TestOS 42 1\.0\.9'
assert_streq "${rev}" $(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime) assert_streq "${rev}" $(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmain/x86_64-runtime)
# Now, generate new content upstream; we shouldn't pull it # Now, generate new content upstream; we shouldn't pull it
os_repository_new_commit os_repository_new_commit
${CMD_PREFIX} ostree admin upgrade --os=testos --deploy-only --os=testos > out.txt ${CMD_PREFIX} ostree admin upgrade --os=testos --deploy-only --os=testos > out.txt

View File

@ -36,27 +36,27 @@ echo "1..3"
cd ${test_tmpdir} cd ${test_tmpdir}
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo remote add --set=gpg-verify=false testos $(cat httpd-address)/ostree/testos-repo ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo remote add --set=gpg-verify=false testos $(cat httpd-address)/ostree/testos-repo
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull testos testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull testos testos/buildmain/x86_64-runtime
rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime) rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmain/x86_64-runtime)
echo "rev=${rev}" echo "rev=${rev}"
# Now sysroot/ostree has the objects from the testos-repo (obtained over http # Now sysroot/ostree has the objects from the testos-repo (obtained over http
# and kept in remote "testos"), but there is no deployment # and kept in remote "testos"), but there is no deployment
# This initial deployment gets kicked off with some kernel arguments # This initial deployment gets kicked off with some kernel arguments
${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmain/x86_64-runtime
assert_has_dir sysroot/boot/ostree/testos-${bootcsum} assert_has_dir sysroot/boot/ostree/testos-${bootcsum}
echo "ok deploy" echo "ok deploy"
# Create a new branch which we want to migrate to # Create a new branch which we want to migrate to
os_repository_new_commit 1 1 testos/buildmaster/newbranch os_repository_new_commit 1 1 testos/buildmain/newbranch
# bootcsum now refers to this new commit # bootcsum now refers to this new commit
# Create a new commit with an empty tree, which marks the original branch as # Create a new commit with an empty tree, which marks the original branch as
# EOL, redirecting to the new one. # EOL, redirecting to the new one.
mkdir empty mkdir empty
${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo commit --tree=dir=$(pwd)/empty --add-metadata-string "ostree.endoflife=Product discontinued" --add-metadata-string "ostree.endoflife-rebase=testos/buildmaster/newbranch" -b testos/buildmaster/x86_64-runtime -s "EOL redirect to new branch" ${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo commit --tree=dir=$(pwd)/empty --add-metadata-string "ostree.endoflife=Product discontinued" --add-metadata-string "ostree.endoflife-rebase=testos/buildmain/newbranch" -b testos/buildmain/x86_64-runtime -s "EOL redirect to new branch"
echo "ok new branch" echo "ok new branch"
@ -66,7 +66,7 @@ ${CMD_PREFIX} ostree admin upgrade --os=testos --deploy-only
# Check we got redirected to the new branch # Check we got redirected to the new branch
assert_file_has_content sysroot/boot/loader/entries/ostree-2-testos.conf "${bootcsum}" assert_file_has_content sysroot/boot/loader/entries/ostree-2-testos.conf "${bootcsum}"
rev=$(${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo rev-parse testos/buildmaster/newbranch) rev=$(${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo rev-parse testos/buildmain/newbranch)
assert_file_has_content sysroot/ostree/deploy/testos/deploy/${rev}.0/usr/bin/content-iteration "1" assert_file_has_content sysroot/ostree/deploy/testos/deploy/${rev}.0/usr/bin/content-iteration "1"
assert_file_has_content sysroot/ostree/deploy/testos/deploy/${rev}.0.origin "newbranch" assert_file_has_content sysroot/ostree/deploy/testos/deploy/${rev}.0.origin "newbranch"

View File

@ -28,7 +28,7 @@ setup_os_repository "archive" "syslinux"
echo "1..2" echo "1..2"
ref=testos/buildmaster/x86_64-runtime ref=testos/buildmain/x86_64-runtime
cd ${test_tmpdir} cd ${test_tmpdir}
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo remote add --set=gpg-verify=false testos $(cat httpd-address)/ostree/testos-repo ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo remote add --set=gpg-verify=false testos $(cat httpd-address)/ostree/testos-repo
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull testos ${ref} ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull testos ${ref}

View File

@ -29,9 +29,9 @@ echo "1..2"
# Setup a deployment # Setup a deployment
cd ${test_tmpdir} cd ${test_tmpdir}
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo remote add --set=gpg-verify=false testos $(cat httpd-address)/ostree/testos-repo ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo remote add --set=gpg-verify=false testos $(cat httpd-address)/ostree/testos-repo
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull testos testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull testos testos/buildmain/x86_64-runtime
rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime) rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmain/x86_64-runtime)
${CMD_PREFIX} ostree admin deploy --os=testos testos:testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree admin deploy --os=testos testos:testos/buildmain/x86_64-runtime
assert_has_dir sysroot/ostree/deploy/testos/deploy/${rev}.0/usr assert_has_dir sysroot/ostree/deploy/testos/deploy/${rev}.0/usr
assert_has_dir sysroot/ostree/deploy/testos/deploy/${rev}.0/etc assert_has_dir sysroot/ostree/deploy/testos/deploy/${rev}.0/etc
assert_has_dir sysroot/ostree/deploy/testos/var assert_has_dir sysroot/ostree/deploy/testos/var
@ -50,7 +50,7 @@ touch -r ${usr} sysroot/ostree/deploy/testos/var/.updated
# (current) deployment # (current) deployment
os_repository_new_commit os_repository_new_commit
${CMD_PREFIX} ostree admin upgrade --os=testos ${CMD_PREFIX} ostree admin upgrade --os=testos
newrev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime) newrev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmain/x86_64-runtime)
assert_not_has_file sysroot/ostree/deploy/testos/deploy/${newrev}.0/etc/.updated assert_not_has_file sysroot/ostree/deploy/testos/deploy/${newrev}.0/etc/.updated
assert_not_has_file sysroot/ostree/deploy/testos/var/.updated assert_not_has_file sysroot/ostree/deploy/testos/var/.updated
assert_has_file sysroot/ostree/deploy/testos/deploy/${rev}.0/etc/.updated assert_has_file sysroot/ostree/deploy/testos/deploy/${rev}.0/etc/.updated

View File

@ -28,15 +28,15 @@ setup_os_repository "archive" "syslinux"
echo "1..2" echo "1..2"
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull-local --remote=testos testos-repo testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull-local --remote=testos testos-repo testos/buildmain/x86_64-runtime
rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime) rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmain/x86_64-runtime)
export rev export rev
echo "rev=${rev}" echo "rev=${rev}"
# This initial deployment gets kicked off with some kernel arguments # This initial deployment gets kicked off with some kernel arguments
${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmain/x86_64-runtime
echo "unconfigured-state=Use \"subscription-manager\" to enable online updates for example.com OS" >> sysroot/ostree/deploy/testos/deploy/${rev}.0.origin echo "unconfigured-state=Use \"subscription-manager\" to enable online updates for example.com OS" >> sysroot/ostree/deploy/testos/deploy/${rev}.0.origin
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo remote add --set=gpg-verify=false testos file://$(pwd)/testos-repo testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo remote add --set=gpg-verify=false testos file://$(pwd)/testos-repo testos/buildmain/x86_64-runtime
if ${CMD_PREFIX} ostree admin upgrade --os=testos 2>err.txt; then if ${CMD_PREFIX} ostree admin upgrade --os=testos 2>err.txt; then
assert_not_reached "upgrade unexpectedly succeeded" assert_not_reached "upgrade unexpectedly succeeded"
fi fi
@ -44,7 +44,7 @@ assert_file_has_content err.txt "Use.*subscription.*online"
echo "ok error" echo "ok error"
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo remote add --set=gpg-verify=false otheros file://$(pwd)/testos-repo testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo remote add --set=gpg-verify=false otheros file://$(pwd)/testos-repo testos/buildmain/x86_64-runtime
${CMD_PREFIX} ostree admin switch --os=testos otheros:testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree admin switch --os=testos otheros:testos/buildmain/x86_64-runtime
echo "ok switch" echo "ok switch"

View File

@ -43,7 +43,7 @@ mkdir os-collection
ostree_repo_init os-collection --collection-id org.example.OsCollection ostree_repo_init os-collection --collection-id org.example.OsCollection
mkdir -p files mkdir -p files
pushd files pushd files
${CMD_PREFIX} ostree --repo=../os-collection commit -s "Test os-collection commit 1" -b os/amd64/master --gpg-homedir=${TEST_GPG_KEYHOME} --gpg-sign=${TEST_GPG_KEYID_2} > ../os-checksum ${CMD_PREFIX} ostree --repo=../os-collection commit -s "Test os-collection commit 1" -b os/amd64/main --gpg-homedir=${TEST_GPG_KEYHOME} --gpg-sign=${TEST_GPG_KEYID_2} > ../os-checksum
popd popd
${CMD_PREFIX} ostree --repo=os-collection summary --update --gpg-homedir=${TEST_GPG_KEYHOME} --gpg-sign=${TEST_GPG_KEYID_2} ${CMD_PREFIX} ostree --repo=os-collection summary --update --gpg-homedir=${TEST_GPG_KEYHOME} --gpg-sign=${TEST_GPG_KEYID_2}
@ -54,16 +54,16 @@ ${CMD_PREFIX} ostree --repo=local remote add apps-remote file://$(pwd)/apps-coll
${CMD_PREFIX} ostree --repo=local remote add os-remote file://$(pwd)/os-collection --collection-id org.example.OsCollection --gpg-import=${test_tmpdir}/gpghome/key2.asc ${CMD_PREFIX} ostree --repo=local remote add os-remote file://$(pwd)/os-collection --collection-id org.example.OsCollection --gpg-import=${test_tmpdir}/gpghome/key2.asc
${CMD_PREFIX} ostree --repo=local pull apps-remote app1 ${CMD_PREFIX} ostree --repo=local pull apps-remote app1
${CMD_PREFIX} ostree --repo=local pull os-remote os/amd64/master ${CMD_PREFIX} ostree --repo=local pull os-remote os/amd64/main
${CMD_PREFIX} ostree --repo=local refs > refs ${CMD_PREFIX} ostree --repo=local refs > refs
assert_file_has_content refs "^apps-remote:app1$" assert_file_has_content refs "^apps-remote:app1$"
assert_file_has_content refs "^os-remote:os/amd64/master$" assert_file_has_content refs "^os-remote:os/amd64/main$"
${CMD_PREFIX} ostree --repo=local refs --collections > refs ${CMD_PREFIX} ostree --repo=local refs --collections > refs
cat refs | wc -l > refscount cat refs | wc -l > refscount
assert_file_has_content refs "^(org\.example\.AppsCollection, app1)$" assert_file_has_content refs "^(org\.example\.AppsCollection, app1)$"
assert_file_has_content refs "^(org\.example\.OsCollection, os/amd64/master)$" assert_file_has_content refs "^(org\.example\.OsCollection, os/amd64/main)$"
assert_file_has_content refscount "^2$" assert_file_has_content refscount "^2$"
# Create a local mirror repository where we pull the branches *in mirror mode* from the two remotes. # Create a local mirror repository where we pull the branches *in mirror mode* from the two remotes.
@ -74,7 +74,7 @@ ${CMD_PREFIX} ostree --repo=local-mirror remote add apps-remote file://$(pwd)/ap
${CMD_PREFIX} ostree --repo=local-mirror remote add os-remote file://$(pwd)/os-collection --collection-id org.example.OsCollection --gpg-import=${test_tmpdir}/gpghome/key2.asc ${CMD_PREFIX} ostree --repo=local-mirror remote add os-remote file://$(pwd)/os-collection --collection-id org.example.OsCollection --gpg-import=${test_tmpdir}/gpghome/key2.asc
${CMD_PREFIX} ostree --repo=local-mirror pull --mirror apps-remote app1 ${CMD_PREFIX} ostree --repo=local-mirror pull --mirror apps-remote app1
${CMD_PREFIX} ostree --repo=local-mirror pull --mirror os-remote os/amd64/master ${CMD_PREFIX} ostree --repo=local-mirror pull --mirror os-remote os/amd64/main
${CMD_PREFIX} ostree --repo=local-mirror refs | wc -l > refscount ${CMD_PREFIX} ostree --repo=local-mirror refs | wc -l > refscount
assert_file_has_content refscount "^0$" assert_file_has_content refscount "^0$"
@ -83,10 +83,10 @@ assert_file_has_content remotescount "^0$"
${CMD_PREFIX} ostree --repo=local-mirror refs --collections > refs ${CMD_PREFIX} ostree --repo=local-mirror refs --collections > refs
assert_file_has_content refs "^(org\.example\.AppsCollection, app1)$" assert_file_has_content refs "^(org\.example\.AppsCollection, app1)$"
assert_file_has_content refs "^(org\.example\.OsCollection, os/amd64/master)$" assert_file_has_content refs "^(org\.example\.OsCollection, os/amd64/main)$"
assert_file_has_content local-mirror/refs/mirrors/org.example.AppsCollection/app1 "^$(cat app1-checksum)$" assert_file_has_content local-mirror/refs/mirrors/org.example.AppsCollection/app1 "^$(cat app1-checksum)$"
assert_file_has_content local-mirror/refs/mirrors/org.example.OsCollection/os/amd64/master "^$(cat os-checksum)$" assert_file_has_content local-mirror/refs/mirrors/org.example.OsCollection/os/amd64/main "^$(cat os-checksum)$"
for repo in local local-mirror; do for repo in local local-mirror; do
# Try finding an update for an existing branch. # Try finding an update for an existing branch.
@ -98,25 +98,25 @@ for repo in local local-mirror; do
assert_not_file_has_content find "^No results\.$" assert_not_file_has_content find "^No results\.$"
# Find several updates for several existing branches. # Find several updates for several existing branches.
${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config org.example.AppsCollection app1 org.example.OsCollection os/amd64/master > find ${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config org.example.AppsCollection app1 org.example.OsCollection os/amd64/main > find
assert_file_has_content find "^Result [0-9]\+: file://$(pwd)/apps-collection$" assert_file_has_content find "^Result [0-9]\+: file://$(pwd)/apps-collection$"
assert_file_has_content find "^ - Keyring: apps-remote\.trustedkeys\.gpg$" assert_file_has_content find "^ - Keyring: apps-remote\.trustedkeys\.gpg$"
assert_file_has_content find "^ - (org\.example\.AppsCollection, app1) = $(cat app1-checksum)$" assert_file_has_content find "^ - (org\.example\.AppsCollection, app1) = $(cat app1-checksum)$"
assert_file_has_content find "^Result [0-9]\+: file://$(pwd)/os-collection$" assert_file_has_content find "^Result [0-9]\+: file://$(pwd)/os-collection$"
assert_file_has_content find "^ - Keyring: os-remote\.trustedkeys\.gpg$" assert_file_has_content find "^ - Keyring: os-remote\.trustedkeys\.gpg$"
assert_file_has_content find "^ - (org\.example\.OsCollection, os/amd64/master) = $(cat os-checksum)$" assert_file_has_content find "^ - (org\.example\.OsCollection, os/amd64/main) = $(cat os-checksum)$"
assert_file_has_content find "^2/2 refs were found\.$" assert_file_has_content find "^2/2 refs were found\.$"
assert_not_file_has_content find "^No results\.$" assert_not_file_has_content find "^No results\.$"
# Find some updates and a new branch. # Find some updates and a new branch.
${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config org.example.AppsCollection app1 org.example.AppsCollection app2 org.example.OsCollection os/amd64/master > find ${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config org.example.AppsCollection app1 org.example.AppsCollection app2 org.example.OsCollection os/amd64/main > find
assert_file_has_content find "^Result [0-9]\+: file://$(pwd)/apps-collection$" assert_file_has_content find "^Result [0-9]\+: file://$(pwd)/apps-collection$"
assert_file_has_content find "^ - Keyring: apps-remote\.trustedkeys\.gpg$" assert_file_has_content find "^ - Keyring: apps-remote\.trustedkeys\.gpg$"
assert_file_has_content find "^ - (org\.example\.AppsCollection, app1) = $(cat app1-checksum)$" assert_file_has_content find "^ - (org\.example\.AppsCollection, app1) = $(cat app1-checksum)$"
assert_file_has_content find "^ - (org\.example\.AppsCollection, app2) = $(cat app2-checksum)$" assert_file_has_content find "^ - (org\.example\.AppsCollection, app2) = $(cat app2-checksum)$"
assert_file_has_content find "^Result [0-9]\+: file://$(pwd)/os-collection$" assert_file_has_content find "^Result [0-9]\+: file://$(pwd)/os-collection$"
assert_file_has_content find "^ - Keyring: os-remote\.trustedkeys\.gpg$" assert_file_has_content find "^ - Keyring: os-remote\.trustedkeys\.gpg$"
assert_file_has_content find "^ - (org\.example\.OsCollection, os/amd64/master) = $(cat os-checksum)$" assert_file_has_content find "^ - (org\.example\.OsCollection, os/amd64/main) = $(cat os-checksum)$"
assert_file_has_content find "^3/3 refs were found\.$" assert_file_has_content find "^3/3 refs were found\.$"
assert_not_file_has_content find "^No results\.$" assert_not_file_has_content find "^No results\.$"
@ -138,20 +138,20 @@ for repo in local local-mirror; do
assert_not_file_has_content pull "Failed to pull some refs from the remotes" assert_not_file_has_content pull "Failed to pull some refs from the remotes"
assert_ref $repo app1 $(cat app1-checksum) assert_ref $repo app1 $(cat app1-checksum)
${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config --pull org.example.AppsCollection app1 org.example.OsCollection os/amd64/master > pull ${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config --pull org.example.AppsCollection app1 org.example.OsCollection os/amd64/main > pull
assert_file_has_content pull "^2/2 refs were found\.$" assert_file_has_content pull "^2/2 refs were found\.$"
assert_file_has_content pull "^Pulled 2/2 refs successfully\.$" assert_file_has_content pull "^Pulled 2/2 refs successfully\.$"
assert_not_file_has_content pull "Failed to pull some refs from the remotes" assert_not_file_has_content pull "Failed to pull some refs from the remotes"
assert_ref $repo app1 $(cat app1-checksum) assert_ref $repo app1 $(cat app1-checksum)
assert_ref $repo os/amd64/master $(cat os-checksum) assert_ref $repo os/amd64/main $(cat os-checksum)
${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config --pull org.example.AppsCollection app1 org.example.AppsCollection app2 org.example.OsCollection os/amd64/master > pull ${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config --pull org.example.AppsCollection app1 org.example.AppsCollection app2 org.example.OsCollection os/amd64/main > pull
assert_file_has_content pull "^3/3 refs were found\.$" assert_file_has_content pull "^3/3 refs were found\.$"
assert_file_has_content pull "^Pulled 3/3 refs successfully\.$" assert_file_has_content pull "^Pulled 3/3 refs successfully\.$"
assert_not_file_has_content pull "Failed to pull some refs from the remotes" assert_not_file_has_content pull "Failed to pull some refs from the remotes"
assert_ref $repo app1 $(cat app1-checksum) assert_ref $repo app1 $(cat app1-checksum)
assert_ref $repo app2 $(cat app2-checksum) assert_ref $repo app2 $(cat app2-checksum)
assert_ref $repo os/amd64/master $(cat os-checksum) assert_ref $repo os/amd64/main $(cat os-checksum)
${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config --pull org.example.AppsCollection app1 org.example.AppsCollection not-an-app > pull ${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config --pull org.example.AppsCollection app1 org.example.AppsCollection not-an-app > pull
assert_file_has_content pull "^1/2 refs were found\.$" assert_file_has_content pull "^1/2 refs were found\.$"
@ -162,30 +162,30 @@ done
# Test pulling a new commit into the local mirror from one of the repositories. # Test pulling a new commit into the local mirror from one of the repositories.
pushd files pushd files
${CMD_PREFIX} ostree --repo=../os-collection commit -s "Test os-collection commit 2" -b os/amd64/master --gpg-homedir=${TEST_GPG_KEYHOME} --gpg-sign=${TEST_GPG_KEYID_2} > ../os-checksum-2 ${CMD_PREFIX} ostree --repo=../os-collection commit -s "Test os-collection commit 2" -b os/amd64/main --gpg-homedir=${TEST_GPG_KEYHOME} --gpg-sign=${TEST_GPG_KEYID_2} > ../os-checksum-2
popd popd
${CMD_PREFIX} ostree --repo=os-collection summary --update --gpg-homedir=${TEST_GPG_KEYHOME} --gpg-sign=${TEST_GPG_KEYID_2} ${CMD_PREFIX} ostree --repo=os-collection summary --update --gpg-homedir=${TEST_GPG_KEYHOME} --gpg-sign=${TEST_GPG_KEYID_2}
for repo in local-mirror; do for repo in local-mirror; do
# Try finding an update for that branch. # Try finding an update for that branch.
${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config org.example.OsCollection os/amd64/master > find ${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config org.example.OsCollection os/amd64/main > find
assert_file_has_content find "^Result [0-9]\+: file://$(pwd)/os-collection$" assert_file_has_content find "^Result [0-9]\+: file://$(pwd)/os-collection$"
assert_file_has_content find "^ - Keyring: os-remote\.trustedkeys\.gpg$" assert_file_has_content find "^ - Keyring: os-remote\.trustedkeys\.gpg$"
assert_file_has_content find "^ - (org\.example\.OsCollection, os/amd64/master) = $(cat os-checksum-2)$" assert_file_has_content find "^ - (org\.example\.OsCollection, os/amd64/main) = $(cat os-checksum-2)$"
assert_file_has_content find "^1/1 refs were found\.$" assert_file_has_content find "^1/1 refs were found\.$"
assert_not_file_has_content find "^No results\.$" assert_not_file_has_content find "^No results\.$"
# Pull it. # Pull it.
${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config --pull org.example.OsCollection os/amd64/master > pull || true ${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config --pull org.example.OsCollection os/amd64/main > pull || true
assert_file_has_content pull "^1/1 refs were found\.$" assert_file_has_content pull "^1/1 refs were found\.$"
assert_file_has_content pull "^Pulled 1/1 refs successfully\.$" assert_file_has_content pull "^Pulled 1/1 refs successfully\.$"
assert_not_file_has_content pull "Failed to pull some refs from the remotes" assert_not_file_has_content pull "Failed to pull some refs from the remotes"
assert_ref $repo os/amd64/master $(cat os-checksum-2) assert_ref $repo os/amd64/main $(cat os-checksum-2)
# We need to manually update the refs afterwards, since the original pull # We need to manually update the refs afterwards, since the original pull
# into the local-mirror was a --mirror pull — so it wrote refs/mirrors/blah. # into the local-mirror was a --mirror pull — so it wrote refs/mirrors/blah.
# This pull was not, so it wrote refs/remotes/blah. # This pull was not, so it wrote refs/remotes/blah.
${CMD_PREFIX} ostree --repo=$repo refs --collections --create org.example.OsCollection:os/amd64/master os-remote:os/amd64/master ${CMD_PREFIX} ostree --repo=$repo refs --collections --create org.example.OsCollection:os/amd64/main os-remote:os/amd64/main
done done
# Add the local mirror to the local repository as a remote, so that the local repo # Add the local mirror to the local repository as a remote, so that the local repo
@ -195,46 +195,46 @@ ${CMD_PREFIX} ostree --repo=local remote add os-remote-local-mirror file://$(pwd
for repo in local; do for repo in local; do
# Try finding an update for that branch. # Try finding an update for that branch.
${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config org.example.OsCollection os/amd64/master > find ${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config org.example.OsCollection os/amd64/main > find
assert_file_has_content find "^Result [0-9]\+: file://$(pwd)/os-collection$" assert_file_has_content find "^Result [0-9]\+: file://$(pwd)/os-collection$"
assert_file_has_content find "^ - Keyring: os-remote\.trustedkeys\.gpg$" assert_file_has_content find "^ - Keyring: os-remote\.trustedkeys\.gpg$"
assert_file_has_content find "^ - (org\.example\.OsCollection, os/amd64/master) = $(cat os-checksum-2)$" assert_file_has_content find "^ - (org\.example\.OsCollection, os/amd64/main) = $(cat os-checksum-2)$"
assert_file_has_content find "^Result [0-9]\+: file://$(pwd)/local-mirror$" assert_file_has_content find "^Result [0-9]\+: file://$(pwd)/local-mirror$"
assert_file_has_content find "^ - Keyring: os-remote-local-mirror\.trustedkeys\.gpg$" assert_file_has_content find "^ - Keyring: os-remote-local-mirror\.trustedkeys\.gpg$"
assert_file_has_content find "^ - (org\.example\.OsCollection, os/amd64/master) = $(cat os-checksum-2)$" assert_file_has_content find "^ - (org\.example\.OsCollection, os/amd64/main) = $(cat os-checksum-2)$"
assert_file_has_content find "^1/1 refs were found\.$" assert_file_has_content find "^1/1 refs were found\.$"
assert_not_file_has_content find "^No results\.$" assert_not_file_has_content find "^No results\.$"
# Pull it. # Pull it.
${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config --pull org.example.OsCollection os/amd64/master > pull || true ${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config --pull org.example.OsCollection os/amd64/main > pull || true
assert_file_has_content pull "^1/1 refs were found\.$" assert_file_has_content pull "^1/1 refs were found\.$"
assert_file_has_content pull "^Pulled 1/1 refs successfully\.$" assert_file_has_content pull "^Pulled 1/1 refs successfully\.$"
assert_not_file_has_content pull "Failed to pull some refs from the remotes" assert_not_file_has_content pull "Failed to pull some refs from the remotes"
assert_ref $repo os/amd64/master $(cat os-checksum-2) assert_ref $repo os/amd64/main $(cat os-checksum-2)
done done
# Add another commit to the OS collection, but dont update the mirror. Then try pulling # Add another commit to the OS collection, but dont update the mirror. Then try pulling
# into the local repository again, and check that the outdated ref in the mirror is ignored. # into the local repository again, and check that the outdated ref in the mirror is ignored.
pushd files pushd files
${CMD_PREFIX} ostree --repo=../os-collection commit -s "Test os-collection commit 3" -b os/amd64/master --gpg-homedir=${TEST_GPG_KEYHOME} --gpg-sign=${TEST_GPG_KEYID_2} > ../os-checksum-3 ${CMD_PREFIX} ostree --repo=../os-collection commit -s "Test os-collection commit 3" -b os/amd64/main --gpg-homedir=${TEST_GPG_KEYHOME} --gpg-sign=${TEST_GPG_KEYID_2} > ../os-checksum-3
popd popd
${CMD_PREFIX} ostree --repo=os-collection summary --update --gpg-homedir=${TEST_GPG_KEYHOME} --gpg-sign=${TEST_GPG_KEYID_2} ${CMD_PREFIX} ostree --repo=os-collection summary --update --gpg-homedir=${TEST_GPG_KEYHOME} --gpg-sign=${TEST_GPG_KEYID_2}
for repo in local; do for repo in local; do
# Try finding an update for that branch. # Try finding an update for that branch.
${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config org.example.OsCollection os/amd64/master > find ${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config org.example.OsCollection os/amd64/main > find
assert_file_has_content find "^Result [0-9]\+: file://$(pwd)/os-collection$" assert_file_has_content find "^Result [0-9]\+: file://$(pwd)/os-collection$"
assert_file_has_content find "^ - Keyring: os-remote\.trustedkeys\.gpg$" assert_file_has_content find "^ - Keyring: os-remote\.trustedkeys\.gpg$"
assert_file_has_content find "^ - (org\.example\.OsCollection, os/amd64/master) = $(cat os-checksum-3)$" assert_file_has_content find "^ - (org\.example\.OsCollection, os/amd64/main) = $(cat os-checksum-3)$"
assert_file_has_content find "^1/1 refs were found\.$" assert_file_has_content find "^1/1 refs were found\.$"
assert_not_file_has_content find "^No results\.$" assert_not_file_has_content find "^No results\.$"
# Pull it. # Pull it.
${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config --pull org.example.OsCollection os/amd64/master > pull || true ${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config --pull org.example.OsCollection os/amd64/main > pull || true
assert_file_has_content pull "^1/1 refs were found\.$" assert_file_has_content pull "^1/1 refs were found\.$"
assert_file_has_content pull "^Pulled 1/1 refs successfully\.$" assert_file_has_content pull "^Pulled 1/1 refs successfully\.$"
assert_not_file_has_content pull "Failed to pull some refs from the remotes" assert_not_file_has_content pull "Failed to pull some refs from the remotes"
assert_ref $repo os/amd64/master $(cat os-checksum-3) assert_ref $repo os/amd64/main $(cat os-checksum-3)
done done
echo "ok find-remotes" echo "ok find-remotes"

View File

@ -9,8 +9,8 @@ setup_os_repository "archive-z2" "uboot"
cd ${test_tmpdir} cd ${test_tmpdir}
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo remote add --set=gpg-verify=false testos $(cat httpd-address)/ostree/testos-repo ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo remote add --set=gpg-verify=false testos $(cat httpd-address)/ostree/testos-repo
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull testos testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull testos testos/buildmain/x86_64-runtime
${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=rootfs --os=testos testos:testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=rootfs --os=testos testos:testos/buildmain/x86_64-runtime
assert_file_has_content sysroot/boot/loader/entries/ostree-1-testos.conf 'root=LABEL=rootfs' assert_file_has_content sysroot/boot/loader/entries/ostree-1-testos.conf 'root=LABEL=rootfs'
assert_not_file_has_content sysroot/boot/loader/entries/ostree-1-testos.conf 'init=' assert_not_file_has_content sysroot/boot/loader/entries/ostree-1-testos.conf 'init='
@ -47,8 +47,8 @@ pull_test_tree() {
exit 1 exit 1
fi fi
cd - cd -
${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo commit --tree=dir=osdata/ -b testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo commit --tree=dir=osdata/ -b testos/buildmain/x86_64-runtime
${CMD_PREFIX} ostree pull testos:testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree pull testos:testos/buildmain/x86_64-runtime
} }
get_key_from_bootloader_conf() { get_key_from_bootloader_conf() {
@ -62,7 +62,7 @@ get_key_from_bootloader_conf() {
for layout in /usr/lib/modules /usr/lib/ostree-boot /boot; for layout in /usr/lib/modules /usr/lib/ostree-boot /boot;
do do
pull_test_tree "the kernel only" pull_test_tree "the kernel only"
${CMD_PREFIX} ostree admin deploy --os=testos --karg=root=/dev/sda2 --karg=rootwait testos:testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree admin deploy --os=testos --karg=root=/dev/sda2 --karg=rootwait testos:testos/buildmain/x86_64-runtime
assert_file_has_content sysroot/boot/loader/entries/ostree-2-testos.conf 'rootwait' assert_file_has_content sysroot/boot/loader/entries/ostree-2-testos.conf 'rootwait'
assert_file_has_content sysroot/boot/loader/entries/ostree-2-testos.conf 'init=' assert_file_has_content sysroot/boot/loader/entries/ostree-2-testos.conf 'init='
assert_not_file_has_content sysroot/boot/loader/entries/ostree-2-testos.conf 'initrd' assert_not_file_has_content sysroot/boot/loader/entries/ostree-2-testos.conf 'initrd'
@ -70,7 +70,7 @@ do
echo "ok switching to bootdir with no initramfs layout=$layout" echo "ok switching to bootdir with no initramfs layout=$layout"
pull_test_tree "the kernel" "initramfs to assist the kernel" pull_test_tree "the kernel" "initramfs to assist the kernel"
${CMD_PREFIX} ostree admin deploy --os=testos --karg-none --karg=root=LABEL=rootfs testos:testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree admin deploy --os=testos --karg-none --karg=root=LABEL=rootfs testos:testos/buildmain/x86_64-runtime
assert_file_has_content sysroot/boot/loader/entries/ostree-2-testos.conf 'initrd' assert_file_has_content sysroot/boot/loader/entries/ostree-2-testos.conf 'initrd'
assert_file_has_content sysroot/boot/$(get_key_from_bootloader_conf sysroot/boot/loader/entries/ostree-2-testos.conf "initrd") "initramfs to assist the kernel" assert_file_has_content sysroot/boot/$(get_key_from_bootloader_conf sysroot/boot/loader/entries/ostree-2-testos.conf "initrd") "initramfs to assist the kernel"
assert_file_has_content sysroot/boot/loader/entries/ostree-2-testos.conf 'root=LABEL=rootfs' assert_file_has_content sysroot/boot/loader/entries/ostree-2-testos.conf 'root=LABEL=rootfs'
@ -80,7 +80,7 @@ do
echo "ok switching from no initramfs to initramfs enabled sysroot layout=$layout" echo "ok switching from no initramfs to initramfs enabled sysroot layout=$layout"
pull_test_tree "the kernel" "" "my .dtb file" pull_test_tree "the kernel" "" "my .dtb file"
${CMD_PREFIX} ostree admin deploy --os=testos testos:testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree admin deploy --os=testos testos:testos/buildmain/x86_64-runtime
assert_file_has_content sysroot/boot/loader/entries/ostree-2-testos.conf 'init=' assert_file_has_content sysroot/boot/loader/entries/ostree-2-testos.conf 'init='
assert_file_has_content sysroot/boot/"$(get_key_from_bootloader_conf sysroot/boot/loader/entries/ostree-2-testos.conf 'devicetree')" "my \.dtb file" assert_file_has_content sysroot/boot/"$(get_key_from_bootloader_conf sysroot/boot/loader/entries/ostree-2-testos.conf 'devicetree')" "my \.dtb file"

View File

@ -41,17 +41,17 @@ echo "a device tree" > ${devicetree_path}
mkdir -p osdata/${modulesdir}/dtb/overlays mkdir -p osdata/${modulesdir}/dtb/overlays
echo "a device tree overlay" > ${devicetree_overlay_path} echo "a device tree overlay" > ${devicetree_overlay_path}
${CMD_PREFIX} ostree --repo=testos-repo commit --tree=dir=osdata/ -b testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree --repo=testos-repo commit --tree=dir=osdata/ -b testos/buildmain/x86_64-runtime
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull-local --remote=testos testos-repo testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull-local --remote=testos testos-repo testos/buildmain/x86_64-runtime
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo remote add --set=gpg-verify=false testos file://$(pwd)/testos-repo testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo remote add --set=gpg-verify=false testos file://$(pwd)/testos-repo testos/buildmain/x86_64-runtime
${CMD_PREFIX} env OSTREE_SYSROOT_DEBUG=${OSTREE_SYSROOT_DEBUG},no-dtb ostree admin deploy --os=testos testos:testos/buildmaster/x86_64-runtime ${CMD_PREFIX} env OSTREE_SYSROOT_DEBUG=${OSTREE_SYSROOT_DEBUG},no-dtb ostree admin deploy --os=testos testos:testos/buildmain/x86_64-runtime
assert_has_file sysroot/boot/ostree/testos-${bootcsum}/vmlinuz-3.6.0 assert_has_file sysroot/boot/ostree/testos-${bootcsum}/vmlinuz-3.6.0
assert_not_has_file sysroot/boot/ostree/testos-${bootcsum}/dtb/asoc-board.dtb 'a device tree' assert_not_has_file sysroot/boot/ostree/testos-${bootcsum}/dtb/asoc-board.dtb 'a device tree'
assert_streq $(ls sysroot/boot/ostree | wc -l) 1 assert_streq $(ls sysroot/boot/ostree | wc -l) 1
assert_streq $(find sysroot/boot/ostree -name '*.dtb' | wc -l) 0 assert_streq $(find sysroot/boot/ostree -name '*.dtb' | wc -l) 0
${CMD_PREFIX} ostree --repo=testos-repo commit --tree=dir=osdata/ -b testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree --repo=testos-repo commit --tree=dir=osdata/ -b testos/buildmain/x86_64-runtime
env OSTREE_SYSROOT_DEBUG=${OSTREE_SYSROOT_DEBUG},no-dtb ${CMD_PREFIX} ostree admin upgrade --os=testos env OSTREE_SYSROOT_DEBUG=${OSTREE_SYSROOT_DEBUG},no-dtb ${CMD_PREFIX} ostree admin upgrade --os=testos
${CMD_PREFIX} ostree --repo=testos-repo commit --tree=dir=osdata/ -b testos/buildmaster/x86_64-runtime ${CMD_PREFIX} ostree --repo=testos-repo commit --tree=dir=osdata/ -b testos/buildmain/x86_64-runtime
${CMD_PREFIX} ostree admin upgrade --os=testos ${CMD_PREFIX} ostree admin upgrade --os=testos
assert_streq $(ls sysroot/boot/ostree | wc -l) 2 assert_streq $(ls sysroot/boot/ostree | wc -l) 2
# Note that the bootcsum computed by the test suite doesn't include devicetree # Note that the bootcsum computed by the test suite doesn't include devicetree

View File

@ -112,7 +112,7 @@ test_repo_finder_config_no_configs (Fixture *fixture,
g_autoptr(GPtrArray) results = NULL; /* (element-type OstreeRepoFinderResult) */ g_autoptr(GPtrArray) results = NULL; /* (element-type OstreeRepoFinderResult) */
g_autoptr(GError) error = NULL; g_autoptr(GError) error = NULL;
const OstreeCollectionRef ref1 = { "org.example.Os", "exampleos/x86_64/standard" }; const OstreeCollectionRef ref1 = { "org.example.Os", "exampleos/x86_64/standard" };
const OstreeCollectionRef ref2 = { "org.example.Os", "exampleos/x86_64/buildmaster/standard" }; const OstreeCollectionRef ref2 = { "org.example.Os", "exampleos/x86_64/buildmain/standard" };
const OstreeCollectionRef * const refs[] = { &ref1, &ref2, NULL }; const OstreeCollectionRef * const refs[] = { &ref1, &ref2, NULL };
context = g_main_context_new (); context = g_main_context_new ();

View File

@ -125,7 +125,7 @@ test_repo_finder_mount_no_mounts (Fixture *fixture,
g_autoptr(GPtrArray) results = NULL; /* (element-type OstreeRepoFinderResult) */ g_autoptr(GPtrArray) results = NULL; /* (element-type OstreeRepoFinderResult) */
g_autoptr(GError) error = NULL; g_autoptr(GError) error = NULL;
const OstreeCollectionRef ref1 = { "org.example.Collection1", "exampleos/x86_64/standard" }; const OstreeCollectionRef ref1 = { "org.example.Collection1", "exampleos/x86_64/standard" };
const OstreeCollectionRef ref2 = { "org.example.Collection1", "exampleos/x86_64/buildmaster/standard" }; const OstreeCollectionRef ref2 = { "org.example.Collection1", "exampleos/x86_64/buildmain/standard" };
const OstreeCollectionRef ref3 = { "org.example.Collection2", "exampleos/x86_64/standard" }; const OstreeCollectionRef ref3 = { "org.example.Collection2", "exampleos/x86_64/standard" };
const OstreeCollectionRef ref4 = { "org.example.Collection2", "exampleos/arm64/standard" }; const OstreeCollectionRef ref4 = { "org.example.Collection2", "exampleos/arm64/standard" };
const OstreeCollectionRef * const refs[] = { &ref1, &ref2, &ref3, &ref4, NULL }; const OstreeCollectionRef * const refs[] = { &ref1, &ref2, &ref3, &ref4, NULL };

View File

@ -53,10 +53,10 @@ test_sysroot_reload (gconstpointer data)
goto out; goto out;
g_assert (!changed); g_assert (!changed);
if (!run_sync ("ostree --repo=sysroot/ostree/repo pull-local --remote=testos testos-repo testos/buildmaster/x86_64-runtime", &error)) if (!run_sync ("ostree --repo=sysroot/ostree/repo pull-local --remote=testos testos-repo testos/buildmain/x86_64-runtime", &error))
goto out; goto out;
if (!run_sync ("ostree admin --sysroot=sysroot deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmaster/x86_64-runtime", &error)) if (!run_sync ("ostree admin --sysroot=sysroot deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmain/x86_64-runtime", &error))
goto out; goto out;
if (!ostree_sysroot_load_if_changed (sysroot, &changed, NULL, &error)) if (!ostree_sysroot_load_if_changed (sysroot, &changed, NULL, &error))

View File

@ -49,7 +49,7 @@ GLib.setenv("OSTREE_SYSROOT_DEBUG", "mutable-deployments", true);
let upstreamRepo = OSTree.Repo.new(Gio.File.new_for_path('testos-repo')); let upstreamRepo = OSTree.Repo.new(Gio.File.new_for_path('testos-repo'));
upstreamRepo.open(null); upstreamRepo.open(null);
let runtimeRef = 'testos/buildmaster/x86_64-runtime'; let runtimeRef = 'testos/buildmain/x86_64-runtime';
let [,rev] = upstreamRepo.resolve_rev(runtimeRef, false); let [,rev] = upstreamRepo.resolve_rev(runtimeRef, false);
print("testos => " + rev); print("testos => " + rev);