about summary refs log tree commit diff stats
path: root/crates/rocie-server/tests/_testenv
diff options
context:
space:
mode:
Diffstat (limited to 'crates/rocie-server/tests/_testenv')
-rw-r--r--crates/rocie-server/tests/_testenv/init.rs27
1 files changed, 24 insertions, 3 deletions
diff --git a/crates/rocie-server/tests/_testenv/init.rs b/crates/rocie-server/tests/_testenv/init.rs
index 9cb0b91..5318238 100644
--- a/crates/rocie-server/tests/_testenv/init.rs
+++ b/crates/rocie-server/tests/_testenv/init.rs
@@ -19,9 +19,15 @@ use std::{
     process::{self, Stdio},
 };
 
-use rocie_client::apis::configuration::Configuration;
+use rocie_client::{
+    apis::{api_set_no_auth_user_api::provision, configuration::Configuration},
+    models::{LoginInfo, UserStub},
+};
 
-use crate::{_testenv::Paths, testenv::TestEnv};
+use crate::{
+    _testenv::{Paths, log::request},
+    testenv::TestEnv,
+};
 
 macro_rules! function_name {
     () => {{
@@ -105,7 +111,22 @@ fn rocie_server_args(paths: &Paths) -> [&OsStr; 4] {
 }
 
 impl TestEnv {
-    pub(crate) fn new(name: &'static str) -> TestEnv {
+    pub(crate) async fn new(name: &'static str) -> TestEnv {
+        let env = Self::new_no_login(name);
+
+         request!(
+            env,
+            provision(UserStub {
+                description: Some("Test user, used during test runs".to_string()),
+                name: "rocie".to_string(),
+                password: "server".to_string()
+            })
+        );
+
+        env
+    }
+
+    pub(crate) fn new_no_login(name: &'static str) -> TestEnv {
         let test_dir = test_dir(name);
 
         let paths = prepare_files_and_dirs(&test_dir)