1 // 2 // Copyright (C) 2022 The Android Open Source Project 3 // 4 // Licensed under the Apache License, Version 2.0 (the "License"); 5 // you may not use this file except in compliance with the License. 6 // You may obtain a copy of the License at 7 // 8 // http://www.apache.org/licenses/LICENSE-2.0 9 // 10 // Unless required by applicable law or agreed to in writing, software 11 // distributed under the License is distributed on an "AS IS" BASIS, 12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 // See the License for the specific language governing permissions and 14 // limitations under the License. 15 16 #include "host/commands/cvd/unittests/selector/parser_ids_helper.h" 17 18 #include <sys/types.h> 19 #include <unistd.h> 20 21 #include <android-base/strings.h> 22 23 #include "host/libs/config/cuttlefish_config.h" 24 25 namespace cuttlefish { 26 namespace selector { 27 InstanceIdTest()28InstanceIdTest::InstanceIdTest() { 29 auto cuttlefish_instance = GetParam().cuttlefish_instance; 30 if (cuttlefish_instance) { 31 envs_[kCuttlefishInstanceEnvVarName] = cuttlefish_instance.value(); 32 } 33 uid_ = getuid(); 34 cmd_args_ = android::base::Tokenize(GetParam().cmd_args, " "); 35 selector_args_ = android::base::Tokenize(GetParam().selector_args, " "); 36 expected_ids_ = GetParam().expected_ids; 37 expected_result_ = GetParam().expected_result; 38 requested_num_instances_ = GetParam().requested_num_instances; 39 } 40 41 } // namespace selector 42 } // namespace cuttlefish 43