@@ -1448,24 +1448,64 @@ bool versionsSpanBoundary(int verA, int verB, int incBoundaryVer)
1448
1448
(maxPeerVer >= incBoundaryVer) );
1449
1449
}
1450
1450
1451
+ bool versionsProtocolCompatible (int verA, int verB)
1452
+ {
1453
+ /* *
1454
+ * Version 8.0 introduced some incompatibilities, check
1455
+ * whether they make a test unusable
1456
+ */
1457
+ if (versionsSpanBoundary (verA, verB, NDB_MAKE_VERSION (8 ,0 ,0 )))
1458
+ {
1459
+ /* Versions span 8.0 boundary, check compatibility */
1460
+ if (!ndbd_protocol_accepted_by_8_0 (verA) ||
1461
+ !ndbd_protocol_accepted_by_8_0 (verB))
1462
+ {
1463
+ ndbout_c (" Versions spanning 8.0 boundary not protocol compatible : "
1464
+ " %x -> %x" ,
1465
+ verA, verB);
1466
+ return false ;
1467
+ }
1468
+ }
1469
+
1470
+ return true ;
1471
+ }
1472
+
1451
1473
static int checkForDowngrade (NDBT_Context* ctx, NDBT_Step* step)
1452
1474
{
1453
- if (preVersion >= postVersion)
1475
+ if (preVersion < postVersion)
1454
1476
{
1455
- return NDBT_OK;
1477
+ ndbout_c (" Error: Not doing downgrade as expected : "
1478
+ " %x -> %x" ,
1479
+ preVersion, postVersion);
1480
+ return NDBT_FAILED;
1481
+ }
1482
+
1483
+ if (!versionsProtocolCompatible (preVersion, postVersion))
1484
+ {
1485
+ ndbout_c (" Skipping test due to protocol incompatibility" );
1486
+ return NDBT_SKIPPED;
1456
1487
}
1457
- ndbout << " Error: Not doing downgrade as expected " << endl;
1458
- return NDBT_FAILED ;
1488
+
1489
+ return NDBT_OK ;
1459
1490
}
1460
1491
1461
1492
static int checkForUpgrade (NDBT_Context* ctx, NDBT_Step* step)
1462
1493
{
1463
- if (preVersion <= postVersion)
1494
+ if (preVersion > postVersion)
1464
1495
{
1465
- return NDBT_OK;
1496
+ ndbout_c (" Error: Not doing upgrade as expected : "
1497
+ " %x -> %x" ,
1498
+ preVersion, postVersion);
1499
+ return NDBT_FAILED;
1466
1500
}
1467
- ndbout << " Error: Not doing upgrade as expected" << endl;
1468
- return NDBT_FAILED;
1501
+
1502
+ if (!versionsProtocolCompatible (preVersion, postVersion))
1503
+ {
1504
+ ndbout_c (" Skipping test due to protocol incompatibility" );
1505
+ return NDBT_SKIPPED;
1506
+ }
1507
+
1508
+ return NDBT_OK;
1469
1509
}
1470
1510
1471
1511
#define NDB_USE_CONFIG_VERSION_V2_80 NDB_MAKE_VERSION (8 ,0 ,18 )
@@ -2117,13 +2157,25 @@ NDBT_TESTSUITE(testUpgrade);
2117
2157
TESTCASE (" ShowVersions" ,
2118
2158
" Upgrade API, showing actual versions run" )
2119
2159
{
2160
+ /* *
2161
+ * This test is used to check the versions involved, and
2162
+ * should do a minimal amount of other things, so that it
2163
+ * does not depend on anything that can break between
2164
+ * releases.
2165
+ */
2120
2166
INITIALIZER (runCheckStarted);
2121
2167
STEP (runShowVersion);
2122
2168
STEP (runRecordVersion);
2123
2169
VERIFIER (startPostUpgradeChecks);
2124
2170
}
2125
2171
POSTUPGRADE (" ShowVersions" )
2126
2172
{
2173
+ /* *
2174
+ * This test postupgrade is used to check the versions involved, and
2175
+ * should do a minimal amount of other things, so that it
2176
+ * does not depend on anything that can break between
2177
+ * releases.
2178
+ */
2127
2179
TC_PROPERTY (" PostUpgrade" , Uint32 (1 ));
2128
2180
INITIALIZER (runCheckStarted);
2129
2181
STEP (runShowVersion);
0 commit comments