1#!/usr/bin/env python3
2#
3# Copyright (C) 2018 The Android Open Source Project
4#
5# Licensed under the Apache License, Version 2.0 (the "License"); you may not
6# use this file except in compliance with the License. You may obtain a copy of
7# the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14# License for the specific language governing permissions and limitations under
15# the License.
16"""
17Script for verifying SL4F is running on a Fuchsia device and
18can communicate to ACTS successfully.
19
20"""
21from acts.base_test import BaseTestClass
22
23from acts import asserts
24
25from acts.controllers.fuchsia_device import FuchsiaDevice
26
27
28class Sl4fSanityTest(BaseTestClass):
29    fuchsia_devices: list[FuchsiaDevice]
30
31    def setup_class(self):
32        super().setup_class()
33
34        asserts.abort_class_if(
35            len(self.fuchsia_devices) == 0,
36            "Sorry, please try verifying FuchsiaDevice is in your config file and try again."
37        )
38
39        self.log.info(
40            "Congratulations! Fuchsia controllers have been initialized successfully!"
41        )
42
43    def test_example(self):
44        for fuchsia_device in self.fuchsia_devices:
45            res = fuchsia_device.sl4f.netstack_lib.netstackListInterfaces()
46            self.log.info(res)
47        self.log.info("Congratulations! You've run your first test.")
48        return True
49