Tests should commit befoe syncing to remote stores

Now that the repository clearly delinates between staged and
committed metadata, we need to make sure that tests commit
the repository before we copy local test data to the remote
repository.

Change-Id: Iae74b949df69ae5dbc63e018a5e69210c3da51b3
diff --git a/client/client_test.go b/client/client_test.go
index 1e6569d..c6d4c13 100644
--- a/client/client_test.go
+++ b/client/client_test.go
@@ -236,6 +236,9 @@
 
 func (s *ClientSuite) TestInitRootExpired(c *C) {
 	s.genKeyExpired(c, "targets")
+	c.Assert(s.repo.Snapshot(tuf.CompressionTypeNone), IsNil)
+	c.Assert(s.repo.Timestamp(), IsNil)
+	c.Assert(s.repo.Commit(), IsNil)
 	s.syncRemote(c)
 	client := NewClient(MemoryLocalStore(), s.remote)
 	s.withMetaExpired(func() {
@@ -315,6 +318,7 @@
 	c.Assert(s.repo.Sign("targets.json"), IsNil)
 	c.Assert(s.repo.Snapshot(tuf.CompressionTypeNone), IsNil)
 	c.Assert(s.repo.Timestamp(), IsNil)
+	c.Assert(s.repo.Commit(), IsNil)
 	s.syncRemote(c)
 
 	// check update gets new root version
@@ -378,6 +382,7 @@
 	// generate new snapshot (because root has changed) and timestamp
 	c.Assert(s.repo.Snapshot(tuf.CompressionTypeNone), IsNil)
 	c.Assert(s.repo.Timestamp(), IsNil)
+	c.Assert(s.repo.Commit(), IsNil)
 	s.syncRemote(c)
 
 	// check update gets new root and timestamp
@@ -414,6 +419,7 @@
 	// generate new snapshot and timestamp
 	c.Assert(s.repo.Snapshot(tuf.CompressionTypeNone), IsNil)
 	c.Assert(s.repo.Timestamp(), IsNil)
+	c.Assert(s.repo.Commit(), IsNil)
 	s.syncRemote(c)
 
 	// check update gets new root, snapshot and timestamp
@@ -453,6 +459,7 @@
 	c.Assert(s.repo.Sign("targets.json"), IsNil)
 	c.Assert(s.repo.Snapshot(tuf.CompressionTypeNone), IsNil)
 	c.Assert(s.repo.Timestamp(), IsNil)
+	c.Assert(s.repo.Commit(), IsNil)
 	s.syncRemote(c)
 
 	// check update gets new metadata
@@ -590,6 +597,7 @@
 	c.Assert(s.repo.RemoveTarget("bar.txt"), IsNil)
 	c.Assert(s.repo.Snapshot(tuf.CompressionTypeNone), IsNil)
 	c.Assert(s.repo.Timestamp(), IsNil)
+	c.Assert(s.repo.Commit(), IsNil)
 	s.syncRemote(c)
 	s.withMetaExpired(func() {
 		_, err := client.Update()
@@ -616,6 +624,7 @@
 	c.Assert(s.repo.Sign("targets.json"), IsNil)
 	c.Assert(s.repo.Snapshot(tuf.CompressionTypeNone), IsNil)
 	c.Assert(s.repo.Timestamp(), IsNil)
+	c.Assert(s.repo.Commit(), IsNil)
 	s.syncRemote(c)
 
 	// check the update downloads the non expired remote root.json and