petrov-mg commented on code in PR #10595: URL: https://github.com/apache/ignite/pull/10595#discussion_r1141030168
########## modules/platforms/cpp/core-test/src/compute_security_test.cpp: ########## @@ -0,0 +1,187 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include <boost/test/unit_test.hpp> +#include <boost/chrono.hpp> + +#include <ignite/ignition.h> +#include <ignite/test_utils.h> + +using namespace ignite; +using namespace ignite::cache; +using namespace ignite::cluster; +using namespace ignite::compute; +using namespace ignite::common::concurrent; +using namespace ignite::impl; +using namespace ignite_test; + +using namespace boost::unit_test; + +// Currently we cannot validate exceptions produced by non "affinity" compute methods +// see https://issues.apache.org/jira/browse/IGNITE-19055 +#define CHECK_COMPUTE_FAILED(doCompute) \ +{ \ + int32_t errCode = -1; \ + \ + try { \ + doCompute; \ + } \ + catch (IgniteError& err) { \ + errCode = err.GetCode(); \ + \ + if (errCode == IgniteError::IGNITE_ERR_GENERIC) { \ + BOOST_ASSERT(std::string(err.GetText()).find("Authorization failed") != std::string::npos); \ + } \ + } \ + \ + BOOST_ASSERT(errCode != -1); \ +} \ Review Comment: I had a problem to check the security error message in case authoriation fails. Here is description of the problem i'm stuck with - https://issues.apache.org/jira/browse/IGNITE-19055 I refactored the tests according to your suggestion. But all security exception message checks are now skipped. I think we can add them when IGNITE-19055 is resolved. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
