1 // 2 // Copyright (C) 2023 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/server/local_instance_helper.h" 17 18 #include "host/commands/cvd/types.h" 19 20 namespace cuttlefish { 21 namespace acloud { 22 CvdInstanceLocalTest()23CvdInstanceLocalTest::CvdInstanceLocalTest() { InitCmd(); } 24 Execute(const std::string & cmd_)25CmdResult CvdInstanceLocalTest::Execute(const std::string& cmd_) { 26 cvd_common::Envs envs; 27 CmdResult result = CmdRunner::Run(cmd_, envs); 28 29 auto cmd_stop = CmdRunner::Run("cvd stop", envs); 30 // clean up for the next test 31 CmdRunner::Run("cvd reset -y", envs); 32 33 return result; 34 } 35 InitCmd()36void CvdInstanceLocalTest::InitCmd() { 37 cvd_common::Envs envs; 38 CmdRunner::Run("cvd reset -y", envs); 39 } 40 41 } // namespace acloud 42 } // namespace cuttlefish 43