tests: Export OSTREE_SYSROOT in setup_os_repository
authorMatthew Barnes <mbarnes@redhat.com>
Tue, 14 Jul 2015 17:30:05 +0000 (13:30 -0400)
committerMatthew Barnes <mbarnes@redhat.com>
Thu, 16 Jul 2015 16:49:34 +0000 (12:49 -0400)
Eliminates the need for constantly passing --sysroot=sysroot, but
also makes ostree place remote configs for sysroot/ostree/repo in
sysroot/etc/ostree/remotes.d where they should have been all along.

13 files changed:
tests/admin-test.sh
tests/libtest.sh
tests/test-admin-deploy-2.sh
tests/test-admin-deploy-etcmerge-cornercases.sh
tests/test-admin-deploy-grub2.sh
tests/test-admin-deploy-karg.sh
tests/test-admin-deploy-switch.sh
tests/test-admin-deploy-syslinux.sh
tests/test-admin-deploy-uboot.sh
tests/test-admin-instutil-set-kargs.sh
tests/test-admin-locking.sh
tests/test-admin-upgrade-not-backwards.sh
tests/test-admin-upgrade-unconfigured.sh

index f7fbb923a84028f0cb77f6f773263d5f51c7a88e..ca1ac2ce21fe7a9df63d22619b19d2c939584a2d 100755 (executable)
@@ -31,13 +31,13 @@ ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull-local --remote=testos testo
 rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime)
 export rev
 # This initial deployment gets kicked off with some kernel arguments 
-${CMD_PREFIX} ostree admin --sysroot=sysroot deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmaster/x86_64-runtime
-${CMD_PREFIX} ostree admin --sysroot=sysroot status | tee status.txt
+${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmaster/x86_64-runtime
+${CMD_PREFIX} ostree admin status | tee status.txt
 validate_bootloader
 
 echo "ok deploy command"
 
-${CMD_PREFIX} ostree admin --sysroot=sysroot --print-current-dir > curdir
+${CMD_PREFIX} ostree admin --print-current-dir > curdir
 assert_file_has_content curdir ^`pwd`/sysroot/ostree/deploy/testos/deploy/${rev}.0$
 
 echo "ok --print-current-dir"
@@ -51,12 +51,12 @@ assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'option
 assert_file_has_content sysroot/boot/ostree/testos-${bootcsum}/vmlinuz-3.6.0 'a kernel'
 assert_file_has_content sysroot/ostree/deploy/testos/deploy/${rev}.0/etc/os-release 'NAME=TestOS'
 assert_file_has_content sysroot/ostree/boot.1/testos/${bootcsum}/0/etc/os-release 'NAME=TestOS'
-${CMD_PREFIX} ostree admin --sysroot=sysroot status
+${CMD_PREFIX} ostree admin status
 
 
 echo "ok layout"
 
-${CMD_PREFIX} ostree admin --sysroot=sysroot deploy --os=testos testos:testos/buildmaster/x86_64-runtime
+${CMD_PREFIX} ostree admin deploy --os=testos testos:testos/buildmaster/x86_64-runtime
 # Need a new bootversion, sine we now have two deployments
 assert_has_dir sysroot/boot/loader.0
 assert_not_has_dir sysroot/boot/loader.1
@@ -68,45 +68,45 @@ assert_not_has_dir sysroot/ostree/boot.1.1
 assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'options.* root=LABEL=MOO'
 assert_file_has_content sysroot/ostree/deploy/testos/deploy/${rev}.1/etc/os-release 'NAME=TestOS'
 assert_file_has_content sysroot/ostree/boot.0/testos/${bootcsum}/0/etc/os-release 'NAME=TestOS'
-${CMD_PREFIX} ostree admin --sysroot=sysroot status
+${CMD_PREFIX} ostree admin status
 validate_bootloader
 
 echo "ok second deploy"
 
-${CMD_PREFIX} ostree admin --sysroot=sysroot deploy --os=testos testos:testos/buildmaster/x86_64-runtime
+${CMD_PREFIX} ostree admin deploy --os=testos testos:testos/buildmaster/x86_64-runtime
 # Keep the same bootversion
 assert_has_dir sysroot/boot/loader.0
 assert_not_has_dir sysroot/boot/loader.1
 # But swap subbootversion
 assert_has_dir sysroot/ostree/boot.0.0
 assert_not_has_dir sysroot/ostree/boot.0.1
-${CMD_PREFIX} ostree admin --sysroot=sysroot status
+${CMD_PREFIX} ostree admin status
 validate_bootloader
 
 echo "ok third deploy (swap)"
 
-${CMD_PREFIX} ostree admin --sysroot=sysroot os-init otheros
+${CMD_PREFIX} ostree admin os-init otheros
 
-${CMD_PREFIX} ostree admin --sysroot=sysroot deploy --os=otheros testos/buildmaster/x86_64-runtime
+${CMD_PREFIX} ostree admin deploy --os=otheros testos/buildmaster/x86_64-runtime
 assert_not_has_dir sysroot/boot/loader.0
 assert_has_dir sysroot/boot/loader.1
 assert_has_file sysroot/boot/loader/entries/ostree-testos-1.conf
 assert_has_file sysroot/boot/loader/entries/ostree-otheros-0.conf
 assert_file_has_content sysroot/ostree/deploy/testos/deploy/${rev}.1/etc/os-release 'NAME=TestOS'
 assert_file_has_content sysroot/ostree/deploy/otheros/deploy/${rev}.0/etc/os-release 'NAME=TestOS'
-${CMD_PREFIX} ostree admin --sysroot=sysroot status
+${CMD_PREFIX} ostree admin status
 validate_bootloader
 
 echo "ok independent deploy"
 
-${CMD_PREFIX} ostree admin --sysroot=sysroot deploy --retain --os=testos testos:testos/buildmaster/x86_64-runtime
+${CMD_PREFIX} ostree admin deploy --retain --os=testos testos:testos/buildmaster/x86_64-runtime
 assert_has_dir sysroot/boot/loader.0
 assert_not_has_dir sysroot/boot/loader.1
 assert_has_file sysroot/boot/loader/entries/ostree-testos-0.conf
 assert_file_has_content sysroot/ostree/deploy/testos/deploy/${rev}.2/etc/os-release 'NAME=TestOS'
 assert_has_file sysroot/boot/loader/entries/ostree-testos-2.conf
 assert_file_has_content sysroot/ostree/deploy/testos/deploy/${rev}.3/etc/os-release 'NAME=TestOS'
-${CMD_PREFIX} ostree admin --sysroot=sysroot status
+${CMD_PREFIX} ostree admin status
 validate_bootloader
 
 echo "ok fourth deploy (retain)"
@@ -115,14 +115,14 @@ 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 sysroot/ostree/deploy/testos/deploy/${rev}.3/etc/aconfigfile
 ln -s /ENOENT sysroot/ostree/deploy/testos/deploy/${rev}.3/etc/a-new-broken-symlink
-${CMD_PREFIX} ostree admin --sysroot=sysroot deploy --retain --os=testos testos:testos/buildmaster/x86_64-runtime
+${CMD_PREFIX} ostree admin deploy --retain --os=testos testos:testos/buildmaster/x86_64-runtime
 linktarget=$(readlink sysroot/ostree/deploy/testos/deploy/${rev}.4/etc/a-new-broken-symlink)
 test "${linktarget}" = /ENOENT
 assert_file_has_content sysroot/ostree/deploy/testos/deploy/${rev}.3/etc/os-release 'NAME=TestOS'
 assert_file_has_content sysroot/ostree/deploy/testos/deploy/${rev}.4/etc/os-release 'NAME=TestOS'
 assert_file_has_content sysroot/ostree/deploy/testos/deploy/${rev}.4/etc/a-new-config-file 'a new local config file'
 assert_not_has_file sysroot/ostree/deploy/testos/deploy/${rev}.4/etc/aconfigfile
-${CMD_PREFIX} ostree admin --sysroot=sysroot status
+${CMD_PREFIX} ostree admin status
 validate_bootloader
 
 echo "ok deploy with modified /etc"
@@ -133,34 +133,34 @@ newrev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos:testos
 export newrev
 assert_not_streq ${rev} ${newrev}
 
-${CMD_PREFIX} ostree admin --sysroot=sysroot deploy --os=testos testos:testos/buildmaster/x86_64-runtime
+${CMD_PREFIX} ostree admin deploy --os=testos testos:testos/buildmaster/x86_64-runtime
 assert_file_has_content sysroot/ostree/deploy/testos/deploy/${newrev}.0/etc/os-release 'NAME=TestOS'
 # 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/new-default-dir/moo "a new default dir and file"
 # And persist /etc changes from before
 assert_not_has_file sysroot/ostree/deploy/testos/deploy/${rev}.3/etc/aconfigfile
-${CMD_PREFIX} ostree admin --sysroot=sysroot status
+${CMD_PREFIX} ostree admin status
 validate_bootloader
 
 echo "ok upgrade bare"
 
 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 admin --sysroot=sysroot upgrade --os=testos
+${CMD_PREFIX} ostree admin upgrade --os=testos
 origrev=${rev}
 rev=${newrev}
 newrev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime)
 assert_not_streq ${rev} ${newrev}
 assert_file_has_content sysroot/ostree/deploy/testos/deploy/${newrev}.0/etc/os-release 'NAME=TestOS'
-${CMD_PREFIX} ostree admin --sysroot=sysroot status
+${CMD_PREFIX} ostree admin status
 validate_bootloader
 
 echo "ok upgrade"
 
-originfile=$(${CMD_PREFIX} ostree admin --sysroot=sysroot --print-current-dir).origin
+originfile=$(${CMD_PREFIX} ostree admin --print-current-dir).origin
 cp ${originfile} saved-origin
-${CMD_PREFIX} ostree admin --sysroot=sysroot 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"
 ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo remote list -u > remotes.txt
 assert_file_has_content remotes.txt 'bacon.*http://tasty.com'
@@ -171,24 +171,24 @@ echo "ok set-origin"
 
 assert_file_has_content sysroot/ostree/deploy/testos/deploy/${rev}.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 --sysroot=sysroot undeploy 1
+${CMD_PREFIX} ostree admin undeploy 1
 assert_file_has_content sysroot/ostree/deploy/testos/deploy/${newrev}.0/etc/os-release 'NAME=TestOS'
 assert_not_has_dir sysroot/ostree/deploy/testos/deploy/${rev}.0
 
-${CMD_PREFIX} ostree admin --sysroot=sysroot undeploy 0
+${CMD_PREFIX} ostree admin undeploy 0
 assert_not_has_dir sysroot/ostree/deploy/testos/deploy/${newrev}.0
-${CMD_PREFIX} ostree admin --sysroot=sysroot status
+${CMD_PREFIX} ostree admin status
 validate_bootloader
 
 echo "ok undeploy"
 
-if ${CMD_PREFIX} ostree admin --sysroot=sysroot deploy --os=unknown testos:testos/buildmaster/x86_64-runtime; then
+if ${CMD_PREFIX} ostree admin deploy --os=unknown testos:testos/buildmaster/x86_64-runtime; then
     assert_not_reached "Unexpected successful deploy of unknown OS"
 fi
 echo "ok deploy with unknown OS"
 
-${CMD_PREFIX} ostree admin --sysroot=sysroot deploy --os=testos --karg-append=console=/dev/foo --karg-append=console=/dev/bar testos:testos/buildmaster/x86_64-runtime
-${CMD_PREFIX} ostree admin --sysroot=sysroot deploy --os=testos 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/buildmaster/x86_64-runtime
+${CMD_PREFIX} ostree admin deploy --os=testos testos:testos/buildmaster/x86_64-runtime
 assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'console=/dev/foo.*console=/dev/bar'
 validate_bootloader
 
@@ -196,7 +196,7 @@ echo "ok deploy with multiple kernel args"
 
 origrev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime)
 os_repository_new_commit 0 "test upgrade multiple kernel args"
-${CMD_PREFIX} ostree admin --sysroot=sysroot 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)
 assert_not_streq ${origrev} ${newrev}
 assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'console=/dev/foo.*console=/dev/bar'
index b788bc979cad3143f802c3742997f620976af2c0..885c64038cc33c37c6d9e0cb9c833a076c8557b4 100644 (file)
@@ -255,8 +255,9 @@ EOF
 
     cd ${test_tmpdir}
     mkdir sysroot
-    ${CMD_PREFIX} ostree admin --sysroot=sysroot init-fs sysroot
-    ${CMD_PREFIX} ostree admin --sysroot=sysroot os-init testos
+    export OSTREE_SYSROOT=sysroot
+    ${CMD_PREFIX} ostree admin init-fs sysroot
+    ${CMD_PREFIX} ostree admin os-init testos
 
     case $bootmode in
         "syslinux")
index baefc6e1692bb5fa4a0e979c6c4f3411257d24c6..db77f6f687597eab10feaa29b4e81ae4d11e9e68 100755 (executable)
@@ -23,6 +23,7 @@ set -e
 
 echo "1..1"
 
+# Exports OSTREE_SYSROOT so --sysroot not needed.
 setup_os_repository "archive-z2" "syslinux"
 
 echo "ok setup"
@@ -33,7 +34,7 @@ ostree --repo=sysroot/ostree/repo pull-local --remote=testos testos-repo testos/
 rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime)
 export rev
 # This initial deployment gets kicked off with some kernel arguments 
-ostree admin --sysroot=sysroot deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmaster/x86_64-runtime
+ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmaster/x86_64-runtime
 assert_has_dir sysroot/boot/ostree/testos-${bootcsum}
 
 echo "ok deploy command"
@@ -42,11 +43,11 @@ echo "ok deploy command"
 bootcsum1=${bootcsum}
 os_repository_new_commit
 ostree --repo=sysroot/ostree/repo remote add --set=gpg-verify=false testos file://$(pwd)/testos-repo testos/buildmaster/x86_64-runtime
-ostree admin --sysroot=sysroot upgrade --os=testos
+ostree admin upgrade --os=testos
 bootcsum2=${bootcsum}
 os_repository_new_commit "1"
 bootcsum3=${bootcsum}
-ostree admin --sysroot=sysroot upgrade --os=testos
+ostree admin upgrade --os=testos
 
 rev=${newrev}
 newrev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime)
@@ -60,7 +61,7 @@ assert_file_has_content sysroot/ostree/deploy/testos/deploy/${newrev}.0/etc/os-r
 
 echo "ok deploy and GC /boot"
 
-ostree admin --sysroot=sysroot cleanup
+ostree admin cleanup
 assert_has_dir sysroot/boot/ostree/testos-${bootcsum}
 assert_file_has_content sysroot/ostree/deploy/testos/deploy/${newrev}.0/etc/os-release 'NAME=TestOS'
 
index 2480ee9855084e78f74d494c4c14c71f2a942037..0541a670d7d8dee2001914aee59e186b28f2aaea 100644 (file)
@@ -23,6 +23,7 @@ set -e
 
 echo "1..1"
 
+# Exports OSTREE_SYSROOT so --sysroot not needed.
 setup_os_repository "archive-z2" "syslinux"
 
 echo "ok setup"
@@ -34,7 +35,7 @@ rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmast
 export rev
 echo "rev=${rev}"
 # This initial deployment gets kicked off with some kernel arguments 
-${CMD_PREFIX} ostree admin --sysroot=sysroot 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/buildmaster/x86_64-runtime
 assert_has_dir sysroot/boot/ostree/testos-${bootcsum}
 
 etc=sysroot/ostree/deploy/testos/deploy/${rev}.0/etc
@@ -60,7 +61,7 @@ rm ${etc}/testdirectory -rf
 # Now deploy a 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 admin --sysroot=sysroot 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)
 echo "newrev=${newrev}"
 newroot=sysroot/ostree/deploy/testos/deploy/${newrev}.0
@@ -99,7 +100,7 @@ ${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo commit -b testos/buildmas
 cd ${test_tmpdir}
 
 # Upgrade, check that we have it
-${CMD_PREFIX} ostree admin --sysroot=sysroot 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)
 assert_has_dir sysroot/ostree/deploy/testos/deploy/$rev.0/etc/initially-empty
 
@@ -110,7 +111,7 @@ ${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo commit -b testos/buildmas
 
 # Upgrade, check that we have the two new files
 cd ${test_tmpdir}
-${CMD_PREFIX} ostree admin --sysroot=sysroot 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)
 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
@@ -123,7 +124,7 @@ cd ${test_tmpdir}
 rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime)
 newconfpath=sysroot/ostree/deploy/testos/deploy/${rev}.0/etc/somenewdir
 echo "some content blah" > ${newconfpath}
-if ${CMD_PREFIX} ostree admin --sysroot=sysroot upgrade --os=testos 2>err.txt; then
+if ${CMD_PREFIX} ostree admin upgrade --os=testos 2>err.txt; then
     assert_not_reached "upgrade should have failed"
 fi
 assert_file_has_content err.txt "Modified config file newly defaults to directory"
@@ -136,7 +137,7 @@ ${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo commit -b testos/buildmas
 cd ${test_tmpdir}
 newconfpath=sysroot/ostree/deploy/testos/deploy/${rev}.0/etc/initially-empty/mynewfile
 touch ${newconfpath}
-${CMD_PREFIX} ostree admin --sysroot=sysroot 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)
 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
index d07a263aa19cfa14316aacfbb0bf97c27c9a9b5e..94c4bc03da71279a4992163ce865ce5213253110 100755 (executable)
@@ -23,6 +23,7 @@ set -e
 
 echo "1..1"
 
+# Exports OSTREE_SYSROOT so --sysroot not needed.
 setup_os_repository "archive-z2" "grub2"
 
 echo "ok setup"
index ec4819852af24065790d0c9966f23472449707f1..01e72f05f52575f4852c57b97edbdf10824f2024 100644 (file)
@@ -23,6 +23,7 @@ set -e
 
 echo "1..1"
 
+# Exports OSTREE_SYSROOT so --sysroot not needed.
 setup_os_repository "archive-z2" "syslinux"
 
 echo "ok setup"
@@ -33,19 +34,19 @@ ostree --repo=sysroot/ostree/repo pull-local --remote=testos testos-repo testos/
 rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime)
 export rev
 # This initial deployment gets kicked off with some kernel arguments 
-ostree admin --sysroot=sysroot deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmaster/x86_64-runtime
-ostree admin --sysroot=sysroot deploy --karg=FOO=BAR --os=testos testos:testos/buildmaster/x86_64-runtime
-ostree admin --sysroot=sysroot deploy --karg=TESTARG=TESTVALUE --os=testos testos:testos/buildmaster/x86_64-runtime
+ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmaster/x86_64-runtime
+ostree admin deploy --karg=FOO=BAR --os=testos testos:testos/buildmaster/x86_64-runtime
+ostree admin deploy --karg=TESTARG=TESTVALUE --os=testos testos:testos/buildmaster/x86_64-runtime
 assert_file_has_content sysroot/boot/loader/entries/ostree-testos-1.conf 'options.*FOO=BAR'
 assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'options.*FOO=BAR'
 assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'options.*TESTARG=TESTVALUE'
-ostree admin --sysroot=sysroot deploy --karg=ANOTHERARG=ANOTHERVALUE --os=testos testos:testos/buildmaster/x86_64-runtime
+ostree admin deploy --karg=ANOTHERARG=ANOTHERVALUE --os=testos testos:testos/buildmaster/x86_64-runtime
 assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'options.*TESTARG=TESTVALUE'
 assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'options.*ANOTHERARG=ANOTHERVALUE'
 
 echo "ok deploy with --karg, but same config"
 
-ostree admin --sysroot=sysroot deploy --karg-proc-cmdline --os=testos testos:testos/buildmaster/x86_64-runtime
+ostree admin deploy --karg-proc-cmdline --os=testos testos:testos/buildmaster/x86_64-runtime
 # Here we're asserting that the *host* system has a root= kernel
 # argument.  I think it's unlikely that anyone doesn't have one, but
 # if this is not true for you, please file a bug!
@@ -53,10 +54,10 @@ assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'option
 
 echo "ok deploy --karg-proc-cmdline"
 
-ostree admin --sysroot=sysroot status
-ostree admin --sysroot=sysroot undeploy 0
+ostree admin status
+ostree admin undeploy 0
 
-ostree admin --sysroot=sysroot deploy  --os=testos --karg-append=APPENDARG=VALAPPEND --karg-append=APPENDARG=2NDAPPEND testos:testos/buildmaster/x86_64-runtime
+ostree admin deploy  --os=testos --karg-append=APPENDARG=VALAPPEND --karg-append=APPENDARG=2NDAPPEND testos:testos/buildmaster/x86_64-runtime
 assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'options.*FOO=BAR'
 assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'options.*TESTARG=TESTVALUE'
 assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'options.*APPENDARG=VALAPPEND .*APPENDARG=2NDAPPEND'
index db4b921dd4cc2b4fe526756f8c9af8599f6dd7fe..7e1e173aa86361dcfae7969356b0c26fbcace0f3 100755 (executable)
@@ -23,6 +23,7 @@ set -e
 
 echo "1..1"
 
+# Exports OSTREE_SYSROOT so --sysroot not needed.
 setup_os_repository "archive-z2" "syslinux"
 
 echo "ok setup"
@@ -31,28 +32,28 @@ echo "1..3"
 
 ${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 admin --sysroot=sysroot 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/buildmaster/x86_64-runtime
 newrev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos:testos/buildmaster/x86_64-runtime)
 assert_not_has_file sysroot/ostree/deploy/testos/deploy/$newrev.0/usr/include/foo.h
-if ${CMD_PREFIX} ostree admin --sysroot=sysroot switch --os=testos testos/buildmaster/x86_64-runtime; then
+if ${CMD_PREFIX} ostree admin switch --os=testos testos/buildmaster/x86_64-runtime; then
     assert_not_reached "Switch to same ref unexpectedly succeeded"
 fi
 echo "ok switch expected error"
 
-${CMD_PREFIX} ostree admin --sysroot=sysroot switch --os=testos testos/buildmaster/x86_64-devel
+${CMD_PREFIX} ostree admin switch --os=testos testos/buildmaster/x86_64-devel
 newrev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos:testos/buildmaster/x86_64-devel)
 assert_file_has_content sysroot/ostree/deploy/testos/deploy/$newrev.0/usr/include/foo.h 'header'
 
 echo "ok switch"
 
 ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo remote add --set=gpg-verify=false anothertestos file://$(pwd)/testos-repo
-${CMD_PREFIX} ostree admin --sysroot=sysroot switch --os=testos anothertestos:testos/buildmaster/x86_64-devel
+${CMD_PREFIX} ostree admin switch --os=testos anothertestos:testos/buildmaster/x86_64-devel
 # Ok this is lame, need a better shell command to extract config, or switch to gjs
-${CMD_PREFIX} ostree admin --sysroot=sysroot status > status.txt
+${CMD_PREFIX} ostree admin status > status.txt
 assert_file_has_content status.txt anothertestos
 
 echo "ok switch remotes"
 
-${CMD_PREFIX} ostree admin --sysroot=sysroot switch --os=testos testos:
+${CMD_PREFIX} ostree admin switch --os=testos testos:
 
 echo "ok switch remote only"
index 76161bc0f675147ca1837446f013549637a4e5be..97ee32df190ead6a0c3f09ecae5a00ac86015866 100755 (executable)
@@ -23,6 +23,7 @@ set -e
 
 echo "1..1"
 
+# Exports OSTREE_SYSROOT so --sysroot not needed.
 setup_os_repository "archive-z2" "syslinux"
 
 echo "ok setup"
index 11dee585ef077a0d89be99d036ab7322b4d1b7fe..219db14b547dd743b3a0dafd5eb24a2ac422bc48 100755 (executable)
@@ -24,6 +24,7 @@ set -e
 
 echo "1..1"
 
+# Exports OSTREE_SYSROOT so --sysroot not needed.
 setup_os_repository "archive-z2" "uboot"
 
 echo "ok setup"
index 2bd10b64775f1749ce03c2e56328634aa8a1a7ad..b108bd3cd5c7fdf5f439806c6fafb2cf177f8662 100644 (file)
@@ -24,6 +24,7 @@ set -e
 
 echo "1..1"
 
+# Exports OSTREE_SYSROOT so --sysroot not needed.
 setup_os_repository "archive-z2" "syslinux"
 
 echo "ok setup"
@@ -31,32 +32,32 @@ echo "ok setup"
 echo "1..5"
 
 ostree --repo=sysroot/ostree/repo pull-local --remote=testos testos-repo testos/buildmaster/x86_64-runtime
-ostree admin --sysroot=sysroot deploy --os=testos testos:testos/buildmaster/x86_64-runtime
+ostree admin deploy --os=testos testos:testos/buildmaster/x86_64-runtime
 
-ostree admin --sysroot=sysroot instutil set-kargs FOO=BAR
-ostree admin --sysroot=sysroot instutil set-kargs FOO=BAZ FOO=BIF TESTARG=TESTVALUE
+ostree admin instutil set-kargs FOO=BAR
+ostree admin instutil set-kargs FOO=BAZ FOO=BIF TESTARG=TESTVALUE
 assert_not_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'options.*FOO=BAR'
 assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'options.*FOO=BAZ .*FOO=BIF'
 assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'options.*TESTARG=TESTVALUE'
 echo "ok instutil set-kargs (basic)"
 
-ostree admin --sysroot=sysroot instutil set-kargs --merge FOO=BAR
+ostree admin instutil set-kargs --merge FOO=BAR
 assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'options.*FOO=BAZ .*FOO=BIF .*FOO=BAR'
 assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'options.*TESTARG=TESTVALUE'
 echo "ok instutil set-kargs --merge"
 
-ostree admin --sysroot=sysroot instutil set-kargs --merge --replace=FOO=XXX
+ostree admin instutil set-kargs --merge --replace=FOO=XXX
 assert_not_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'options.*FOO=BAR'
 assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'options.*FOO=XXX'
 assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'options.*TESTARG=TESTVALUE'
 echo "ok instutil set-kargs --replace"
 
-ostree admin --sysroot=sysroot instutil set-kargs --merge --append=FOO=BAR --append=APPENDARG=VALAPPEND --append=APPENDARG=2NDAPPEND testos:testos/buildmaster/x86_64-runtime
+ostree admin instutil set-kargs --merge --append=FOO=BAR --append=APPENDARG=VALAPPEND --append=APPENDARG=2NDAPPEND testos:testos/buildmaster/x86_64-runtime
 assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'options.*FOO=XXX.*FOO=BAR'
 assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'options.*APPENDARG=VALAPPEND .*APPENDARG=2NDAPPEND'
 echo "ok instutil set-kargs --append"
 
-ostree admin --sysroot=sysroot instutil set-kargs --import-proc-cmdline
+ostree admin instutil set-kargs --import-proc-cmdline
 # Here we're asserting that the *host* system has a root= kernel
 # argument.  I think it's unlikely that anyone doesn't have one, but
 # if this is not true for you, please file a bug!
index e416fe7896a574b8c0e5ba973c0a489c0625b18a..b82fd5c3a5ef56da907820103c5dec34d7b0de4e 100644 (file)
@@ -23,6 +23,7 @@ set -e
 
 echo "1..1"
 
+# Exports OSTREE_SYSROOT so --sysroot not needed.
 setup_os_repository "archive-z2" "syslinux"
 
 echo "ok setup"
@@ -36,7 +37,7 @@ rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmast
 export rev
 echo "rev=${rev}"
 # This initial deployment gets kicked off with some kernel arguments 
-${CMD_PREFIX} ostree admin --sysroot=sysroot 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/buildmaster/x86_64-runtime
 assert_has_dir sysroot/boot/ostree/testos-${bootcsum}
 
 parallel_cmd=parallel
@@ -45,9 +46,9 @@ if parallel --help | grep -q -e --no-notice; then
 fi
 
 count=$(($(getconf _NPROCESSORS_ONLN) * 2))
-seq "${count}" | ${parallel_cmd} -n0 ${CMD_PREFIX} ostree admin --sysroot=sysroot 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/buildmaster/x86_64-runtime
 
-${CMD_PREFIX} ostree admin --sysroot=sysroot status > status.txt
+${CMD_PREFIX} ostree admin status > status.txt
 grep "testos ${rev}" status.txt | wc -l > status-matches.txt
 assert_file_has_content status-matches.txt $((${count} + 1))
 
index 0114e787de6adffb07ca2550c75dfb3678c10093..c42dc242ef07af792a9e92d658a7229cfa558703 100644 (file)
@@ -23,6 +23,7 @@ set -e
 
 echo "1..1"
 
+# Exports OSTREE_SYSROOT so --sysroot not needed.
 setup_os_repository "archive-z2" "syslinux"
 
 echo "ok setup"
@@ -36,22 +37,22 @@ rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmast
 export rev
 echo "rev=${rev}"
 # This initial deployment gets kicked off with some kernel arguments 
-${CMD_PREFIX} ostree admin --sysroot=sysroot 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/buildmaster/x86_64-runtime
 assert_has_dir sysroot/boot/ostree/testos-${bootcsum}
 
 # This should be a no-op
-${CMD_PREFIX} ostree admin --sysroot=sysroot upgrade --os=testos
+${CMD_PREFIX} ostree admin upgrade --os=testos
 
 # Now reset to an older revision
 ${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo reset testos/buildmaster/x86_64-runtime{,^}
 
-if ${CMD_PREFIX} ostree admin --sysroot=sysroot upgrade --os=testos 2>upgrade-err.txt; then
+if ${CMD_PREFIX} ostree admin upgrade --os=testos 2>upgrade-err.txt; then
     assert_not_reached 'upgrade unexpectedly succeeded'
 fi
 assert_file_has_content upgrade-err.txt 'chronologically older'
 
 echo 'ok upgrade will not go backwards'
 
-${CMD_PREFIX} ostree admin --sysroot=sysroot upgrade --os=testos --allow-downgrade
+${CMD_PREFIX} ostree admin upgrade --os=testos --allow-downgrade
 
 echo 'ok upgrade backwards'
index b7f6b6cef7d16daaea5b1c553ae8be468aefd53f..cbc1e753d2c3c873d0e33d53a37625a7165ec639 100644 (file)
@@ -23,6 +23,7 @@ set -e
 
 echo "1..1"
 
+# Exports OSTREE_SYSROOT so --sysroot not needed.
 setup_os_repository "archive-z2" "syslinux"
 
 echo "ok setup"
@@ -34,11 +35,11 @@ rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmast
 export rev
 echo "rev=${rev}"
 # This initial deployment gets kicked off with some kernel arguments 
-${CMD_PREFIX} ostree admin --sysroot=sysroot 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/buildmaster/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
 
 ${CMD_PREFIX} ostree --repo=sysroot/ostree/repo remote add --set=gpg-verify=false testos file://$(pwd)/testos-repo testos/buildmaster/x86_64-runtime
-if ${CMD_PREFIX} ostree admin --sysroot=sysroot 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"
 fi
 assert_file_has_content err.txt "Use.*subscription.*online"
@@ -46,6 +47,6 @@ assert_file_has_content err.txt "Use.*subscription.*online"
 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 admin --sysroot=sysroot switch --os=testos otheros:testos/buildmaster/x86_64-runtime
+${CMD_PREFIX} ostree admin switch --os=testos otheros:testos/buildmaster/x86_64-runtime
 
 echo "ok switch"