const cassandraManifestPath … type CassandraUpgradeTest … // Name returns the tracking name of the test. func (CassandraUpgradeTest) Name() string { … } // Skip returns true when this test can be skipped. func (CassandraUpgradeTest) Skip(upgCtx upgrades.UpgradeContext) bool { … } func cassandraKubectlCreate(ns, file string) { … } // Setup creates a Cassandra StatefulSet and a PDB. It also brings up a tester // ReplicaSet and associated service and PDB to guarantee availability during // the upgrade. // It waits for the system to stabilize before adding two users to verify // connectivity. func (t *CassandraUpgradeTest) Setup(ctx context.Context, f *framework.Framework) { … } // listUsers gets a list of users from the db via the tester service. func (t *CassandraUpgradeTest) listUsers() ([]string, error) { … } // addUser adds a user to the db via the tester services. func (t *CassandraUpgradeTest) addUser(name string) error { … } // getServiceIP is a helper method to extract the Ingress IP from the service. func (t *CassandraUpgradeTest) getServiceIP(ctx context.Context, f *framework.Framework, ns, svcName string) string { … } // Test is called during the upgrade. // It launches two goroutines, one continuously writes to the db and one reads // from the db. Each attempt is tallied and at the end we verify if the success // ratio is over a certain threshold (0.75). We also verify that we get // at least the same number of rows back as we successfully wrote. func (t *CassandraUpgradeTest) Test(ctx context.Context, f *framework.Framework, done <-chan struct{ … } // Teardown does one final check of the data's availability. func (t *CassandraUpgradeTest) Teardown(ctx context.Context, f *framework.Framework) { … }