Commit be97c578 authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼

Update Release Candidate

parents 141a25f8 70bed816
Pipeline #38450 failed with stage
in 0 seconds
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
[buildout] [buildout]
extends = extends =
../openssl/buildout.cfg ../openssl/buildout.cfg
../patch/buildout.cfg
../perl/buildout.cfg ../perl/buildout.cfg
../pkgconfig/buildout.cfg ../pkgconfig/buildout.cfg
../xz-utils/buildout.cfg ../xz-utils/buildout.cfg
...@@ -77,6 +78,10 @@ environment = ...@@ -77,6 +78,10 @@ environment =
PATH=${perl:location}/bin:${pkgconfig:location}/bin:${xz-utils:location}/bin:%(PATH)s PATH=${perl:location}/bin:${pkgconfig:location}/bin:${xz-utils:location}/bin:%(PATH)s
PKG_CONFIG_PATH=${:pkgconfig} PKG_CONFIG_PATH=${:pkgconfig}
LDFLAGS=-Wl,-rpath=${libidn2:location}/lib -Wl,-rpath=${zlib:location}/lib -Wl,-rpath=${:OPENSSL}/lib -Wl,-rpath=${nghttp2:location}/lib -Wl,-rpath=${zstd:location}/lib ${:LDFLAGS} LDFLAGS=-Wl,-rpath=${libidn2:location}/lib -Wl,-rpath=${zlib:location}/lib -Wl,-rpath=${:OPENSSL}/lib -Wl,-rpath=${nghttp2:location}/lib -Wl,-rpath=${zstd:location}/lib ${:LDFLAGS}
patch-options = -p1
patch-binary = ${patch:location}/bin/patch
patches =
https://github.com/curl/curl/commit/f5c616930b5cf148b1b2632da4f5963ff48bdf88.patch?full_index=1#e6ebcd491dd9d105c26287fe830fd557
[curl-http3] [curl-http3]
<= curl <= curl
......
...@@ -60,8 +60,6 @@ skipUnlessKvm = unittest.skipUnless(has_kvm, 'kvm not loaded or not allowed') ...@@ -60,8 +60,6 @@ skipUnlessKvm = unittest.skipUnless(has_kvm, 'kvm not loaded or not allowed')
if has_kvm: if has_kvm:
setUpModule, InstanceTestCase = makeModuleSetUpAndTestCaseClass( setUpModule, InstanceTestCase = makeModuleSetUpAndTestCaseClass(
os.path.join(os.path.dirname(__file__), 'test-software.cfg')) os.path.join(os.path.dirname(__file__), 'test-software.cfg'))
# XXX Keep using slapos node instance --all, because of missing promises
InstanceTestCase.slap._force_slapos_node_instance_all = True
else: else:
setUpModule, InstanceTestCase = None, unittest.TestCase setUpModule, InstanceTestCase = None, unittest.TestCase
...@@ -277,9 +275,40 @@ class KvmMixin: ...@@ -277,9 +275,40 @@ class KvmMixin:
return running_process_info.replace( return running_process_info.replace(
hash_value, '{hash}').replace(kvm_hash_value, '{kvm-hash-value}') hash_value, '{hash}').replace(kvm_hash_value, '{kvm-hash-value}')
def raising_waitForInstance(self, max_retry): @classmethod
with self.assertRaises(SlapOSNodeCommandError): def waitForInstanceWithPropagation(cls, first_retry=10, second_retry=10):
self.slap.waitForInstance(max_retry=max_retry) # run slapos node instance twice
# once to apply newly requested instance...
try:
cls.slap.waitForInstance(max_retry=first_retry)
except SlapOSNodeCommandError:
pass
# ...and second time to re-read the parameters from master and propagate
# it to the instances
cls.slap.waitForInstance(max_retry=second_retry)
@classmethod
def raising_waitForInstance(cls, max_retry=5):
with cls.assertRaises(cls, SlapOSNodeCommandError):
cls.slap.waitForInstance(max_retry=max_retry)
@classmethod
def raising_waitForInstanceWithForce(cls, max_retry=5):
_current = cls.slap._force_slapos_node_instance_all
try:
cls.slap._force_slapos_node_instance_all = True
cls.raising_waitForInstance(max_retry=max_retry)
finally:
cls.slap._force_slapos_node_instance_all = _current
@classmethod
def waitForInstanceWithForce(cls, max_retry=10):
_current = cls.slap._force_slapos_node_instance_all
try:
cls.slap._force_slapos_node_instance_all = True
cls.slap.waitForInstance(max_retry=max_retry)
finally:
cls.slap._force_slapos_node_instance_all = _current
def rerequestInstance(self, parameter_dict=None, state='started'): def rerequestInstance(self, parameter_dict=None, state='started'):
if parameter_dict is None: if parameter_dict is None:
...@@ -637,7 +666,7 @@ class TestAccessDefaultBootstrap(MonitorAccessMixin, KVMTestCase): ...@@ -637,7 +666,7 @@ class TestAccessDefaultBootstrap(MonitorAccessMixin, KVMTestCase):
self._updateSlaposResource(partition_path, tap=top_tap) self._updateSlaposResource(partition_path, tap=top_tap)
self.slap.waitForInstance(max_retry=10) self.waitForInstanceWithForce()
# END: mock .slapos-resource with tap.ipv4_addr # END: mock .slapos-resource with tap.ipv4_addr
connection_parameter_dict = self.getConnectionParameterDictJson() connection_parameter_dict = self.getConnectionParameterDictJson()
...@@ -1358,7 +1387,7 @@ class TestBootImageUrlList(FakeImageServerMixin, KVMTestCase): ...@@ -1358,7 +1387,7 @@ class TestBootImageUrlList(FakeImageServerMixin, KVMTestCase):
self.fake_image3, self.fake_image3_md5sum, self.fake_image3, self.fake_image3_md5sum,
self.fake_image2, self.fake_image2_md5sum) self.fake_image2, self.fake_image2_md5sum)
}) })
self.slap.waitForInstance(max_retry=10) self.waitForInstanceWithPropagation()
self.assertTrue(os.path.exists(os.path.join( self.assertTrue(os.path.exists(os.path.join(
image_repository, self.fake_image3_md5sum))) image_repository, self.fake_image3_md5sum)))
self.assertTrue(os.path.exists(os.path.join( self.assertTrue(os.path.exists(os.path.join(
...@@ -1375,7 +1404,7 @@ class TestBootImageUrlList(FakeImageServerMixin, KVMTestCase): ...@@ -1375,7 +1404,7 @@ class TestBootImageUrlList(FakeImageServerMixin, KVMTestCase):
# cleanup of images works, also asserts that configuration changes are # cleanup of images works, also asserts that configuration changes are
# reflected # reflected
self.rerequestInstance() self.rerequestInstance()
self.slap.waitForInstance(max_retry=15) self.waitForInstanceWithPropagation()
self.assertEqual( self.assertEqual(
os.listdir(image_repository), os.listdir(image_repository),
[] []
...@@ -1394,19 +1423,27 @@ class TestBootImageUrlList(FakeImageServerMixin, KVMTestCase): ...@@ -1394,19 +1423,27 @@ class TestBootImageUrlList(FakeImageServerMixin, KVMTestCase):
self.rerequestInstance({ self.rerequestInstance({
self.key: self.bad_value self.key: self.bad_value
}) })
self.raising_waitForInstance(3) if self.getInstanceSoftwareType() == 'kvm-resilient':
self.waitForInstance()
self.raising_waitForInstance(5)
self.assertPromiseFails(self.config_state_promise) self.assertPromiseFails(self.config_state_promise)
def test_incorrect_md5sum(self): def test_incorrect_md5sum(self):
self.rerequestInstance({ self.rerequestInstance({
self.key: self.incorrect_md5sum_value_image % (self.fake_image,) self.key: self.incorrect_md5sum_value_image % (self.fake_image,)
}) })
self.raising_waitForInstance(3) if self.getInstanceSoftwareType() == 'kvm-resilient':
self.waitForInstance()
self.raising_waitForInstance(5)
self.assertPromiseFails(self.config_state_promise) self.assertPromiseFails(self.config_state_promise)
def test_incorrect_md5sum_value(self):
self.rerequestInstance({ self.rerequestInstance({
self.key: self.incorrect_md5sum_value self.key: self.incorrect_md5sum_value
}) })
self.raising_waitForInstance(3) if self.getInstanceSoftwareType() == 'kvm-resilient':
self.waitForInstance()
self.raising_waitForInstance(5)
self.assertPromiseFails(self.config_state_promise) self.assertPromiseFails(self.config_state_promise)
def test_not_matching_md5sum(self): def test_not_matching_md5sum(self):
...@@ -1414,7 +1451,9 @@ class TestBootImageUrlList(FakeImageServerMixin, KVMTestCase): ...@@ -1414,7 +1451,9 @@ class TestBootImageUrlList(FakeImageServerMixin, KVMTestCase):
self.key: self.single_image_value % ( self.key: self.single_image_value % (
self.fake_image, self.fake_image_wrong_md5sum) self.fake_image, self.fake_image_wrong_md5sum)
}) })
self.raising_waitForInstance(3) if self.getInstanceSoftwareType() == 'kvm-resilient':
self.waitForInstance()
self.raising_waitForInstance(5)
self.assertPromiseFails(self.download_md5sum_promise) self.assertPromiseFails(self.download_md5sum_promise)
self.assertPromiseFails(self.download_state_promise) self.assertPromiseFails(self.download_state_promise)
...@@ -1423,14 +1462,18 @@ class TestBootImageUrlList(FakeImageServerMixin, KVMTestCase): ...@@ -1423,14 +1462,18 @@ class TestBootImageUrlList(FakeImageServerMixin, KVMTestCase):
self.key: self.unreachable_host_value % ( self.key: self.unreachable_host_value % (
self.fake_image_md5sum,) self.fake_image_md5sum,)
}) })
self.raising_waitForInstance(3) if self.getInstanceSoftwareType() == 'kvm-resilient':
self.waitForInstance()
self.raising_waitForInstance(5)
self.assertPromiseFails(self.download_state_promise) self.assertPromiseFails(self.download_state_promise)
def test_too_many_images(self): def test_too_many_images(self):
self.rerequestInstance({ self.rerequestInstance({
self.key: self.too_many_image_value self.key: self.too_many_image_value
}) })
self.raising_waitForInstance(3) if self.getInstanceSoftwareType() == 'kvm-resilient':
self.waitForInstance()
self.raising_waitForInstance(5)
self.assertPromiseFails(self.config_state_promise) self.assertPromiseFails(self.config_state_promise)
...@@ -1486,7 +1529,7 @@ class TestBootImageUrlSelect(FakeImageServerMixin, KVMTestCase): ...@@ -1486,7 +1529,7 @@ class TestBootImageUrlSelect(FakeImageServerMixin, KVMTestCase):
# switch the image # switch the image
self.rerequestInstance({ self.rerequestInstance({
'boot-image-url-select': "Debian Bullseye 11 netinst x86_64"}) 'boot-image-url-select': "Debian Bullseye 11 netinst x86_64"})
self.slap.waitForInstance(max_retry=10) self.waitForInstanceWithPropagation()
image_repository = os.path.join( image_repository = os.path.join(
self.slap.instance_directory, self.kvm_instance_partition_reference, self.slap.instance_directory, self.kvm_instance_partition_reference,
'srv', 'boot-image-url-select-repository') 'srv', 'boot-image-url-select-repository')
...@@ -1511,6 +1554,8 @@ class TestBootImageUrlSelect(FakeImageServerMixin, KVMTestCase): ...@@ -1511,6 +1554,8 @@ class TestBootImageUrlSelect(FakeImageServerMixin, KVMTestCase):
self.rerequestInstance({ self.rerequestInstance({
'boot-image-url-select': 'DOESNOTEXISTS' 'boot-image-url-select': 'DOESNOTEXISTS'
}) })
if self.getInstanceSoftwareType() == 'kvm-resilient':
self.waitForInstance()
self.raising_waitForInstance(3) self.raising_waitForInstance(3)
self.assertPromiseFails(self.config_state_promise) self.assertPromiseFails(self.config_state_promise)
...@@ -1521,7 +1566,7 @@ class TestBootImageUrlSelect(FakeImageServerMixin, KVMTestCase): ...@@ -1521,7 +1566,7 @@ class TestBootImageUrlSelect(FakeImageServerMixin, KVMTestCase):
'boot-image-url-select': "Debian Bullseye 11 netinst x86_64" 'boot-image-url-select': "Debian Bullseye 11 netinst x86_64"
} }
self.rerequestInstance(partition_parameter_kw) self.rerequestInstance(partition_parameter_kw)
self.slap.waitForInstance(max_retry=10) self.waitForInstanceWithPropagation()
# check that image is correctly downloaded # check that image is correctly downloaded
image_repository = os.path.join( image_repository = os.path.join(
self.slap.instance_directory, self.kvm_instance_partition_reference, self.slap.instance_directory, self.kvm_instance_partition_reference,
...@@ -1569,7 +1614,7 @@ class TestBootImageUrlSelect(FakeImageServerMixin, KVMTestCase): ...@@ -1569,7 +1614,7 @@ class TestBootImageUrlSelect(FakeImageServerMixin, KVMTestCase):
self.fake_image, self.fake_image_md5sum), self.fake_image, self.fake_image_md5sum),
} }
self.rerequestInstance(partition_parameter_kw) self.rerequestInstance(partition_parameter_kw)
self.slap.waitForInstance(max_retry=10) self.waitForInstanceWithPropagation()
# check that image is correctly downloaded # check that image is correctly downloaded
image_repository = os.path.join( image_repository = os.path.join(
self.slap.instance_directory, self.kvm_instance_partition_reference, self.slap.instance_directory, self.kvm_instance_partition_reference,
...@@ -1605,7 +1650,7 @@ class TestBootImageUrlSelect(FakeImageServerMixin, KVMTestCase): ...@@ -1605,7 +1650,7 @@ class TestBootImageUrlSelect(FakeImageServerMixin, KVMTestCase):
# cleanup of images works, also asserts that configuration changes are # cleanup of images works, also asserts that configuration changes are
# reflected # reflected
self.rerequestInstance() self.rerequestInstance()
self.slap.waitForInstance(max_retry=15) self.waitForInstanceWithPropagation()
self.assertEqual( self.assertEqual(
os.listdir(os.path.join( os.listdir(os.path.join(
...@@ -1691,7 +1736,7 @@ class TestBootImageUrlListKvmCluster(FakeImageServerMixin, KVMTestCase): ...@@ -1691,7 +1736,7 @@ class TestBootImageUrlListKvmCluster(FakeImageServerMixin, KVMTestCase):
} }
} }
})}) })})
self.slap.waitForInstance(max_retry=10) self.waitForInstanceWithPropagation()
KVM0_config = os.path.join( KVM0_config = os.path.join(
self.slap.instance_directory, self.__partition_reference__ + '1', 'etc', self.slap.instance_directory, self.__partition_reference__ + '1', 'etc',
self.config_file_name) self.config_file_name)
...@@ -1746,7 +1791,7 @@ class TestBootImageUrlSelectKvmCluster(KvmMixin, KVMTestCase): ...@@ -1746,7 +1791,7 @@ class TestBootImageUrlSelectKvmCluster(KvmMixin, KVMTestCase):
} }
} }
})}) })})
self.slap.waitForInstance(max_retry=10) self.waitForInstanceWithPropagation()
KVM0_config = os.path.join( KVM0_config = os.path.join(
self.slap.instance_directory, self.__partition_reference__ + '1', 'etc', self.slap.instance_directory, self.__partition_reference__ + '1', 'etc',
'boot-image-url-select.json') 'boot-image-url-select.json')
...@@ -2226,7 +2271,7 @@ class TestParameterDefault(KVMTestCase, KvmMixin): ...@@ -2226,7 +2271,7 @@ class TestParameterDefault(KVMTestCase, KvmMixin):
def _test(self, parameter_dict, expected): def _test(self, parameter_dict, expected):
self.rerequestInstance(self.mangleParameterDict(parameter_dict)) self.rerequestInstance(self.mangleParameterDict(parameter_dict))
self.slap.waitForInstance(max_retry=10) self.waitForInstanceWithPropagation()
kvm_raw = glob.glob(os.path.join( kvm_raw = glob.glob(os.path.join(
self.slap.instance_directory, '*', 'bin', 'kvm_raw')) self.slap.instance_directory, '*', 'bin', 'kvm_raw'))
...@@ -2360,6 +2405,8 @@ class ExternalDiskMixin(KvmMixin): ...@@ -2360,6 +2405,8 @@ class ExternalDiskMixin(KvmMixin):
slapos_config.append(line) slapos_config.append(line)
with open(cls.slap._slapos_config, 'w') as fh: with open(cls.slap._slapos_config, 'w') as fh:
fh.write(''.join(slapos_config)) fh.write(''.join(slapos_config))
# as out of slapos control change applied force reprocessing
cls.waitForInstanceWithForce()
@classmethod @classmethod
def _dropExternalStorageList(cls): def _dropExternalStorageList(cls):
...@@ -2371,6 +2418,12 @@ class ExternalDiskMixin(KvmMixin): ...@@ -2371,6 +2418,12 @@ class ExternalDiskMixin(KvmMixin):
slapos_config.append(line) slapos_config.append(line)
with open(cls.slap._slapos_config, 'w') as fh: with open(cls.slap._slapos_config, 'w') as fh:
fh.write(''.join(slapos_config)) fh.write(''.join(slapos_config))
# as out of slapos control change applied force reprocessing and ignore
# errors, as test can leave the partitions in inconsistent state
try:
cls.waitForInstanceWithForce()
except SlapOSNodeCommandError:
pass
def getRunningDriveList(self, kvm_instance_partition): def getRunningDriveList(self, kvm_instance_partition):
_match_drive = re.compile('file.*if=virtio.*').match _match_drive = re.compile('file.*if=virtio.*').match
...@@ -2410,8 +2463,6 @@ class TestExternalDisk(KVMTestCase, ExternalDiskMixin): ...@@ -2410,8 +2463,6 @@ class TestExternalDisk(KVMTestCase, ExternalDiskMixin):
cls.working_directory = tempfile.mkdtemp() cls.working_directory = tempfile.mkdtemp()
# setup the external_storage_list, to mimic part of slapformat # setup the external_storage_list, to mimic part of slapformat
cls._prepareExternalStorageList() cls._prepareExternalStorageList()
# re-run the instance, as information has been updated
cls.waitForInstance()
@classmethod @classmethod
def tearDownClass(cls): def tearDownClass(cls):
...@@ -2543,7 +2594,7 @@ class TestExternalDiskModern( ...@@ -2543,7 +2594,7 @@ class TestExternalDiskModern(
ExternalDiskModernMixin, KVMTestCase, ExternalDiskMixin): ExternalDiskModernMixin, KVMTestCase, ExternalDiskMixin):
def test(self): def test(self):
self.prepareEnv() self.prepareEnv()
self.waitForInstance() self.waitForInstanceWithPropagation()
drive_list = self.getRunningDriveList(self.kvm_instance_partition) drive_list = self.getRunningDriveList(self.kvm_instance_partition)
self.assertEqual( self.assertEqual(
drive_list, drive_list,
......
...@@ -437,6 +437,7 @@ MarkupSafe = 2.0.1 ...@@ -437,6 +437,7 @@ MarkupSafe = 2.0.1
PyYAML = 5.4.1 PyYAML = 5.4.1
typing-extensions = 4.7.1:whl typing-extensions = 4.7.1:whl
Werkzeug = 2.0.2 Werkzeug = 2.0.2
zope.interface = 6.3
[versions:python2] [versions:python2]
attrs = 18.2.0 attrs = 18.2.0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment