@@ -44,18 +44,6 @@ func createV2store(t testing.TB, lastReleaseBinary string, dataDirPath string) {
4444 }
4545}
4646
47- func assertVerifyCanStartV2deprecationNotYet (t testing.TB , dataDirPath string ) {
48- t .Log ("verify: possible to start etcd with --v2-deprecation=not-yet mode" )
49-
50- cfg := e2e .ConfigStandalone (e2e.EtcdProcessClusterConfig {DataDirPath : dataDirPath , V2deprecation : "not-yet" , KeepDataDir : true })
51- epc , err := e2e .NewEtcdProcessCluster (t , cfg )
52- assert .NoError (t , err )
53-
54- defer func () {
55- assert .NoError (t , epc .Stop ())
56- }()
57- }
58-
5947func assertVerifyCannotStartV2deprecationWriteOnly (t testing.TB , dataDirPath string ) {
6048 t .Log ("Verify its infeasible to start etcd with --v2-deprecation=write-only mode" )
6149 proc , err := e2e .SpawnCmd ([]string {e2e .BinDir + "/etcd" , "--v2-deprecation=write-only" , "--data-dir=" + dataDirPath }, nil )
@@ -65,6 +53,15 @@ func assertVerifyCannotStartV2deprecationWriteOnly(t testing.TB, dataDirPath str
6553 assert .NoError (t , err )
6654}
6755
56+ func assertVerifyCannotStartV2deprecationNotYet (t testing.TB , dataDirPath string ) {
57+ t .Log ("Verify its infeasible to start etcd with --v2-deprecation=not-yet mode" )
58+ proc , err := e2e .SpawnCmd ([]string {e2e .BinDir + "/etcd" , "--v2-deprecation=not-yet" , "--data-dir=" + dataDirPath }, nil )
59+ assert .NoError (t , err )
60+
61+ _ , err = proc .Expect (`invalid value "not-yet" for flag -v2-deprecation: invalid value "not-yet"` )
62+ assert .NoError (t , err )
63+ }
64+
6865func TestV2Deprecation (t * testing.T ) {
6966 e2e .BeforeTest (t )
7067 dataDirPath := t .TempDir ()
@@ -78,12 +75,12 @@ func TestV2Deprecation(t *testing.T) {
7875 createV2store (t , lastReleaseBinary , dataDirPath )
7976 })
8077
81- t .Run ("--v2-deprecation=write-only fails" , func (t * testing.T ) {
82- assertVerifyCannotStartV2deprecationWriteOnly (t , dataDirPath )
78+ t .Run ("--v2-deprecation=not-yet fails" , func (t * testing.T ) {
79+ assertVerifyCannotStartV2deprecationNotYet (t , dataDirPath )
8380 })
8481
85- t .Run ("--v2-deprecation=not-yet succeeds " , func (t * testing.T ) {
86- assertVerifyCanStartV2deprecationNotYet (t , dataDirPath )
82+ t .Run ("--v2-deprecation=write-only fails " , func (t * testing.T ) {
83+ assertVerifyCannotStartV2deprecationWriteOnly (t , dataDirPath )
8784 })
8885
8986}
0 commit comments