Skip to content

Commit

Permalink
Merge pull request #13 from 3mdeb/move-login-info-to-seprate-file
Browse files Browse the repository at this point in the history
pikvm_comm.robot: moved default credentials to a seprate file
  • Loading branch information
macpijan committed Jun 10, 2024
2 parents 7f10215 + 691ac8f commit 6ea4695
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
7 changes: 7 additions & 0 deletions pikvm-credentials.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
*** Settings ***
Documentation Default username and password for PiKVM

*** Variables ***
${PIKVM_USERNAME}= admin
${PIKVM_PASSWORD}= admin
20 changes: 13 additions & 7 deletions pikvm_comm.robot
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Documentation This library exposes PiKVM REST API as RF keywords
Library pikvm_comm.py
Resource pikvm-credentials.robot


*** Keywords ***
Expand All @@ -12,7 +13,7 @@ Write PiKVM
... pikvm_ip - IP of the piKVM to send key input,
... login - piKVM login,
... password - piKVM password
[Arguments] ${text} ${login}=admin ${password}=admin ${press_time}=0.1
[Arguments] ${text} ${login}=${PIKVM_USERNAME} ${password}=${PIKVM_PASSWORD} ${press_time}=0.1
Write Text PiKVM ${text} ${PIKVM_IP} ${login} ${password} ${press_time}
Single Key PiKVM Enter ${login} ${password} ${press_time}

Expand All @@ -23,7 +24,7 @@ Write Bare PiKVM
... pikvm_ip - IP of the piKVM to send key input,
... login - piKVM login,
... password - piKVM password
[Arguments] ${text} ${login}=admin ${password}=admin
[Arguments] ${text} ${login}=${PIKVM_USERNAME} ${password}=${PIKVM_PASSWORD}
Write Text PiKVM ${text} ${PIKVM_IP} ${login} ${password}

Single Key PiKVM
Expand All @@ -34,7 +35,7 @@ Single Key PiKVM
... password - (str) piKVM password,
... press_time - (float) time the key will remain pressed(s),
... possible keys can be found in `lib/pikvm_comm.py`
[Arguments] ${key} ${login}=admin ${password}=admin ${press_time}=0.2
[Arguments] ${key} ${login}=${PIKVM_USERNAME} ${password}=${PIKVM_PASSWORD} ${press_time}=0.2
Send Key PiKVM ${key} ${PIKVM_IP} ${login} ${password} ${press_time}

Multiple Keys PiKVM
Expand All @@ -45,7 +46,7 @@ Multiple Keys PiKVM
... password - (str) piKVM password
... press_time - (float) time the key will remain pressed(s),
... possible keys can be found in `lib/pikvm_comm.py`
[Arguments] ${key_list} ${login}=admin ${password}=admin ${press_time}=0.1
[Arguments] ${key_list} ${login}=${PIKVM_USERNAME} ${password}=${PIKVM_PASSWORD} ${press_time}=0.1
Send Key Series PiKVM ${key_list} ${PIKVM_IP} ${login} ${password} ${press_time}

Key Combination PiKVM
Expand All @@ -56,7 +57,7 @@ Key Combination PiKVM
... password - (str) piKVM password,
... press_time - (float) time the key will remain pressed(s),
... possible keys can be found in `lib/pikvm_comm.py`
[Arguments] ${key_list} ${login}=admin ${password}=admin ${press_time}=0.2
[Arguments] ${key_list} ${login}=${PIKVM_USERNAME} ${password}=${PIKVM_PASSWORD} ${press_time}=0.2
Send Key Combination PiKVM ${key_list} ${PIKVM_IP} ${login} ${password} ${press_time}

Mount Image On PiKVM
Expand All @@ -65,7 +66,7 @@ Mount Image On PiKVM
... password - (str) piKVM password,
... pikvm_ip - (str) IP of the piKVM to mount the image on,
... img_name - (str) URL of the image to be mounted
[Arguments] ${pikvm_ip} ${img_name} ${login}=admin ${password}=admin
[Arguments] ${pikvm_ip} ${img_name} ${login}=${PIKVM_USERNAME} ${password}=${PIKVM_PASSWORD}
Mount Image PiKVM ${pikvm_ip} ${img_name} ${login} ${password}

Upload Image To PiKVM
Expand All @@ -74,5 +75,10 @@ Upload Image To PiKVM
... password - (str) piKVM password,
... pikvm_ip - (str) IP of the piKVM to mount the image on,
... img_url - (str) URL of the image to be mounted
[Arguments] ${pikvm_ip} ${img_url} ${img_name} ${login}=admin ${password}=admin
[Arguments]
... ${pikvm_ip}
... ${img_url}
... ${img_name}
... ${login}=${PIKVM_USERNAME}
... ${password}=${PIKVM_PASSWORD}
Upload Image PiKVM ${pikvm_ip} ${img_url} ${img_name} ${login} ${password}

0 comments on commit 6ea4695

Please sign in to comment.