Skip to content

Commit

Permalink
test old
Browse files Browse the repository at this point in the history
  • Loading branch information
vrbanecd committed Dec 4, 2024
1 parent ab9745c commit 140a69b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions teapot.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from os.path import exists
from pathlib import Path
from pwd import getpwnam

# from stat import S_IROTH, S_IRWXG, S_IRWXU, S_IXOTH
from stat import S_IRGRP, S_IRWXO, S_IRWXU, S_IXGRP

Expand Down Expand Up @@ -123,8 +124,8 @@ async def lifespan(app: FastAPI):
# os.chown commands.
# those are using the bit patterns provided with the "stat" module as below,
# combining them happens via bitwise OR
# TO DO: find a way to not have to use rwx for others!
STANDARD_MODE = S_IRWXU | S_IRGRP | S_IXGRP | S_IRWXO
# STANDARD_MODE = S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH
# session state is kept in this global dict for each username as primary key
# data stored within each subdict is
# pid, port, created_at, last_accessed
Expand Down Expand Up @@ -245,7 +246,13 @@ async def _create_user_dirs(username):
with open(f"{config_dir}/storage-areas", "r", encoding="utf-8") as storage_areas:
for line in storage_areas:
storage_area, path = line.split(" ")
path = os.path.expandvars(path)
# path = os.path.expandvars(path)
path_components = path.split("/")
# check for different paths in storage-areas that need to be
# corrected.
if path_components[0] == "$HOME":
path_components[0] = f"/home/{username}"
path = os.path.join(*path_components)
sa_properties_path = f"{user_sa_d_dir}/{storage_area}.properties"
if not exists(sa_properties_path):
with open(
Expand Down

1 comment on commit 140a69b

@vrbanecd
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
32 0 0 32 100 19.073661s

Passed Tests

Name ⏱️ Duration Suite
GET USER1 9.626 s Teapot-Tests
GET USER2 8.455 s Teapot-Tests
GET NO TOKEN 0.014 s Teapot-Tests
GET INVALID TOKEN 0.046 s Teapot-Tests
PUT REQUEST INVALID TOKEN 0.013 s Teapot-Tests
PUT REQUEST NO TOKEN 0.011 s Teapot-Tests
PUT REQUEST USER1 0.178 s Teapot-Tests
PUT REQUEST USER2 0.097 s Teapot-Tests
GET FILE USER1 0.061 s Teapot-Tests
GET FILE USER2 0.060 s Teapot-Tests
GET FILE NO TOKEN 0.010 s Teapot-Tests
GET FILE INVALID TOKEN 0.009 s Teapot-Tests
DELETE REQUEST USER1 0.034 s Teapot-Tests
DELETE REQUEST USER2 0.039 s Teapot-Tests
DELETE REQUEST INVALID TOKEN 0.009 s Teapot-Tests
DELETE REQUEST NO TOKEN 0.009 s Teapot-Tests
GET USER1 EXTRA_AREA 0.040 s Teapot-Tests
GET USER2 EXTRA_AREA 0.041 s Teapot-Tests
GET NO TOKEN EXTRA_AREA 0.012 s Teapot-Tests
GET INVALID TOKEN EXTRA_AREA 0.009 s Teapot-Tests
PUT REQUEST INVALID TOKEN EXTRA_AREA 0.009 s Teapot-Tests
PUT REQUEST NO TOKEN EXTRA_AREA 0.008 s Teapot-Tests
PUT REQUEST USER1 EXTRA_AREA 0.034 s Teapot-Tests
PUT REQUEST USER2 EXTRA_AREA 0.033 s Teapot-Tests
GET FILE USER1 EXTRA_AREA 0.050 s Teapot-Tests
GET FILE USER2 EXTRA_AREA 0.052 s Teapot-Tests
GET FILE NO TOKEN EXTRA_AREA 0.009 s Teapot-Tests
GET FILE INVALID TOKEN EXTRA_AREA 0.008 s Teapot-Tests
DELETE REQUEST USER1 EXTRA_AREA 0.047 s Teapot-Tests
DELETE REQUEST USER2 EXTRA_AREA 0.033 s Teapot-Tests
DELETE REQUEST INVALID TOKEN EXTRA_AREA 0.010 s Teapot-Tests
DELETE REQUEST NO TOKEN EXTRA_AREA 0.009 s Teapot-Tests

Please sign in to comment.