@@ -81,6 +81,8 @@ struct SmbMountHandlerTest : public ::Test
81
81
EXPECT_CALL (platform, get_username).WillOnce (Return (username));
82
82
ON_CALL (utils, contents_of).WillByDefault (Return (" irrelevant" ));
83
83
ON_CALL (utils, make_file_with_content (_, _)).WillByDefault (Return ());
84
+ EXPECT_CALL (utils, make_uuid (std::make_optional (vm.vm_name )))
85
+ .WillOnce (Return (vm_name_uuid));
84
86
EXPECT_CALL (utils, make_uuid (std::make_optional (target))).WillOnce (Return (target_uuid));
85
87
EXPECT_CALL (utils, make_uuid (std::make_optional (username.toStdString ())))
86
88
.WillOnce (Return (username_uuid));
@@ -134,6 +136,7 @@ struct SmbMountHandlerTest : public ::Test
134
136
NiceMock<mpt::MockVirtualMachine> vm{" my_instance" };
135
137
std::string source{" source" }, target{" target" };
136
138
QString target_uuid{" d02a0ba3-2170-46ac-9445-1943a0fe82e6" };
139
+ QString vm_name_uuid{" d02a0ba3-2170-46ac-9445-1943a0fe82e6" };
137
140
mp::id_mappings gid_mappings{{1 , 2 }}, uid_mappings{{5 , 6 }};
138
141
mp::VMMount mount{source, gid_mappings, uid_mappings, mp::VMMount::MountType::Native};
139
142
@@ -159,11 +162,7 @@ struct SmbMountHandlerTest : public ::Test
159
162
std::string remote_cred_file{" /tmp/.smb_credentials" };
160
163
std::string enc_key{" key" };
161
164
std::string smb_share_name =
162
- QString (" %1_%2:%3" )
163
- .arg(target_uuid, QString::fromStdString(vm.vm_name), QString::fromStdString(target))
164
- .left(80 )
165
- .toStdString();
166
-
165
+ fmt::format (" {}-{}" , vm_name_uuid.toStdString(), target_uuid.toStdString());
167
166
std::string dpkg_command{" dpkg-query --show --showformat='${db:Status-Status}' cifs-utils" };
168
167
std::string install_cifs_command{" sudo apt-get update && sudo apt-get install -y cifs-utils" };
169
168
std::string mkdir_command{" mkdir -p " + target};
0 commit comments