]> xenbits.xensource.com Git - people/gdunlap/xsatool/commitdiff
Testing: Test "xsatool global update" initialization
authorGeorge Dunlap <george.dunlap@citrix.com>
Thu, 11 May 2017 12:42:03 +0000 (13:42 +0100)
committerGeorge Dunlap <george.dunlap@citrix.com>
Wed, 17 May 2017 15:19:58 +0000 (16:19 +0100)
Re-constructing the history of XSA 206, go back to version 4.4.

Check to make sure that after the initialization we have exactly the
versions we expect.

Also sketch out a plan for our 'system testing'.

Signed-off-by: George Dunlap <george.dunlap@citrix.com>
system_test.go

index 6ff68af2e5aeee8041ec70094467a07855527823..4b640017b1648b6d5154e682639fc70f965c9d61 100644 (file)
@@ -146,6 +146,41 @@ func InitRepo(t *testing.T) bool {
                }
        }
 
+       // Test to make sure things are in the expected state
+
+       return true
+}
+
+func GlobalInit(t *testing.T) bool {
+       //args := []string{"xsatool", "global", "update"}
+       QuerySetResponses([]string{"4.4"})
+       if MainHarness("global", "update") != 0 {
+               return false
+       }
+
+       // Check to see that we have the expected
+       versions := map[XenVersion]bool{
+               "4.8": false,
+               "4.7": false,
+               "4.6": false,
+               "4.5": false,
+               "4.4": false,
+       }
+
+       for v := range G.config.Security.Versions {
+               _, prs := versions[v]
+               if !prs {
+                       t.Errorf("Unexpected version: %v\n", v)
+               } else {
+                       versions[v] = true
+               }
+       }
+
+       for v, seen := range versions {
+               if !seen {
+                       t.Errorf("Didn't find expected xenversion %v\n", v)
+               }
+       }
        return true
 }
 
@@ -167,7 +202,28 @@ func TestSystem(t *testing.T) {
                return
        }
 
-       goto out
+       // Initialize global state
+       // xsatool global update
+       if !GlobalInit(t) {
+               goto out
+       }
+
+       //// xsa 206 "story"
+       // xsatool 206 init
+
+       // Fake-up xsa/206/master
+
+       // 206 Backport (should fail at 4.8. 4.7, and 4.6; NOT 4.5)
+
+       // 206 sync-patches
+
+       // 206 test
+
+       //// xsa 211 "story"
+
+       //// Drop 4.4 support, update to 4.8.1
+
+       //// xsa 212-215 "story"
 
 out:
        os.Chdir(topdir)