From 55fc2633e39e1d974349dea1a6f473ce52afa26e Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Oct 30 2018 05:03:39 +0000 Subject: import udisks2-2.7.3-8.el7 --- diff --git a/SOURCES/luks_resize_1567992.patch b/SOURCES/luks_resize_1567992.patch new file mode 100644 index 0000000..22985ea --- /dev/null +++ b/SOURCES/luks_resize_1567992.patch @@ -0,0 +1,232 @@ +From 9f749a4ea6129c256bb3522291eaa43f63c961c1 Mon Sep 17 00:00:00 2001 +From: Marius Vollmer +Date: Tue, 5 Dec 2017 17:17:40 +0200 +Subject: [PATCH] core: Add Encrypted.Resize method + +To go with Filesystem.Resize. +--- + data/org.freedesktop.UDisks2.xml | 16 ++++ + doc/udisks2-sections.txt.in.in | 4 + + src/udiskslinuxencrypted.c | 134 ++++++++++++++++++++++++++++++ + udisks/udisksclient.c | 1 + + 4 files changed, 155 insertions(+) + +diff --git a/data/org.freedesktop.UDisks2.xml b/data/org.freedesktop.UDisks2.xml +index fa53a72..75ec0ea 100644 +--- a/data/org.freedesktop.UDisks2.xml ++++ b/data/org.freedesktop.UDisks2.xml +@@ -2059,6 +2059,20 @@ + + + ++ ++ ++ ++ ++ ++ + + + +@@ -2451,6 +2465,8 @@ + Locking encrypted device. + encrypted-modify + Modifying encrypted device. ++ encrypted-resize ++ Resizing encrypted device. + swapspace-start + Starting swapspace. + swapspace-stop +diff --git a/doc/udisks2-sections.txt.in.in b/doc/udisks2-sections.txt.in.in +index 5860d43..13cf728 100644 +--- a/doc/udisks2-sections.txt.in.in ++++ b/doc/udisks2-sections.txt.in.in +@@ -1036,6 +1036,10 @@ udisks_encrypted_call_change_passphrase + udisks_encrypted_call_change_passphrase_finish + udisks_encrypted_call_change_passphrase_sync + udisks_encrypted_complete_change_passphrase ++udisks_encrypted_call_resize ++udisks_encrypted_call_resize_finish ++udisks_encrypted_call_resize_sync ++udisks_encrypted_complete_resize + UDisksEncryptedProxy + UDisksEncryptedProxyClass + udisks_encrypted_proxy_new +diff --git a/src/udiskslinuxencrypted.c b/src/udiskslinuxencrypted.c +index 7b19e84..08e59d1 100644 +--- a/src/udiskslinuxencrypted.c ++++ b/src/udiskslinuxencrypted.c +@@ -43,6 +43,7 @@ + #include "udiskscrypttabentry.h" + #include "udiskscrypttabmonitor.h" + #include "udisksspawnedjob.h" ++#include "udiskssimplejob.h" + + /** + * SECTION:udiskslinuxencrypted +@@ -802,10 +803,143 @@ handle_change_passphrase (UDisksEncrypted *encrypted, + + /* ---------------------------------------------------------------------------------------------------- */ + ++/* runs in thread dedicated to handling method call */ ++static gboolean ++handle_resize (UDisksEncrypted *encrypted, ++ GDBusMethodInvocation *invocation, ++ guint64 size, ++ GVariant *options) ++{ ++ UDisksObject *object = NULL; ++ UDisksBlock *block; ++ UDisksObject *cleartext_object = NULL; ++ UDisksBlock *cleartext_block; ++ UDisksDaemon *daemon; ++ uid_t caller_uid; ++ const gchar *action_id = NULL; ++ const gchar *message = NULL; ++ GError *error = NULL; ++ UDisksBaseJob *job = NULL; ++ ++ object = udisks_daemon_util_dup_object (encrypted, &error); ++ if (object == NULL) ++ { ++ g_dbus_method_invocation_take_error (invocation, error); ++ goto out; ++ } ++ ++ block = udisks_object_peek_block (object); ++ daemon = udisks_linux_block_object_get_daemon (UDISKS_LINUX_BLOCK_OBJECT (object)); ++ ++ /* Fail if the device is not a LUKS device */ ++ if (!(g_strcmp0 (udisks_block_get_id_usage (block), "crypto") == 0 && ++ g_strcmp0 (udisks_block_get_id_type (block), "crypto_LUKS") == 0)) ++ { ++ g_dbus_method_invocation_return_error (invocation, ++ UDISKS_ERROR, ++ UDISKS_ERROR_FAILED, ++ "Device %s does not appear to be a LUKS device", ++ udisks_block_get_device (block)); ++ goto out; ++ } ++ ++ error = NULL; ++ if (!udisks_daemon_util_get_caller_uid_sync (daemon, invocation, NULL /* GCancellable */, &caller_uid, NULL, NULL, &error)) ++ { ++ g_dbus_method_invocation_return_gerror (invocation, error); ++ g_clear_error (&error); ++ goto out; ++ } ++ ++ /* Fail if device is not unlocked */ ++ cleartext_object = udisks_daemon_wait_for_object_sync (daemon, ++ wait_for_cleartext_object, ++ g_strdup (g_dbus_object_get_object_path (G_DBUS_OBJECT (object))), ++ g_free, ++ 0, /* timeout_seconds */ ++ NULL); /* error */ ++ if (cleartext_object == NULL) ++ { ++ g_dbus_method_invocation_return_error (invocation, ++ UDISKS_ERROR, ++ UDISKS_ERROR_FAILED, ++ "Device %s is not unlocked", ++ udisks_block_get_device (block)); ++ goto out; ++ } ++ cleartext_block = udisks_object_peek_block (cleartext_object); ++ ++ action_id = "org.freedesktop.udisks2.modify-device"; ++ /* Translators: Shown in authentication dialog when the user ++ * requests resizing a encrypted block device. ++ * ++ * Do not translate $(drive), it's a placeholder and ++ * will be replaced by the name of the drive/device in question ++ */ ++ message = N_("Authentication is required to resize the encrypted device $(drive)"); ++ if (! udisks_daemon_util_setup_by_user (daemon, object, caller_uid)) ++ { ++ if (udisks_block_get_hint_system (block)) ++ { ++ action_id = "org.freedesktop.udisks2.modify-device-system"; ++ } ++ else if (! udisks_daemon_util_on_user_seat (daemon, UDISKS_OBJECT (object), caller_uid)) ++ { ++ action_id = "org.freedesktop.udisks2.modify-device-other-seat"; ++ } ++ } ++ ++ /* Check that the user is actually authorized to resize the device. */ ++ if (! udisks_daemon_util_check_authorization_sync (daemon, ++ object, ++ action_id, ++ options, ++ message, ++ invocation)) ++ goto out; ++ ++ job = udisks_daemon_launch_simple_job (daemon, ++ UDISKS_OBJECT (object), ++ "encrypted-resize", ++ caller_uid, ++ NULL); ++ if (job == NULL) ++ { ++ g_dbus_method_invocation_return_error (invocation, UDISKS_ERROR, UDISKS_ERROR_FAILED, ++ "Failed to create a job object"); ++ goto out; ++ } ++ ++ /* TODO: implement progress parsing for udisks_job_set_progress(_valid) */ ++ if (! bd_crypto_luks_resize (udisks_block_get_device (cleartext_block), size / 512, &error)) ++ { ++ g_dbus_method_invocation_return_error (invocation, ++ UDISKS_ERROR, ++ UDISKS_ERROR_FAILED, ++ "Error resizing encrypted device %s: %s", ++ udisks_block_get_device (cleartext_block), ++ error->message); ++ udisks_simple_job_complete (UDISKS_SIMPLE_JOB (job), FALSE, error->message); ++ goto out; ++ } ++ ++ udisks_encrypted_complete_resize (encrypted, invocation); ++ udisks_simple_job_complete (UDISKS_SIMPLE_JOB (job), TRUE, NULL); ++ ++ out: ++ g_clear_object (&cleartext_object); ++ g_clear_object (&object); ++ g_clear_error (&error); ++ return TRUE; /* returning TRUE means that we handled the method invocation */ ++} ++ ++/* ---------------------------------------------------------------------------------------------------- */ ++ + static void + encrypted_iface_init (UDisksEncryptedIface *iface) + { + iface->handle_unlock = handle_unlock; + iface->handle_lock = handle_lock; + iface->handle_change_passphrase = handle_change_passphrase; ++ iface->handle_resize = handle_resize; + } +diff --git a/udisks/udisksclient.c b/udisks/udisksclient.c +index 7bd5684..980c941 100644 +--- a/udisks/udisksclient.c ++++ b/udisks/udisksclient.c +@@ -2487,6 +2487,7 @@ udisks_client_get_job_description (UDisksClient *client, + g_hash_table_insert (hash, (gpointer) "encrypted-unlock", (gpointer) C_("job", "Unlocking Device")); + g_hash_table_insert (hash, (gpointer) "encrypted-lock", (gpointer) C_("job", "Locking Device")); + g_hash_table_insert (hash, (gpointer) "encrypted-modify", (gpointer) C_("job", "Modifying Encrypted Device")); ++ g_hash_table_insert (hash, (gpointer) "encrypted-resize", (gpointer) C_("job", "Resizing Encrypted Device")); + g_hash_table_insert (hash, (gpointer) "swapspace-start", (gpointer) C_("job", "Starting Swap Device")); + g_hash_table_insert (hash, (gpointer) "swapspace-stop", (gpointer) C_("job", "Stopping Swap Device")); + g_hash_table_insert (hash, (gpointer) "filesystem-check", (gpointer) C_("job", "Checking Filesystem")); +-- +1.8.3.1 diff --git a/SOURCES/tests_add_targetcli_config_1511986.patch b/SOURCES/tests_add_targetcli_config_1511986.patch new file mode 100644 index 0000000..505c07d --- /dev/null +++ b/SOURCES/tests_add_targetcli_config_1511986.patch @@ -0,0 +1,630 @@ +From 76168cd9244fc47193760a0401bf42f1a8b06db6 Mon Sep 17 00:00:00 2001 +From: Iain Lane +Date: Thu, 19 Apr 2018 12:41:27 +0100 +Subject: [PATCH 1/2] tests: Pass absolute path to targetcli_config.json + +If the integration tests are run from a different directory, we will +fail to find targetcli_config.json with an error like + +Related: rhbz#1511986 +--- + src/tests/integration-test | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/src/tests/integration-test b/src/tests/integration-test +index f863578..bca5239 100755 +--- a/src/tests/integration-test ++++ b/src/tests/integration-test +@@ -1649,9 +1649,12 @@ def setup_lio(): + re.match(r'sd[a-z]+$', dev)} + + # create fake SCSI hard drives ++ our_path = os.path.abspath(__file__) ++ our_dir = os.path.dirname(our_path) ++ json_path = os.path.join(our_dir, 'dbus-tests', 'targetcli_config.json') + assert subprocess.call( + ["targetcli", +- "restoreconfig dbus-tests/targetcli_config.json"]) == 0 ++ "restoreconfig %s" % json_path]) == 0 + time.sleep(0.1) + + devs = {dev for dev in os.listdir("/dev") if +-- +1.8.3.1 + + +From f8fef004a8ce9bc64bea1d89dcce0d7465e583ed Mon Sep 17 00:00:00 2001 +From: Vojtech Trefny +Date: Fri, 22 Jun 2018 12:37:17 +0200 +Subject: [PATCH 2/2] Fix failing MDRAID integration test + +Test is failing because 'targetcli_config.json' is not included +in the archive, so we need to add it manually using a patch. + +Resolves: rhbz#1511986 +--- + src/tests/integration-test | 2 +- + src/tests/targetcli_config.json | 558 ++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 559 insertions(+), 1 deletion(-) + create mode 100644 src/tests/targetcli_config.json + +diff --git a/src/tests/integration-test b/src/tests/integration-test +index bca5239..b6b1103 100755 +--- a/src/tests/integration-test ++++ b/src/tests/integration-test +@@ -1651,7 +1651,7 @@ def setup_lio(): + # create fake SCSI hard drives + our_path = os.path.abspath(__file__) + our_dir = os.path.dirname(our_path) +- json_path = os.path.join(our_dir, 'dbus-tests', 'targetcli_config.json') ++ json_path = os.path.join(our_dir, 'targetcli_config.json') + assert subprocess.call( + ["targetcli", + "restoreconfig %s" % json_path]) == 0 +diff --git a/src/tests/targetcli_config.json b/src/tests/targetcli_config.json +new file mode 100644 +index 0000000..25d506b +--- /dev/null ++++ b/src/tests/targetcli_config.json +@@ -0,0 +1,558 @@ ++{ ++ "fabric_modules": [], ++ "storage_objects": [ ++ { ++ "attributes": { ++ "block_size": 512, ++ "emulate_3pc": 1, ++ "emulate_caw": 1, ++ "emulate_fua_write": 1, ++ "emulate_model_alias": 1, ++ "emulate_rest_reord": 0, ++ "emulate_tas": 1, ++ "emulate_tpu": 0, ++ "emulate_tpws": 0, ++ "emulate_ua_intlck_ctrl": 0, ++ "emulate_write_cache": 1, ++ "enforce_pr_isids": 1, ++ "force_pr_aptpl": 0, ++ "is_nonrot": 0, ++ "max_unmap_block_desc_count": 1, ++ "max_unmap_lba_count": 8192, ++ "max_write_same_len": 4096, ++ "optimal_sectors": 2048, ++ "pi_prot_format": 0, ++ "pi_prot_type": 0, ++ "queue_depth": 128, ++ "unmap_granularity": 1, ++ "unmap_granularity_alignment": 0 ++ }, ++ "dev": "/var/tmp/udisks_test_disk4", ++ "name": "udisks_test_disk4", ++ "plugin": "fileio", ++ "size": 524288000, ++ "write_back": true, ++ "wwn": "65541bbc-0ffc-42cb-b639-6ce91a818511" ++ }, ++ { ++ "attributes": { ++ "block_size": 512, ++ "emulate_3pc": 1, ++ "emulate_caw": 1, ++ "emulate_fua_write": 1, ++ "emulate_model_alias": 1, ++ "emulate_rest_reord": 0, ++ "emulate_tas": 1, ++ "emulate_tpu": 0, ++ "emulate_tpws": 0, ++ "emulate_ua_intlck_ctrl": 0, ++ "emulate_write_cache": 1, ++ "enforce_pr_isids": 1, ++ "force_pr_aptpl": 0, ++ "is_nonrot": 0, ++ "max_unmap_block_desc_count": 1, ++ "max_unmap_lba_count": 8192, ++ "max_write_same_len": 4096, ++ "optimal_sectors": 2048, ++ "pi_prot_format": 0, ++ "pi_prot_type": 0, ++ "queue_depth": 128, ++ "unmap_granularity": 1, ++ "unmap_granularity_alignment": 0 ++ }, ++ "dev": "/var/tmp/udisks_test_disk3", ++ "name": "udisks_test_disk3", ++ "plugin": "fileio", ++ "size": 524288000, ++ "write_back": true, ++ "wwn": "5282611e-2e74-4019-8ca5-d8ceb09dfa15" ++ }, ++ { ++ "attributes": { ++ "block_size": 512, ++ "emulate_3pc": 1, ++ "emulate_caw": 1, ++ "emulate_fua_write": 1, ++ "emulate_model_alias": 1, ++ "emulate_rest_reord": 0, ++ "emulate_tas": 1, ++ "emulate_tpu": 0, ++ "emulate_tpws": 0, ++ "emulate_ua_intlck_ctrl": 0, ++ "emulate_write_cache": 1, ++ "enforce_pr_isids": 1, ++ "force_pr_aptpl": 0, ++ "is_nonrot": 0, ++ "max_unmap_block_desc_count": 1, ++ "max_unmap_lba_count": 8192, ++ "max_write_same_len": 4096, ++ "optimal_sectors": 2048, ++ "pi_prot_format": 0, ++ "pi_prot_type": 0, ++ "queue_depth": 128, ++ "unmap_granularity": 1, ++ "unmap_granularity_alignment": 0 ++ }, ++ "dev": "/var/tmp/udisks_test_disk2", ++ "name": "udisks_test_disk2", ++ "plugin": "fileio", ++ "size": 524288000, ++ "write_back": true, ++ "wwn": "dd927109-b9e7-462c-b95a-ae7878623713" ++ }, ++ { ++ "attributes": { ++ "block_size": 512, ++ "emulate_3pc": 1, ++ "emulate_caw": 1, ++ "emulate_fua_write": 1, ++ "emulate_model_alias": 1, ++ "emulate_rest_reord": 0, ++ "emulate_tas": 1, ++ "emulate_tpu": 0, ++ "emulate_tpws": 0, ++ "emulate_ua_intlck_ctrl": 0, ++ "emulate_write_cache": 1, ++ "enforce_pr_isids": 1, ++ "force_pr_aptpl": 0, ++ "is_nonrot": 0, ++ "max_unmap_block_desc_count": 1, ++ "max_unmap_lba_count": 8192, ++ "max_write_same_len": 4096, ++ "optimal_sectors": 2048, ++ "pi_prot_format": 0, ++ "pi_prot_type": 0, ++ "queue_depth": 128, ++ "unmap_granularity": 1, ++ "unmap_granularity_alignment": 0 ++ }, ++ "dev": "/var/tmp/udisks_test_disk1", ++ "name": "udisks_test_disk1", ++ "plugin": "fileio", ++ "size": 524288000, ++ "write_back": true, ++ "wwn": "0604a813-ce79-45fa-a9ff-eaf82188594e" ++ }, ++ { ++ "attributes": { ++ "block_size": 512, ++ "emulate_3pc": 1, ++ "emulate_caw": 1, ++ "emulate_fua_write": 1, ++ "emulate_model_alias": 1, ++ "emulate_rest_reord": 0, ++ "emulate_tas": 1, ++ "emulate_tpu": 0, ++ "emulate_tpws": 0, ++ "emulate_ua_intlck_ctrl": 0, ++ "emulate_write_cache": 1, ++ "enforce_pr_isids": 1, ++ "force_pr_aptpl": 0, ++ "is_nonrot": 0, ++ "max_unmap_block_desc_count": 1, ++ "max_unmap_lba_count": 8192, ++ "max_write_same_len": 4096, ++ "optimal_sectors": 2048, ++ "pi_prot_format": 0, ++ "pi_prot_type": 0, ++ "queue_depth": 128, ++ "unmap_granularity": 1, ++ "unmap_granularity_alignment": 0 ++ }, ++ "dev": "/var/tmp/udisks_test_disk_iscsi1", ++ "name": "udisks_test_iscsi1", ++ "plugin": "fileio", ++ "size": 524288000, ++ "write_back": true, ++ "wwn": "ee5473b7-93ce-4002-8141-2ef990f7ba04" ++ }, ++ { ++ "attributes": { ++ "block_size": 512, ++ "emulate_3pc": 1, ++ "emulate_caw": 1, ++ "emulate_fua_write": 1, ++ "emulate_model_alias": 1, ++ "emulate_rest_reord": 0, ++ "emulate_tas": 1, ++ "emulate_tpu": 0, ++ "emulate_tpws": 0, ++ "emulate_ua_intlck_ctrl": 0, ++ "emulate_write_cache": 1, ++ "enforce_pr_isids": 1, ++ "force_pr_aptpl": 0, ++ "is_nonrot": 0, ++ "max_unmap_block_desc_count": 1, ++ "max_unmap_lba_count": 8192, ++ "max_write_same_len": 4096, ++ "optimal_sectors": 2048, ++ "pi_prot_format": 0, ++ "pi_prot_type": 0, ++ "queue_depth": 128, ++ "unmap_granularity": 1, ++ "unmap_granularity_alignment": 0 ++ }, ++ "dev": "/var/tmp/udisks_test_disk_iscsi2", ++ "name": "udisks_test_iscsi2", ++ "plugin": "fileio", ++ "size": 524288000, ++ "write_back": true, ++ "wwn": "ee5473b7-93ce-4002-8141-2ef990f7ba04" ++ }, ++ { ++ "attributes": { ++ "block_size": 512, ++ "emulate_3pc": 1, ++ "emulate_caw": 1, ++ "emulate_fua_write": 1, ++ "emulate_model_alias": 1, ++ "emulate_rest_reord": 0, ++ "emulate_tas": 1, ++ "emulate_tpu": 0, ++ "emulate_tpws": 0, ++ "emulate_ua_intlck_ctrl": 0, ++ "emulate_write_cache": 1, ++ "enforce_pr_isids": 1, ++ "force_pr_aptpl": 0, ++ "is_nonrot": 0, ++ "max_unmap_block_desc_count": 1, ++ "max_unmap_lba_count": 8192, ++ "max_write_same_len": 4096, ++ "optimal_sectors": 2048, ++ "pi_prot_format": 0, ++ "pi_prot_type": 0, ++ "queue_depth": 128, ++ "unmap_granularity": 1, ++ "unmap_granularity_alignment": 0 ++ }, ++ "dev": "/var/tmp/udisks_test_disk_iscsi3", ++ "name": "udisks_test_iscsi3", ++ "plugin": "fileio", ++ "size": 524288000, ++ "write_back": true, ++ "wwn": "ee5473b7-93ce-4002-8141-2ef990f7ba04" ++ } ++ ], ++ "targets": [ ++ { ++ "fabric": "loopback", ++ "tpgs": [ ++ { ++ "attributes": { ++ }, ++ "enable": true, ++ "luns": [ ++ { ++ "alias": "ea4c386be4", ++ "index": 0, ++ "storage_object": "/backstores/fileio/udisks_test_disk4" ++ } ++ ], ++ "node_acls": [], ++ "portals": [], ++ "tag": 1 ++ } ++ ], ++ "wwn": "naa.50014055ba294ff9" ++ }, ++ { ++ "fabric": "loopback", ++ "tpgs": [ ++ { ++ "attributes": { ++ }, ++ "enable": true, ++ "luns": [ ++ { ++ "alias": "7a8a8952a0", ++ "index": 0, ++ "storage_object": "/backstores/fileio/udisks_test_disk3" ++ } ++ ], ++ "node_acls": [], ++ "portals": [], ++ "tag": 1 ++ } ++ ], ++ "wwn": "naa.5001405929853f55" ++ }, ++ { ++ "fabric": "loopback", ++ "tpgs": [ ++ { ++ "attributes": { ++ }, ++ "enable": true, ++ "luns": [ ++ { ++ "alias": "d0173d579b", ++ "index": 0, ++ "storage_object": "/backstores/fileio/udisks_test_disk2" ++ } ++ ], ++ "node_acls": [], ++ "portals": [], ++ "tag": 1 ++ } ++ ], ++ "wwn": "naa.50014054a77f7fa2" ++ }, ++ { ++ "fabric": "loopback", ++ "tpgs": [ ++ { ++ "attributes": { ++ }, ++ "enable": true, ++ "luns": [ ++ { ++ "alias": "d4a2f5275c", ++ "index": 0, ++ "storage_object": "/backstores/fileio/udisks_test_disk1" ++ } ++ ], ++ "node_acls": [], ++ "portals": [], ++ "tag": 1 ++ } ++ ], ++ "wwn": "naa.5001405cf0711e93" ++ }, ++ { ++ "fabric": "iscsi", ++ "tpgs": [ ++ { ++ "attributes": { ++ "authentication": 0, ++ "cache_dynamic_acls": 1, ++ "default_cmdsn_depth": 64, ++ "default_erl": 0, ++ "demo_mode_discovery": 1, ++ "demo_mode_write_protect": 0, ++ "generate_node_acls": 1, ++ "login_timeout": 15, ++ "netif_timeout": 2, ++ "prod_mode_write_protect": 0, ++ "t10_pi": 0, ++ "tpg_enabled_sendtargets": 1 ++ }, ++ "enable": true, ++ "luns": [ ++ { ++ "alias": "121c69c714", ++ "index": 0, ++ "storage_object": "/backstores/fileio/udisks_test_iscsi1" ++ } ++ ], ++ "node_acls": [], ++ "parameters": { ++ "AuthMethod": "CHAP,None", ++ "DataDigest": "CRC32C,None", ++ "DataPDUInOrder": "Yes", ++ "DataSequenceInOrder": "Yes", ++ "DefaultTime2Retain": "20", ++ "DefaultTime2Wait": "2", ++ "ErrorRecoveryLevel": "0", ++ "FirstBurstLength": "65536", ++ "HeaderDigest": "CRC32C,None", ++ "IFMarkInt": "Reject", ++ "IFMarker": "No", ++ "ImmediateData": "Yes", ++ "InitialR2T": "Yes", ++ "MaxBurstLength": "262144", ++ "MaxConnections": "1", ++ "MaxOutstandingR2T": "1", ++ "MaxRecvDataSegmentLength": "8192", ++ "MaxXmitDataSegmentLength": "262144", ++ "OFMarkInt": "Reject", ++ "OFMarker": "No", ++ "TargetAlias": "LIO Target" ++ }, ++ "portals": [ ++ { ++ "ip_address": "0.0.0.0", ++ "iser": false, ++ "port": 3260 ++ } ++ ], ++ "tag": 1 ++ } ++ ], ++ "wwn": "iqn.2003-01.udisks.test:iscsi-test-noauth" ++ }, ++ { ++ "fabric": "iscsi", ++ "tpgs": [ ++ { ++ "attributes": { ++ "authentication": 0, ++ "cache_dynamic_acls": 0, ++ "default_cmdsn_depth": 64, ++ "default_erl": 0, ++ "demo_mode_discovery": 1, ++ "demo_mode_write_protect": 1, ++ "generate_node_acls": 0, ++ "login_timeout": 15, ++ "netif_timeout": 2, ++ "prod_mode_write_protect": 0, ++ "t10_pi": 0, ++ "tpg_enabled_sendtargets": 1 ++ }, ++ "enable": true, ++ "luns": [ ++ { ++ "alias": "f466bcd8fb", ++ "index": 0, ++ "storage_object": "/backstores/fileio/udisks_test_iscsi2" ++ } ++ ], ++ "node_acls": [ ++ { ++ "attributes": { ++ "dataout_timeout": 3, ++ "dataout_timeout_retries": 5, ++ "default_erl": 0, ++ "nopin_response_timeout": 30, ++ "nopin_timeout": 15, ++ "random_datain_pdu_offsets": 0, ++ "random_datain_seq_offsets": 0, ++ "random_r2t_offsets": 0 ++ }, ++ "chap_password": "udisks", ++ "chap_userid": "iqn.1994-05.com.redhat:iscsi-test", ++ "mapped_luns": [ ++ { ++ "alias": "2387cf5a50", ++ "index": 0, ++ "tpg_lun": 0, ++ "write_protect": false ++ } ++ ], ++ "node_wwn": "iqn.1994-05.com.redhat:iscsi-test" ++ } ++ ], ++ "parameters": { ++ "AuthMethod": "CHAP,None", ++ "DataDigest": "CRC32C,None", ++ "DataPDUInOrder": "Yes", ++ "DataSequenceInOrder": "Yes", ++ "DefaultTime2Retain": "20", ++ "DefaultTime2Wait": "2", ++ "ErrorRecoveryLevel": "0", ++ "FirstBurstLength": "65536", ++ "HeaderDigest": "CRC32C,None", ++ "IFMarkInt": "Reject", ++ "IFMarker": "No", ++ "ImmediateData": "Yes", ++ "InitialR2T": "Yes", ++ "MaxBurstLength": "262144", ++ "MaxConnections": "1", ++ "MaxOutstandingR2T": "1", ++ "MaxRecvDataSegmentLength": "8192", ++ "MaxXmitDataSegmentLength": "262144", ++ "OFMarkInt": "Reject", ++ "OFMarker": "No", ++ "TargetAlias": "LIO Target" ++ }, ++ "portals": [ ++ { ++ "ip_address": "0.0.0.0", ++ "iser": false, ++ "port": 3260 ++ } ++ ], ++ "tag": 1 ++ } ++ ], ++ "wwn": "iqn.2003-01.udisks.test:iscsi-test-chap" ++ }, ++ { ++ "fabric": "iscsi", ++ "tpgs": [ ++ { ++ "attributes": { ++ "authentication": 0, ++ "cache_dynamic_acls": 0, ++ "default_cmdsn_depth": 64, ++ "default_erl": 0, ++ "demo_mode_discovery": 1, ++ "demo_mode_write_protect": 1, ++ "generate_node_acls": 0, ++ "login_timeout": 15, ++ "netif_timeout": 2, ++ "prod_mode_write_protect": 0, ++ "t10_pi": 0, ++ "tpg_enabled_sendtargets": 1 ++ }, ++ "enable": true, ++ "luns": [ ++ { ++ "alias": "f466bcd8fb", ++ "index": 0, ++ "storage_object": "/backstores/fileio/udisks_test_iscsi3" ++ } ++ ], ++ "node_acls": [ ++ { ++ "attributes": { ++ "dataout_timeout": 3, ++ "dataout_timeout_retries": 5, ++ "default_erl": 0, ++ "nopin_response_timeout": 30, ++ "nopin_timeout": 15, ++ "random_datain_pdu_offsets": 0, ++ "random_datain_seq_offsets": 0, ++ "random_r2t_offsets": 0 ++ }, ++ "chap_password": "udisks", ++ "chap_userid": "iqn.1994-05.com.redhat:iscsi-test", ++ "chap_mutual_password": "udisks-mutual", ++ "chap_mutual_userid": "iqn.2003-01.udisks.test:iscsi-test-mutual", ++ "mapped_luns": [ ++ { ++ "alias": "2387cf5a50", ++ "index": 0, ++ "tpg_lun": 0, ++ "write_protect": false ++ } ++ ], ++ "node_wwn": "iqn.1994-05.com.redhat:iscsi-test" ++ } ++ ], ++ "parameters": { ++ "AuthMethod": "CHAP,None", ++ "DataDigest": "CRC32C,None", ++ "DataPDUInOrder": "Yes", ++ "DataSequenceInOrder": "Yes", ++ "DefaultTime2Retain": "20", ++ "DefaultTime2Wait": "2", ++ "ErrorRecoveryLevel": "0", ++ "FirstBurstLength": "65536", ++ "HeaderDigest": "CRC32C,None", ++ "IFMarkInt": "Reject", ++ "IFMarker": "No", ++ "ImmediateData": "Yes", ++ "InitialR2T": "Yes", ++ "MaxBurstLength": "262144", ++ "MaxConnections": "1", ++ "MaxOutstandingR2T": "1", ++ "MaxRecvDataSegmentLength": "8192", ++ "MaxXmitDataSegmentLength": "262144", ++ "OFMarkInt": "Reject", ++ "OFMarker": "No", ++ "TargetAlias": "LIO Target" ++ }, ++ "portals": [ ++ { ++ "ip_address": "0.0.0.0", ++ "iser": false, ++ "port": 3260 ++ } ++ ], ++ "tag": 1 ++ } ++ ], ++ "wwn": "iqn.2003-01.udisks.test:iscsi-test-mutual" ++ } ++ ] ++} +-- +1.8.3.1 + diff --git a/SOURCES/tests_distro_check_1508385.patch b/SOURCES/tests_distro_check_1508385.patch new file mode 100644 index 0000000..ec85549 --- /dev/null +++ b/SOURCES/tests_distro_check_1508385.patch @@ -0,0 +1,34 @@ +From 6ad2d39f31e9efbbd0ab4f48e5796e9d0485c59f Mon Sep 17 00:00:00 2001 +From: Vojtech Trefny +Date: Thu, 2 Nov 2017 14:00:12 +0100 +Subject: [PATCH] Fix checking for distribution and version in integration + tests + +And also don't try to run the tests if we fail to detect the +distribution and/or version. + +Resolves: rhbz#1508385 +--- + src/tests/integration-test | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/src/tests/integration-test b/src/tests/integration-test +index 019a8dc..44ddec5 100755 +--- a/src/tests/integration-test ++++ b/src/tests/integration-test +@@ -1747,7 +1747,11 @@ class MDRaid(UDisksTestCase): + def get_distro_version(): + # 3rd to 6th fields from e.g. "CPE OS Name: cpe:/o:fedoraproject:fedora:27" or "CPE OS Name: cpe:/o:centos:centos:7" + out = subprocess.check_output('hostnamectl status | grep "CPE OS Name"', shell=True).decode().strip() +- _project, distro, version = tuple(out.split(":")[3:65]) ++ try: ++ _project, distro, version = tuple(out.split(":")[3:6]) ++ except ValueError: ++ print('Failed to get distribution and version from "%s". Aborting.' % out) ++ sys.exit(1) + + return (distro, version) + +-- +1.8.3.1 + diff --git a/SOURCES/tests_dont_skip_1511974.patch b/SOURCES/tests_dont_skip_1511974.patch new file mode 100644 index 0000000..e298a52 --- /dev/null +++ b/SOURCES/tests_dont_skip_1511974.patch @@ -0,0 +1,51 @@ +From c48f2594f2cca37bc1335d354961202db7baee17 Mon Sep 17 00:00:00 2001 +From: Vratislav Podzimek +Date: Fri, 24 Nov 2017 15:16:25 +0100 +Subject: [PATCH] Do not skip integration tests on CentOS/RHEL + +The scsi_debug module doesn't seem to be causing kernel panics +anymore. + +Resolves: rhbz#1511974 +--- + src/tests/integration-test | 17 ----------------- + 1 file changed, 17 deletions(-) + +diff --git a/src/tests/integration-test b/src/tests/integration-test +index 44ddec5..f863578 100755 +--- a/src/tests/integration-test ++++ b/src/tests/integration-test +@@ -1744,17 +1744,6 @@ class MDRaid(UDisksTestCase): + # ---------------------------------------------------------------------------- + + +-def get_distro_version(): +- # 3rd to 6th fields from e.g. "CPE OS Name: cpe:/o:fedoraproject:fedora:27" or "CPE OS Name: cpe:/o:centos:centos:7" +- out = subprocess.check_output('hostnamectl status | grep "CPE OS Name"', shell=True).decode().strip() +- try: +- _project, distro, version = tuple(out.split(":")[3:6]) +- except ValueError: +- print('Failed to get distribution and version from "%s". Aborting.' % out) +- sys.exit(1) +- +- return (distro, version) +- + if __name__ == '__main__': + argparser = argparse.ArgumentParser(description='udisks2 integration test suite') + argparser.add_argument('-l', '--log-file', dest='logfile', +@@ -1763,12 +1752,6 @@ if __name__ == '__main__': + help='name of test class or method (e. g. "Drive", "FS.test_ext2")') + cli_args = argparser.parse_args() + +- distro, version = get_distro_version() +- if distro in ('centos', 'enterprise_linux'): +- print('Skipping integration tests on "%s %s".'\ +- 'SCSI debug devices causing kernel panic.' % (distro, version)) +- sys.exit(0) +- + UDisksTestCase.init(logfile=cli_args.logfile) + if cli_args.testname: + tests = unittest.TestLoader().loadTestsFromNames( +-- +1.8.3.1 + diff --git a/SOURCES/udisks-2.7.4-bd_dep_check.patch b/SOURCES/udisks-2.7.4-bd_dep_check.patch new file mode 100644 index 0000000..66c39c5 --- /dev/null +++ b/SOURCES/udisks-2.7.4-bd_dep_check.patch @@ -0,0 +1,68 @@ +From e31199054797ca8de62d9d1f32a46a58f2211159 Mon Sep 17 00:00:00 2001 +From: Vojtech Trefny +Date: Wed, 4 Oct 2017 09:24:08 +0200 +Subject: [PATCH] Use new libblockdev functionality to disable checks during + init + +Loading a plugin shouldn't fail because one of its runtime +dependecies is missing. Libblockdev can now skip dependency checks +during init and only return an error if the dependency is still +missing when a function that needs it is called. +--- + src/udisksdaemon.c | 35 ++++++++++++++++++++++------------- + 1 file changed, 22 insertions(+), 13 deletions(-) + +diff --git a/src/udisksdaemon.c b/src/udisksdaemon.c +index a15e5c42..9a013ec9 100644 +--- a/src/udisksdaemon.c ++++ b/src/udisksdaemon.c +@@ -263,27 +263,36 @@ udisks_daemon_constructed (GObject *object) + BDPluginSpec **plugin_p = NULL; + error = NULL; + +- ret = bd_try_init (plugins, NULL, NULL, &error); ++ /* Skip runtime dependency checks when initializing libblockdev. Plugin ++ shouldn't fail to load just because some if its dependencies is missing. ++ */ ++ ret = bd_switch_init_checks (FALSE, &error); + if (!ret) +- { +- if (error) + { + udisks_error ("Error initializing libblockdev library: %s (%s, %d)", + error->message, g_quark_to_string (error->domain), error->code); + g_clear_error (&error); + } +- else ++ ++ ret = bd_try_init (plugins, NULL, NULL, &error); ++ if (!ret) + { +- /* a missing plugin is okay, calling functions from it will fail, but +- until that happens, life will just be great */ +- for (plugin_p=plugins; *plugin_p; plugin_p++) +- if (!bd_is_plugin_available ((*plugin_p)->name)) +- /* TODO: log plugin names when the function below is available */ +- /* udisks_warning ("Failed to load the '%s' libblockdev plugin", */ +- /* bd_get_plugin_name ((*plugin_p)->name)); */ +- udisks_warning ("Failed to load a libblockdev plugin"); ++ if (error) ++ { ++ udisks_error ("Error initializing libblockdev library: %s (%s, %d)", ++ error->message, g_quark_to_string (error->domain), error->code); ++ g_clear_error (&error); ++ } ++ else ++ { ++ /* a missing plugin is okay, calling functions from it will fail, but ++ until that happens, life will just be great */ ++ for (plugin_p=plugins; *plugin_p; plugin_p++) ++ if (!bd_is_plugin_available ((*plugin_p)->name)) ++ udisks_warning ("Failed to load the '%s' libblockdev plugin", ++ bd_get_plugin_name ((*plugin_p)->name)); ++ } + } +- } + + daemon->authority = polkit_authority_get_sync (NULL, &error); + if (daemon->authority == NULL) diff --git a/SPECS/udisks2.spec b/SPECS/udisks2.spec index ee106fb..de77c20 100644 --- a/SPECS/udisks2.spec +++ b/SPECS/udisks2.spec @@ -5,7 +5,7 @@ %global libatasmart_version 0.17 %global dbus_version 1.4.0 %global with_gtk_doc 1 -%global libblockdev_version 2.10 +%global libblockdev_version 2.13 %define is_git %(git show > /dev/null 2>&1 && echo 1 || echo 0) %define git_hash %(git log -1 --pretty=format:"%h" || true) @@ -14,7 +14,7 @@ Name: udisks2 Summary: Disk Manager Version: 2.7.3 -Release: 6%{?dist} +Release: 8%{?dist} License: GPLv2+ Group: System Environment/Libraries URL: https://github.com/storaged-project/udisks @@ -25,6 +25,11 @@ Patch1: raid_watchers_1400056.patch Patch2: no_discard_1516697.patch Patch3: fix_thinpool_size_1534904.patch Patch4: fix_mpoin_cleanup_1384796.patch +Patch5: luks_resize_1567992.patch +Patch6: tests_distro_check_1508385.patch +Patch7: tests_dont_skip_1511974.patch +Patch8: tests_add_targetcli_config_1511986.patch +Patch9: udisks-2.7.4-bd_dep_check.patch BuildRequires: glib2-devel >= %{glib2_version} BuildRequires: gobject-introspection-devel >= %{gobject_introspection_version} @@ -145,6 +150,11 @@ dynamic library, which provides access to the udisksd daemon. %patch2 -p1 %patch3 -p1 %patch4 -p1 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 +%patch8 -p1 +%patch9 -p1 %build autoreconf -ivf @@ -256,6 +266,20 @@ udevadm trigger # Note: please don't forget the %{?dist} in the changelog. Thanks %changelog +* Tue Jul 10 2018 Tomas Bzatek - 2.7.3-8 +- Fix too strict libblockdev runtime dependency checks + Resolves: rhbz#1598430 + +* Wed Jun 20 2018 Vojtech Trefny - 2.7.3-7 +- core: Add Encrypted.Resize method + Resolves: rhbz#1567992 +- Fix checking for distribution and version in integration tests + Resolves: rhbz#1508385 +- Do not skip integration tests on CentOS/RHEL + Resolves: rhbz#1511974 +- Fix failing MDRAID integration test + Resolves: rhbz#1511986 + * Tue Feb 06 2018 Vojtech Trefny - 2.7.3-6 - Fix escaping mountpoint for the cleanup service Related: rhbz#1384796