diff --git a/docs/test/new_module.md b/docs/test/new_module.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/test/new_test.md b/docs/test/new_test.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/framework/python/src/api/api.py b/framework/python/src/api/api.py index 139bd2dd0..1eff52525 100644 --- a/framework/python/src/api/api.py +++ b/framework/python/src/api/api.py @@ -31,7 +31,7 @@ DEVICE_TEST_MODULES_KEY = "test_modules" class Api: - """Provide REST endpoints to manage Test Run""" + """Provide REST endpoints to manage Testrun""" def __init__(self, test_run): @@ -68,7 +68,7 @@ def __init__(self, test_run): ) self._api_thread = threading.Thread(target=self._start, - name="Test Run API", + name="Testrun API", daemon=True) def start(self): @@ -128,14 +128,14 @@ async def start_test_run(self, request: Request, response: Response): device = self._session.get_device(body_json["device"]["mac_addr"]) - # Check Test Run is not already running + # Check Testrun is not already running if self._test_run.get_session().get_status() in [ "In Progress", "Waiting for Device", ]: LOGGER.debug("Testrun is already running. Cannot start another instance") response.status_code = status.HTTP_409_CONFLICT - return self._generate_msg(False, "Test Run is already running") + return self._generate_msg(False, "Testrun is already running") # Check if requested device is known in the device repository if device is None: @@ -145,17 +145,17 @@ async def start_test_run(self, request: Request, response: Response): device.firmware = body_json["device"]["firmware"] - # Check Test Run is able to start + # Check Testrun is able to start if self._test_run.get_net_orc().check_config() is False: response.status_code = status.HTTP_500_INTERNAL_SERVER_ERROR return self._generate_msg(False,"Configured interfaces are not ready for use. Ensure required interfaces are connected.") self._test_run.get_session().reset() self._test_run.get_session().set_target_device(device) - LOGGER.info(f"Starting Test Run with device target {device.manufacturer} {device.model} with MAC address {device.mac_addr}") + LOGGER.info(f"Starting Testrun with device target {device.manufacturer} {device.model} with MAC address {device.mac_addr}") thread = threading.Thread(target=self._start_test_run, - name="Test Run") + name="Testrun") thread.start() return self._test_run.get_session().to_json() @@ -169,9 +169,9 @@ def _start_test_run(self): self._test_run.start() async def stop_test_run(self): - LOGGER.debug("Received stop command. Stopping Test Run") + LOGGER.debug("Received stop command. Stopping Testrun") self._test_run.stop() - return self._generate_msg(True, "Test Run stopped") + return self._generate_msg(True, "Testrun stopped") async def get_status(self): return self._test_run.get_session().to_json() @@ -197,7 +197,7 @@ async def save_device(self, request: Request, response: Response): # Create new device device = Device() - device.mac_addr = device_json.get(DEVICE_MAC_ADDR_KEY) + device.mac_addr = device_json.get(DEVICE_MAC_ADDR_KEY).lower() device.manufacturer = device_json.get(DEVICE_MANUFACTURER_KEY) device.model = device_json.get(DEVICE_MODEL_KEY) device.device_folder = device.manufacturer + " " + device.model diff --git a/modules/ui/README.md b/modules/ui/README.md deleted file mode 100644 index cef441386..000000000 --- a/modules/ui/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# TestRunUi - -This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 16.1.3. - -## Development server - -Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files. - -## Code scaffolding - -Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. - -## Build - -Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. - -## Running unit tests - -Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). - -## Running end-to-end tests - -Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities. - -## Further help - -To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page. diff --git a/modules/ui/angular.json b/modules/ui/angular.json index 90a6df04c..f029e61e9 100644 --- a/modules/ui/angular.json +++ b/modules/ui/angular.json @@ -100,8 +100,5 @@ } } } - }, - "cli": { - "analytics": false } } diff --git a/modules/ui/nginx.conf b/modules/ui/nginx.conf deleted file mode 100644 index a31729236..000000000 --- a/modules/ui/nginx.conf +++ /dev/null @@ -1,13 +0,0 @@ -events{} -http { - include /etc/nginx/mime.types; - server { - listen 80; - server_name localhost; - root /usr/share/nginx/html; - index index.html; - location / { - try_files $uri $uri/ /index.html; - } - } -} diff --git a/modules/ui/src/app/app-routing.module.ts b/modules/ui/src/app/app-routing.module.ts index 20e8c8bbf..7624dca4b 100644 --- a/modules/ui/src/app/app-routing.module.ts +++ b/modules/ui/src/app/app-routing.module.ts @@ -1,6 +1,22 @@ +/** + * Copyright 2023 Google LLC + * + * Licensed 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 + * + * https://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. + */ import {NgModule} from '@angular/core'; import {RouterModule, Routes} from '@angular/router'; import {allowToRunTestGuard} from './guards/allow-to-run-test.guard'; +import { HashLocationStrategy, LocationStrategy } from '@angular/common'; const routes: Routes = [ { @@ -26,7 +42,8 @@ const routes: Routes = [ @NgModule({ imports: [RouterModule.forRoot(routes)], - exports: [RouterModule] + exports: [RouterModule], + providers: [{provide: LocationStrategy, useClass: HashLocationStrategy}] }) export class AppRoutingModule { } diff --git a/modules/ui/src/app/app.component.html b/modules/ui/src/app/app.component.html index 92d396d4c..d4632736c 100644 --- a/modules/ui/src/app/app.component.html +++ b/modules/ui/src/app/app.component.html @@ -1,3 +1,18 @@ +
diff --git a/modules/ui/src/app/app.component.scss b/modules/ui/src/app/app.component.scss index e882c7df2..d0a1f2cd4 100644 --- a/modules/ui/src/app/app.component.scss +++ b/modules/ui/src/app/app.component.scss @@ -1,3 +1,18 @@ +/** + * Copyright 2023 Google LLC + * + * Licensed 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 + * + * https://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. + */ @use '@angular/material' as mat; @import "../theming/colors"; diff --git a/modules/ui/src/app/app.component.spec.ts b/modules/ui/src/app/app.component.spec.ts index 024c533f2..265cf12ec 100644 --- a/modules/ui/src/app/app.component.spec.ts +++ b/modules/ui/src/app/app.component.spec.ts @@ -1,10 +1,24 @@ +/** + * Copyright 2023 Google LLC + * + * Licensed 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 + * + * https://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. + */ import {HttpClientTestingModule} from '@angular/common/http/testing'; import {ComponentFixture, fakeAsync, TestBed, tick} from '@angular/core/testing'; import {Router} from '@angular/router'; import {RouterTestingModule} from '@angular/router/testing'; import {AppComponent} from './app.component'; import {TestRunService} from './test-run.service'; -import SpyObj = jasmine.SpyObj; import {BehaviorSubject} from 'rxjs/internal/BehaviorSubject'; import {Device} from './model/device'; import {device} from './mocks/device.mock'; @@ -15,6 +29,7 @@ import {MatToolbarModule} from '@angular/material/toolbar'; import {MatSidenavModule} from '@angular/material/sidenav'; import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; import {AppRoutingModule} from './app-routing.module'; +import SpyObj = jasmine.SpyObj; describe('AppComponent', () => { let component: AppComponent; diff --git a/modules/ui/src/app/app.component.ts b/modules/ui/src/app/app.component.ts index 7e5c13b42..9b3f243e9 100644 --- a/modules/ui/src/app/app.component.ts +++ b/modules/ui/src/app/app.component.ts @@ -1,3 +1,18 @@ +/** + * Copyright 2023 Google LLC + * + * Licensed 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 + * + * https://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. + */ import {Component, OnInit, ViewChild} from '@angular/core'; import {MatIconRegistry} from '@angular/material/icon'; import {DomSanitizer} from '@angular/platform-browser'; diff --git a/modules/ui/src/app/app.module.ts b/modules/ui/src/app/app.module.ts index 0ee0dba02..89c2d3eb9 100644 --- a/modules/ui/src/app/app.module.ts +++ b/modules/ui/src/app/app.module.ts @@ -1,3 +1,18 @@ +/** + * Copyright 2023 Google LLC + * + * Licensed 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 + * + * https://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. + */ import {HttpClientModule} from '@angular/common/http'; import {NgModule} from '@angular/core'; import {MatButtonModule} from '@angular/material/button'; diff --git a/modules/ui/src/app/components/device-item/device-item.component.html b/modules/ui/src/app/components/device-item/device-item.component.html index 8db6874b7..535eb66c8 100644 --- a/modules/ui/src/app/components/device-item/device-item.component.html +++ b/modules/ui/src/app/components/device-item/device-item.component.html @@ -1,3 +1,18 @@ +