[ostree/wip/libsysroot: 9/9] WIP: more sysroot testing
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ostree/wip/libsysroot: 9/9] WIP: more sysroot testing
- Date: Thu, 3 Oct 2013 23:25:12 +0000 (UTC)
commit c3cf572a6ba800404494a6e40cd05a0e3abb4ccb
Author: Colin Walters <walters verbum org>
Date: Thu Oct 3 19:24:09 2013 -0400
WIP: more sysroot testing
tests/libtest.sh | 6 ++++++
tests/test-sysroot.js | 29 ++++++++++++++++++++++++++---
2 files changed, 32 insertions(+), 3 deletions(-)
---
diff --git a/tests/libtest.sh b/tests/libtest.sh
index a365058..8f78bd7 100644
--- a/tests/libtest.sh
+++ b/tests/libtest.sh
@@ -244,10 +244,14 @@ EOF
os_repository_new_commit ()
{
boot_checksum_iteration=$1
+ content_iteration=$2
echo "BOOT ITERATION: $boot_checksum_iteration"
if test -z "$boot_checksum_iteration"; then
boot_checksum_iteration=0
fi
+ if test -z "$content_iteration"; then
+ content_iteration=0
+ fi
cd ${test_tmpdir}/osdata
rm boot/*
echo "new: a kernel ${boot_checksum_iteration}" > boot/vmlinuz-3.6.0
@@ -261,6 +265,8 @@ os_repository_new_commit ()
mkdir -p usr/etc/new-default-dir
echo "a new default dir and file" > usr/etc/new-default-dir/moo
+ echo "content iteration $content_iteration" > usr/bin/content-iteration
+
ostree --repo=${test_tmpdir}/testos-repo commit -b testos/buildmaster/x86_64-runtime -s "Build"
cd ${test_tmpdir}
}
diff --git a/tests/test-sysroot.js b/tests/test-sysroot.js
index 95a3388..a493cb2 100644
--- a/tests/test-sysroot.js
+++ b/tests/test-sysroot.js
@@ -89,9 +89,13 @@ assertEquals(deployments[0].get_csum(), deployment.get_csum());
let deploymentPath = sysroot.get_deployment_directory(deployment);
assertEquals(deploymentPath.query_exists(null), true);
+print("OK one deployment");
+
/// TEST: We can delete the deployment, going back to empty
sysroot.write_deployments([], null);
+print("OK empty deployments");
+
assertEquals(deploymentPath.query_exists(null), false);
//// Ok, redeploy, then add a new revision upstream and pull it
@@ -109,17 +113,18 @@ libtestExec('os_repository_new_commit');
sysrootRepo.pull('testos', null, 0, null);
-let newRuntimeRef = 'testos/buildmaster/x86_64-runtime';
-let [,newRev] = upstreamRepo.resolve_rev(newRuntimeRef, false);
+let [,newRev] = upstreamRepo.resolve_rev(runtimeRef, false);
print("testos => " + newRev);
assertNotEquals(rev, newRev);
mergeDeployment = sysroot.get_merge_deployment('testos');
-let [,newDeployment] = sysroot.deploy_one_tree('testos', rev, origin,
+let [,newDeployment] = sysroot.deploy_one_tree('testos', newRev, origin,
null, mergeDeployment,
null);
newDeployments = [mergeDeployment, newDeployment];
+assertNotEquals(mergeDeployment.get_bootcsum(), newDeployment.get_bootcsum());
+assertNotEquals(mergeDeployment.get_csum(), newDeployment.get_csum());
sysroot.write_deployments(newDeployments, null);
deployments = sysroot.get_deployments();
assertEquals(deployments.length, 2);
@@ -127,3 +132,21 @@ assertEquals(deploymentPath.query_exists(null), true);
let newDeploymentPath = sysroot.get_deployment_directory(newDeployment);
assertEquals(newDeploymentPath.query_exists(null), true);
+print("OK two deployments");
+
+libtestExec('os_repository_new_commit 0 1');
+
+sysrootRepo.pull('testos', null, 0, null);
+
+let [,thirdRev] = upstreamRepo.resolve_rev(runtimeRef, false);
+
+mergeDeployment = sysroot.get_merge_deployment('testos');
+let [,thirdDeployment] = sysroot.deploy_one_tree('testos', thirdRev, origin,
+ null, mergeDeployment,
+ null);
+assertEquals(mergeDeployment.get_bootcsum(), thirdDeployment.get_bootcsum());
+assertNotEquals(mergeDeployment.get_csum(), newDeployment.get_csum());
+newDeployments = [deployment, newDeployment, thirdDeployment];
+sysroot.write_deployments(newDeployments, null);
+deployments = sysroot.get_deployments();
+assertEquals(deployments.length, 3);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]