Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix and disable icon checks #626

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,3 +332,4 @@ It contains the following roles:
For example, since docker-container contains the Ansible scripts for creating a Docker container, and it is a very common task shared by many products, it makes sense to have it in common so it can be referred to by other products.

Whenever you create a role, if it will likely be used by other products (e.g. it's not very specific to your product), please put it under common roles, or if it's for installing some commonly used program, put it under installation.

Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ def test_chrony_server_installed(host):

def test_icons_in_docker(host):
hostuser = str(host.user().name)
desktop_path = f'/home/{hostuser}/Desktop/'
desktop_path = f'/home/{hostuser}/.shadow_launcher_app_dexterous_hand/Shadow Icons/'
script_path = f'/home/{hostuser}/.shadow_launcher_app_dexterous_hand/shadow_hand_launcher/'
save_logs_script_path = f'/home/{hostuser}/.shadow_save_log_app/save_latest_ros_logs/'
icon_attempts = {}
script_attempts = {}
icons = (
'Launch Shadow Right Hand',
'Launch Shadow Left Hand',
Expand Down Expand Up @@ -102,9 +104,24 @@ def test_icons_in_docker(host):
'close_everything'
)
for icon in icons:
assert host.file(f"{desktop_path}{icon}.desktop").exists

icon_file = f"{desktop_path}{icon}.desktop".replace(' ', '\ ')
icon_attempts[icon_file] = host.file(icon_file).exists
for script in scripts:
assert host.file(f"{script_path}{script}.sh").exists
script_file = f"{script_path}{script}.sh".replace(' ', '\ ')
script_attempts[script_file] = host.file(script_file).exists
for icon_name, exists in icon_attempts.items():
if exists:
print(f"Icon {icon_name} exists, check passed")
else:
print(f"Icon {icon_name} does not exist, check will fail")
for script_name, exists in script_attempts.items():
if exists:
print(f"Script {script_name} exists, check passed")
else:
print(f"Script {script_name} does not exist, check will fail")
save_logs_file = f"{save_logs_script_path}save-latest-ros-logs.sh"
assert host.file(save_logs_file).exists
for icon_name, exists in icon_attempts.items():
assert exists
for script_name, exists in script_attempts.items():
assert exists
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
vars:
reinstall: true
use_openvpn: false
image: public.ecr.aws/shadowrobot/dexterous-hand
tag: noetic-v1.0.21
image: public.ecr.aws/shadowrobot/ubuntu
tag: focal
nvidia_docker: false
skip_molecule_task: true
allow_auto_reboot: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ def test_docker_installed(host):

def test_icons_in_docker(host):
hostuser = str(host.user().name)
desktop_path = f'/home/{hostuser}/Desktop/'
desktop_path = f'/home/{hostuser}/.shadow_launcher_app_shadow_teleoperation_system/Shadow Icons/'
script_path = f'/home/{hostuser}/.shadow_launcher_app_shadow_teleoperation_system/shadow_hand_launcher/'
save_logs_script_path = f'/home/{hostuser}/.shadow_save_log_app/save_latest_ros_logs/'
icon_attempts = {}
script_attempts = {}
icons = (
'Launch Shadow Right Teleop',
'Shadow NUC RQT',
Expand Down Expand Up @@ -84,9 +86,24 @@ def test_icons_in_docker(host):
'close_everything'
)
for icon in icons:
assert host.file(f"{desktop_path}{icon}.desktop").exists

icon_file = f"{desktop_path}{icon}.desktop".replace(' ', '\ ')
icon_attempts[icon_file] = host.file(icon_file).exists
for script in scripts:
assert host.file(f"{script_path}{script}.sh").exists
script_file = f"{script_path}{script}.sh".replace(' ', '\ ')
script_attempts[script_file] = host.file(script_file).exists
for icon_name, exists in icon_attempts.items():
if exists:
print(f"Icon {icon_name} exists, check passed")
else:
print(f"Icon {icon_name} does not exist, check will fail")
for script_name, exists in script_attempts.items():
if exists:
print(f"Script {script_name} exists, check passed")
else:
print(f"Script {script_name} does not exist, check will fail")
save_logs_file = f"{save_logs_script_path}save-latest-ros-logs.sh"
assert host.file(save_logs_file).exists
for icon_name, exists in icon_attempts.items():
assert exists
for script_name, exists in script_attempts.items():
assert exists
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ def test_udev_files(host):

def test_icons_in_docker(host):
hostuser = str(host.user().name)
desktop_path = f'/home/{hostuser}/Desktop/'
desktop_path = f'/home/{hostuser}/.shadow_launcher_app_tactile_telerobot_system/Shadow Icons/'
script_path = f'/home/{hostuser}/.shadow_launcher_app_tactile_telerobot_system/shadow_hand_launcher/'
save_logs_script_path = f'/home/{hostuser}/.shadow_save_log_app/save_latest_ros_logs/'
icon_attempts = {}
script_attempts = {}
icons = (
'Launch Shadow Right Teleop',
'Launch Shadow Left Teleop',
Expand Down Expand Up @@ -129,9 +131,24 @@ def test_icons_in_docker(host):
'close_everything'
)
for icon in icons:
assert host.file(f"{desktop_path}{icon}.desktop").exists

icon_file = f"{desktop_path}{icon}.desktop".replace(' ', '\ ')
icon_attempts[icon_file] = host.file(icon_file).exists
for script in scripts:
assert host.file(f"{script_path}{script}.sh").exists
script_file = f"{script_path}{script}.sh".replace(' ', '\ ')
script_attempts[script_file] = host.file(script_file).exists
for icon_name, exists in icon_attempts.items():
if exists:
print(f"Icon {icon_name} exists, check passed")
else:
print(f"Icon {icon_name} does not exist, check will fail")
for script_name, exists in script_attempts.items():
if exists:
print(f"Script {script_name} exists, check passed")
else:
print(f"Script {script_name} does not exist, check will fail")
save_logs_file = f"{save_logs_script_path}save-latest-ros-logs.sh"
assert host.file(save_logs_file).exists
for icon_name, exists in icon_attempts.items():
assert exists
for script_name, exists in script_attempts.items():
assert exists
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import_playbook: ../../../teleop_deploy.yml
vars:
reinstall: true
image: public.ecr.aws/shadowrobot/dexterous-hand
tag: noetic-v1.0.21
image: public.ecr.aws/shadowrobot/ubuntu
tag: focal
nvidia_docker: false
skip_molecule_task: true
allow_auto_reboot: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@

def test_icons_in_docker(host):
hostuser = str(host.user().name)
desktop_path = f'/home/{hostuser}/Desktop/'
desktop_path = f'/home/{hostuser}/.shadow_launcher_app_tactile_telerobot_system/Shadow Icons/'
script_path = f'/home/{hostuser}/.shadow_launcher_app_tactile_telerobot_system/shadow_hand_launcher/'
save_logs_script_path = f'/home/{hostuser}/.shadow_save_log_app/save_latest_ros_logs/'
icon_attempts = {}
script_attempts = {}
icons = (
'Launch Shadow Right Teleop Simulation',
'Launch Shadow Left Teleop Simulation',
Expand Down Expand Up @@ -77,9 +79,24 @@ def test_icons_in_docker(host):
'close_everything'
)
for icon in icons:
assert host.file(f"{desktop_path}{icon}.desktop").exists

icon_file = f"{desktop_path}{icon}.desktop".replace(' ', '\ ')
icon_attempts[icon_file] = host.file(icon_file).exists
for script in scripts:
assert host.file(f"{script_path}{script}.sh").exists
script_file = f"{script_path}{script}.sh".replace(' ', '\ ')
script_attempts[script_file] = host.file(script_file).exists
for icon_name, exists in icon_attempts.items():
if exists:
print(f"Icon {icon_name} exists, check passed")
else:
print(f"Icon {icon_name} does not exist, check will fail")
for script_name, exists in script_attempts.items():
if exists:
print(f"Script {script_name} exists, check passed")
else:
print(f"Script {script_name} does not exist, check will fail")
save_logs_file = f"{save_logs_script_path}save-latest-ros-logs.sh"
assert host.file(save_logs_file).exists
for icon_name, exists in icon_attempts.items():
assert exists
for script_name, exists in script_attempts.items():
assert exists
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ lint: |
platforms:
# Adding CODEBUILD_BUILD_ID to instance name in order to allow parallel EC2 execution of tests from CodeBuild
- name: default_ec2_${CODEBUILD_BUILD_ID}
image: ami-0820357ff5cf2333d
image: ami-04fb05b6fe799fe85
instance_type: t2.micro
region: eu-west-2
vpc_id: vpc-0f8cc2cc245d57eb4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ lint: |
platforms:
# Adding CODEBUILD_BUILD_ID to instance name in order to allow parallel EC2 execution of tests from CodeBuild
- name: hand_e_empty_machine_docker_ec2_${CODEBUILD_BUILD_ID}
image: ami-0820357ff5cf2333d
image: ami-04fb05b6fe799fe85
instance_type: t2.micro
region: eu-west-2
vpc_id: vpc-0f8cc2cc245d57eb4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ lint: |
platforms:
# Adding CODEBUILD_BUILD_ID to instance name in order to allow parallel EC2 execution of tests from CodeBuild
- name: server_and_nuc_desktop_icons_docker_ec2_${CODEBUILD_BUILD_ID}
image: ami-00826bd51e68b1487
image: ami-04fb05b6fe799fe85
instance_type: t2.micro
region: eu-west-2
vpc_id: vpc-0f8cc2cc245d57eb4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ lint: |
platforms:
# Adding CODEBUILD_BUILD_ID to instance name in order to allow parallel EC2 execution of tests from CodeBuild
- name: teleop_server_desktop_icons_simulation_haptx_ec2_${CODEBUILD_BUILD_ID}
image: ami-00826bd51e68b1487
image: ami-04fb05b6fe799fe85
instance_type: t2.micro
region: eu-west-2
vpc_id: vpc-0f8cc2cc245d57eb4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ lint: |
platforms:
# Adding CODEBUILD_BUILD_ID to instance name in order to allow parallel EC2 execution of tests from CodeBuild
- name: teleop_server_check_desktop_icons_docker_ec2_${CODEBUILD_BUILD_ID}
image: ami-00826bd51e68b1487
image: ami-04fb05b6fe799fe85
instance_type: t2.micro
region: eu-west-2
vpc_id: vpc-0f8cc2cc245d57eb4
Expand All @@ -52,6 +52,8 @@ provisioner:
verifier:
name: testinfra
directory: ../../../molecule_docker/molecule/teleop_server_check_desktop_icons_docker/tests/
options:
s: true
scenario:
create_sequence:
- dependency
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ lint: |
platforms:
# Adding CODEBUILD_BUILD_ID to instance name in order to allow parallel EC2 execution of tests from CodeBuild
- name: teleop_server_desktop_icons_haptx_bimanual_ec2_${CODEBUILD_BUILD_ID}
image: ami-00826bd51e68b1487
image: ami-04fb05b6fe799fe85
instance_type: t2.micro
region: eu-west-2
vpc_id: vpc-0f8cc2cc245d57eb4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
shell_script_file_name: close_everything.sh
icon_file_name: close_icon.png
start_terminal: "false"
changed_when: false

- name: Make Create Close Everything desktop icon Trusted
shell: gio set "{{ desktop_path }}/Shadow Close Everything.desktop" "metadata::trusted" yes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@
shell_script_file_name: "{{ launch_script }}"
icon_file_name: "{{ desktop_icon_png }}"
start_terminal: "{{ launch_terminal }}"
changed_when: false

- name: Make Desktop icon trusted
shell: gio set "{{ desktop_path }}/{{ desktop_icon_path }}.desktop" "metadata::trusted" yes
when:
- ansible_distribution|string == 'Ubuntu'
- ansible_distribution_release|string == 'bionic'
- not skip_molecule_task|bool
- not skip_molecule_task|bool
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
shell_script_file_name: "'{{ launch_script }}{{ extra_vars }}'"
icon_file_name: "{{ desktop_icon_png }}"
start_terminal: "{{ launch_terminal }}"
changed_when: false

- name: Make Desktop icon trusted
shell: gio set "{{ desktop_path }}/{{ desktop_icon_path }}.desktop" "metadata::trusted" yes
Expand Down
9 changes: 9 additions & 0 deletions ansible/roles/products/common/demo-icons/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
shell_script_file_name: close_right_hand.sh
icon_file_name: close-hand-icon-right.png
start_terminal: "false"
changed_when: false
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you explain what is the effect of this?
As far as I understand this task is just creating an icon.


- name: Make Close Right Hand desktop icon Trusted
shell: gio set "{{ demo_icon_folder }}/Close Right Hand.desktop" "metadata::trusted" yes
Expand Down Expand Up @@ -107,6 +108,7 @@
shell_script_file_name: close_left_hand.sh
icon_file_name: close-hand-icon-left.png
start_terminal: "false"
changed_when: false

- name: Make Close Left Hand desktop icon Trusted
shell: gio set "{{ demo_icon_folder }}/Close Left Hand.desktop" "metadata::trusted" yes
Expand Down Expand Up @@ -146,6 +148,7 @@
shell_script_file_name: close_bimanual_hands.sh
icon_file_name: close-hand-icon-bimanual.png
start_terminal: "false"
changed_when: false

- name: Make Close bimanual Hands desktop icon Trusted
shell: gio set "{{ demo_icon_folder }}/Close Bimanual Hands.desktop" "metadata::trusted" yes
Expand Down Expand Up @@ -185,6 +188,7 @@
shell_script_file_name: open_right_hand.sh
icon_file_name: open-hand-icon-right.png
start_terminal: "false"
changed_when: false

- name: Make Open Right Hand desktop icon Trusted
shell: gio set "{{ demo_icon_folder }}/Open Right Hand.desktop" "metadata::trusted" yes
Expand Down Expand Up @@ -224,6 +228,7 @@
shell_script_file_name: open_left_hand.sh
icon_file_name: open-hand-icon-left.png
start_terminal: "false"
changed_when: false

- name: Make Open Left Hand desktop icon Trusted
shell: gio set "{{ demo_icon_folder }}//Open Left Hand.desktop" "metadata::trusted" yes
Expand Down Expand Up @@ -263,6 +268,7 @@
shell_script_file_name: open_bimanual_hands.sh
icon_file_name: open-hand-icon-bimanual.png
start_terminal: "false"
changed_when: false

- name: Make Open Bimanual Hands desktop icon Trusted
shell: gio set "{{ demo_icon_folder }}//Open Bimanual Hands.desktop" "metadata::trusted" yes
Expand Down Expand Up @@ -303,6 +309,7 @@
shell_script_file_name: demo_right_hand.sh
icon_file_name: demo-hand-icon-right.png
start_terminal: "false"
changed_when: false

- name: Make Standard Right Demo desktop icon Trusted
shell: gio set "{{ demo_icon_folder }}//Demo Right Hand.desktop" "metadata::trusted" yes
Expand Down Expand Up @@ -344,6 +351,7 @@
shell_script_file_name: demo_left_hand.sh
icon_file_name: demo-hand-icon-left.png
start_terminal: "false"
changed_when: false

- name: Make Standard Left Demo desktop icon Trusted
shell: gio set "{{ demo_icon_folder }}//Demo Left Hand.desktop" "metadata::trusted" yes
Expand Down Expand Up @@ -385,6 +393,7 @@
shell_script_file_name: demo_bimanual_hands.sh
icon_file_name: demo-hand-icon-bimanual.png
start_terminal: "false"
changed_when: false

- name: Make Standard Bimanual Demo desktop icon Trusted
shell: gio set "{{ demo_icon_folder }}//Demo Bimanual Hands.desktop" "metadata::trusted" yes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
shell_script_file_name: "{{ launch_script }}"
icon_file_name: "{{ desktop_icon_png }}"
start_terminal: "{{ launch_terminal }}"
changed_when: false

- name: Make Desktop icon trusted
shell: gio set "{{ desktop_path }}/{{ desktop_icon_path }}.desktop" "metadata::trusted" yes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,4 @@
launch_terminal: "false"
live_website_url_var: "{{ readthedocs_link }}"
file_path_var: "{{ manual_folder }}/{{ manual_filename }}"
changed_when: false
Loading