aboutsummaryrefslogtreecommitdiff
path: root/lava_scheduler_app/tests/device-types/mustang-uefi.jinja2
blob: 4105065ff414d6883fdb0265eebade2a76eafd8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
{% extends 'base.jinja2' %}
{% set boot_character_delay = 10 %}

{% block vland %}
{% endblock vland %}

{% block body %}

device_type: mustang-uefi
{% set console_device = console_device | default('ttyS0') -%}
{% set baud_rate = baud_rate | default(115200) -%}
{% set tftp_mac = tftp_mac | default('00:01:73:69:5A:EF') -%}

{# declare placeholders for use in the UI #}
{% set placeholders = [ 'tftp_mac', 'console_device', 'baud_rate'] -%}

{# allow job context override - use a different variable name, undefined if not in job context #}
{% set base_menu_interrupt_prompt = menu_interrupt_prompt | default(base_menu_interrupt_prompt) -%}
{% set base_menu_interrupt_string = menu_interrupt_string | default(base_menu_interrupt_string) -%}
{% set base_item_markup_list = item_markup | default(base_item_markup_list) -%}
{% set base_item_class = item_class | default(base_item_class) -%}
{% set base_item_separator = item_separator | default(base_item_separator) -%}
{% set base_label_class = label_class | default(base_label_class) -%}
{% set base_menu_bootloader_prompt = bootloader_prompt | default(base_menu_bootloader_prompt) -%}
{% set base_menu_boot_message = boot_message | default(base_menu_boot_message) -%}
{% set base_menu_dictionary =  menu_dictionary | default(base_menu_dictionary) -%}
{% set base_early_printk = menu_early_printk | default('earlyprintk=uart8250-32bit,0x1c020000') -%}

{# Consists of a list of dictionaries to enforce the order #}
{# tilde converts all operands to strings and concatenates in jinja2
see http://jinja.pocoo.org/docs/dev/templates/#other-operators
#}
{% set menu_action_list = [
{'item': 'Boot Manager'},
{'wait': 'Choice:'},
{'item': 'Remove Boot Device Entry', 'fallback': 'Return to Main Menu',},
{'wait': 'Delete entry'},
{'item': '{TEST_MENU_NAME}'},
{'wait': 'Choice:'},
{'item': 'Add Boot Device Entry'},
{'wait': "Select the Boot Device:"},
{'item': 'TFTP on MAC Address: ' ~ tftp_mac},
{'wait': "Get the IP address from DHCP:"},
{'enter': 'y'},
{'wait': "Get the TFTP server IP address:"},
{'enter': '{SERVER_IP}'},
{'wait': "File path of the EFI Application or the kernel :"},
{'enter': '{KERNEL}'},
{'wait': 'Is an EFI Application?'},
{'enter': 'n'},
{'wait': "Boot Type:"},
{'enter': 'f'},
{'wait': "Add an initrd:"},
{'enter': n},
{'wait': "Get the IP address from DHCP:"},
{'enter': y},
{'wait': "Get the TFTP server IP address:"},
{'enter': '{SERVER_IP}'},
{'wait': "File path of the FDT :"},
{'enter': '{DTB}'},
{'wait': 'Arguments to pass to the binary:'},
{'enter': "console=" ~ console_device ~ "," ~ baud_rate ~ " " ~ base_early_printk ~ " debug root=/dev/nfs rw " ~ base_nfsroot_args ~ " " ~ base_ip_args ~ ""},
{'wait': 'Description for this new Entry:'},
{'enter': '{TEST_MENU_NAME}'},
{'wait': "Choice:"},
{'item': 'Return to main menu'},
{'wait': "Start:"},
{'item': 'LAVA NFS Test Image'},
] -%}

{% set mustang_menu_list = mustang_menu_list | default(menu_action_list) -%}

actions:
  deploy:
    methods:
      tftp:
      ssh:
        options:
{{ ssh_options }}
        host: '{{ ssh_host|default('') }}'
        user: {{ ssh_user|default('root') }}
        port: {{ ssh_port|default(22) }}
        identity_file: {{ ssh_identity_file }}
  boot:
     connections:
       serial:
     methods:
      ssh:
      uefi-menu:
        parameters:
          interrupt_prompt: {{ base_menu_interrupt_prompt }}
          interrupt_string: '{{ base_menu_interrupt_string }}'
          item_markup:
{{ base_item_markup_list }}
          item_class: '{{ base_item_class }}'
          separator: '{{ base_item_separator }}'
          label_class: '{{ base_label_class }}'
          bootloader_prompt: '{{ base_menu_bootloader_prompt }}'
          boot_message: '{{ base_menu_boot_message }}'
        nfs:
{% for test_dict in mustang_menu_list %}
{% for select, action in test_dict.items() %}
{% if select == 'item' %}
        - select:
            items:
{# This is ugly but the limitations of the template #}
{# prevent checking for a single match in a list against another list #}
{# FIXME: may need a jinja2 extension to make this support generic #}
{# http://jinja.pocoo.org/docs/dev/extensions/ #}
{% if 'tftp_mac' in action %}
             -  '{{ action|replace('tftp_mac', tftp_mac) }}'
{% elif 'console_device' in action %}
             -  '{{ action|replace('console_device', console_device) }}'
{% elif 'baud_rate' in action %}
             -  '{{ action|replace('baud_rate', baud_rate) }}'
{% else %}
             -  '{{ action }}'
{% endif %}
{% elif select == 'enter' %}
        - select:
{% if 'tftp_mac' in action %}
            enter: {{ action|replace('tftp_mac', tftp_mac) }}
{% elif 'console_device' in action %}
            enter: {{ action|replace('console_device', console_device) }}
{% elif 'baud_rate' in action %}
            enter: {{ action|replace('baud_rate', baud_rate) }}
{% else %}
            enter: {{ action }}
{% endif %}
{% elif select == 'fallback' %}
            fallback: '{{ action }}'
{% elif select == 'wait' %}
            wait: '{{ action }}'
{% endif %}
{% endfor %}
{% endfor %}
{% endblock body %}