From 27a57c369a2cb5fb97d4e771daf0f3ccd6a3802f Mon Sep 17 00:00:00 2001 From: Lili Deng Date: Tue, 8 Oct 2024 11:16:15 +0800 Subject: [PATCH] ready platform: add mock serial console feature --- lisa/sut_orchestrator/ready.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lisa/sut_orchestrator/ready.py b/lisa/sut_orchestrator/ready.py index 5f92aff0f..45e275f77 100644 --- a/lisa/sut_orchestrator/ready.py +++ b/lisa/sut_orchestrator/ready.py @@ -1,7 +1,8 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT license. -from typing import List, Type +from pathlib import Path +from typing import List, Optional, Type from lisa import feature, features from lisa.environment import Environment @@ -31,6 +32,7 @@ class ReadyPlatform(Platform): features.IsolatedResource, features.Nfs, features.SecurityProfile, + features.SerialConsole, ] def _prepare_environment(self, environment: Environment, log: Logger) -> bool: @@ -65,3 +67,14 @@ class ReadyPlatform(Platform): def _delete_environment(self, environment: Environment, log: Logger) -> None: # ready platform doesn't support delete environment pass + + +class SerialConsole(features.SerialConsole): + def _get_console_log(self, saved_path: Optional[Path]) -> bytes: + return b"" + + def read(self) -> str: + return "" + + def write(self, data: str) -> None: + pass