mirror of
https://github.com/Telecominfraproject/wlan-testing.git
synced 2025-11-02 03:48:09 +00:00
Merge branch 'master' into staging-wifi-2560
This commit is contained in:
479
.github/tools/generate_directory_index.py
vendored
Normal file
479
.github/tools/generate_directory_index.py
vendored
Normal file
@@ -0,0 +1,479 @@
|
||||
#!/usr/bin/env python3
|
||||
# ---
|
||||
# Copyright 2020 glowinthedark
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
#
|
||||
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
# See the License for the specific language governing permissions and limitations under the License.
|
||||
# ---
|
||||
#
|
||||
# Generate index.html files for
|
||||
# all subdirectories in a directory tree.
|
||||
|
||||
# -handle symlinked files and folders: displayed with custom icons
|
||||
|
||||
# By default only the current folder is processed.
|
||||
|
||||
# Use -r or --recursive to process nested folders.
|
||||
|
||||
import argparse
|
||||
import datetime
|
||||
import os
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from urllib.parse import quote
|
||||
|
||||
DEFAULT_OUTPUT_FILE = 'index.html'
|
||||
EXCLUDED_PATHS = ['.git']
|
||||
|
||||
|
||||
def process_dir(top_dir, opts):
|
||||
path_top_dir: Path
|
||||
path_top_dir = Path(top_dir)
|
||||
index_file = None
|
||||
|
||||
index_path = Path(path_top_dir, opts.output_file)
|
||||
|
||||
if opts.verbose:
|
||||
print(f'Traversing dir {path_top_dir.absolute()}')
|
||||
|
||||
# skip allure report dirs
|
||||
if os.path.exists(index_path) and os.path.exists(Path(path_top_dir, 'history')) and os.path.exists(Path(path_top_dir, 'data')):
|
||||
if opts.verbose:
|
||||
print(f'Skipping Allure test report dir {path_top_dir.absolute()}')
|
||||
return
|
||||
|
||||
try:
|
||||
index_file = open(index_path, 'w')
|
||||
except Exception as e:
|
||||
print('cannot create file %s %s' % (index_path, e))
|
||||
return
|
||||
|
||||
index_file.write("""<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<style>
|
||||
* { padding: 0; margin: 0; }
|
||||
|
||||
body {
|
||||
font-family: sans-serif;
|
||||
text-rendering: optimizespeed;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #006ed3;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:hover,
|
||||
h1 a:hover {
|
||||
color: #319cff;
|
||||
}
|
||||
|
||||
header,
|
||||
#summary {
|
||||
padding-left: 5%;
|
||||
padding-right: 5%;
|
||||
}
|
||||
|
||||
th:first-child,
|
||||
td:first-child {
|
||||
width: 5%;
|
||||
}
|
||||
|
||||
th:last-child,
|
||||
td:last-child {
|
||||
width: 5%;
|
||||
}
|
||||
|
||||
header {
|
||||
padding-top: 25px;
|
||||
padding-bottom: 15px;
|
||||
background-color: #f2f2f2;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 20px;
|
||||
font-weight: normal;
|
||||
white-space: nowrap;
|
||||
overflow-x: hidden;
|
||||
text-overflow: ellipsis;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
h1 a {
|
||||
color: #000;
|
||||
margin: 0 4px;
|
||||
}
|
||||
|
||||
h1 a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
h1 a:first-child {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
main {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.meta {
|
||||
font-size: 12px;
|
||||
font-family: Verdana, sans-serif;
|
||||
border-bottom: 1px solid #9C9C9C;
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
.meta-item {
|
||||
margin-right: 1em;
|
||||
}
|
||||
|
||||
#filter {
|
||||
padding: 4px;
|
||||
border: 1px solid #CCC;
|
||||
}
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
tr {
|
||||
border-bottom: 1px dashed #dadada;
|
||||
}
|
||||
|
||||
tbody tr:hover {
|
||||
background-color: #ffffec;
|
||||
}
|
||||
|
||||
th,
|
||||
td {
|
||||
text-align: left;
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
th {
|
||||
padding-top: 15px;
|
||||
padding-bottom: 15px;
|
||||
font-size: 16px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
th a {
|
||||
color: black;
|
||||
}
|
||||
|
||||
th svg {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
td {
|
||||
white-space: nowrap;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
td:nth-child(2) {
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
td:nth-child(3) {
|
||||
padding: 0 20px 0 20px;
|
||||
}
|
||||
|
||||
th:nth-child(4),
|
||||
td:nth-child(4) {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
td:nth-child(2) svg {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
td .name {
|
||||
margin-left: 1.75em;
|
||||
word-break: break-all;
|
||||
overflow-wrap: break-word;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
td .goup {
|
||||
margin-left: 1.75em;
|
||||
padding: 0;
|
||||
word-break: break-all;
|
||||
overflow-wrap: break-word;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.icon {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
tr.clickable {
|
||||
cursor: pointer;
|
||||
}
|
||||
tr.clickable a {
|
||||
display: block;
|
||||
}
|
||||
|
||||
@media (max-width: 600px) {
|
||||
|
||||
* {
|
||||
font-size: 1.06rem;
|
||||
}
|
||||
.hideable {
|
||||
display: none;
|
||||
}
|
||||
|
||||
td:nth-child(2) {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
th:nth-child(3),
|
||||
td:nth-child(3) {
|
||||
padding-right: 5%;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
h1 a {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#filter {
|
||||
max-width: 100px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" height="0" width="0" style="position: absolute;">
|
||||
<defs>
|
||||
<!-- Go-up -->
|
||||
<g id="go-up">
|
||||
<path d="M10,9V5L3,12L10,19V14.9C15,14.9 18.5,16.5 21,20C20,15 17,10 10,9Z" fill="#696969"/>
|
||||
</g>
|
||||
|
||||
<!-- Folder -->
|
||||
<g id="folder" fill-rule="nonzero" fill="none">
|
||||
<path d="M285.22 37.55h-142.6L110.9 0H31.7C14.25 0 0 16.9 0 37.55v75.1h316.92V75.1c0-20.65-14.26-37.55-31.7-37.55z" fill="#FFA000"/>
|
||||
<path d="M285.22 36H31.7C14.25 36 0 50.28 0 67.74v158.7c0 17.47 14.26 31.75 31.7 31.75H285.2c17.44 0 31.7-14.3 31.7-31.75V67.75c0-17.47-14.26-31.75-31.7-31.75z" fill="#FFCA28"/>
|
||||
</g>
|
||||
<g id="folder-shortcut" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="folder-shortcut-group" fill-rule="nonzero">
|
||||
<g id="folder-shortcut-shape">
|
||||
<path d="M285.224876,37.5486902 L142.612438,37.5486902 L110.920785,0 L31.6916529,0 C14.2612438,0 0,16.8969106 0,37.5486902 L0,112.646071 L316.916529,112.646071 L316.916529,75.0973805 C316.916529,54.4456008 302.655285,37.5486902 285.224876,37.5486902 Z" id="Shape" fill="#FFA000"></path>
|
||||
<path d="M285.224876,36 L31.6916529,36 C14.2612438,36 0,50.2838568 0,67.7419039 L0,226.451424 C0,243.909471 14.2612438,258.193328 31.6916529,258.193328 L285.224876,258.193328 C302.655285,258.193328 316.916529,243.909471 316.916529,226.451424 L316.916529,67.7419039 C316.916529,50.2838568 302.655285,36 285.224876,36 Z" id="Shape" fill="#FFCA28"></path>
|
||||
</g>
|
||||
<path d="M126.154134,250.559184 C126.850974,251.883673 127.300549,253.006122 127.772602,254.106122 C128.469442,255.206122 128.919016,256.104082 129.638335,257.002041 C130.559962,258.326531 131.728855,259 133.100057,259 C134.493737,259 135.415364,258.55102 136.112204,257.67551 C136.809044,257.002041 137.258619,255.902041 137.258619,254.577551 C137.258619,253.904082 137.258619,252.804082 137.033832,251.457143 C136.786566,249.908163 136.561779,249.032653 136.561779,248.583673 C136.089726,242.814286 135.864939,237.920408 135.864939,233.273469 C135.864939,225.057143 136.786566,217.514286 138.180246,210.846939 C139.798713,204.202041 141.889234,198.634694 144.429328,193.763265 C147.216689,188.869388 150.678411,184.873469 154.836973,181.326531 C158.995535,177.779592 163.626149,174.883673 168.481552,172.661224 C173.336954,170.438776 179.113983,168.665306 185.587852,167.340816 C192.061722,166.218367 198.760378,165.342857 205.481514,164.669388 C212.18017,164.220408 219.598146,163.995918 228.162535,163.995918 L246.055591,163.995918 L246.055591,195.514286 C246.055591,197.736735 246.752431,199.510204 248.370899,201.059184 C250.214153,202.608163 252.079886,203.506122 254.372715,203.506122 C256.463236,203.506122 258.531277,202.608163 260.172223,201.059184 L326.102289,137.797959 C327.720757,136.24898 328.642384,134.47551 328.642384,132.253061 C328.642384,130.030612 327.720757,128.257143 326.102289,126.708163 L260.172223,63.4469388 C258.553756,61.8979592 256.463236,61 254.395194,61 C252.079886,61 250.236632,61.8979592 248.393377,63.4469388 C246.77491,64.9959184 246.07807,66.7693878 246.07807,68.9918367 L246.07807,100.510204 L228.162535,100.510204 C166.863084,100.510204 129.166282,117.167347 115.274437,150.459184 C110.666301,161.54898 108.350993,175.310204 108.350993,191.742857 C108.350993,205.279592 113.903236,223.912245 124.760454,247.438776 C125.00772,248.112245 125.457294,249.010204 126.154134,250.559184 Z" id="Shape" fill="#FFFFFF" transform="translate(218.496689, 160.000000) scale(-1, 1) translate(-218.496689, -160.000000) "></path>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
<!-- File -->
|
||||
<g id="file" stroke="#000" stroke-width="25" fill="#FFF" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M13 24.12v274.76c0 6.16 5.87 11.12 13.17 11.12H239c7.3 0 13.17-4.96 13.17-11.12V136.15S132.6 13 128.37 13H26.17C18.87 13 13 17.96 13 24.12z"/>
|
||||
<path d="M129.37 13L129 113.9c0 10.58 7.26 19.1 16.27 19.1H249L129.37 13z"/>
|
||||
</g>
|
||||
<g id="file-shortcut" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="file-shortcut-group" transform="translate(13.000000, 13.000000)">
|
||||
<g id="file-shortcut-shape" stroke="#000000" stroke-width="25" fill="#FFFFFF" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M0,11.1214886 L0,285.878477 C0,292.039924 5.87498876,296.999983 13.1728373,296.999983 L225.997983,296.999983 C233.295974,296.999983 239.17082,292.039942 239.17082,285.878477 L239.17082,123.145388 C239.17082,123.145388 119.58541,2.84217094e-14 115.369423,2.84217094e-14 L13.1728576,2.84217094e-14 C5.87500907,-1.71479982e-05 0,4.96022995 0,11.1214886 Z" id="rect1171"></path>
|
||||
<path d="M116.37005,0 L116,100.904964 C116,111.483663 123.258008,120 132.273377,120 L236,120 L116.37005,0 L116.37005,0 Z" id="rect1794"></path>
|
||||
</g>
|
||||
<path d="M47.803141,294.093878 C48.4999811,295.177551 48.9495553,296.095918 49.4216083,296.995918 C50.1184484,297.895918 50.5680227,298.630612 51.2873415,299.365306 C52.2089688,300.44898 53.3778619,301 54.7490634,301 C56.1427436,301 57.0643709,300.632653 57.761211,299.916327 C58.4580511,299.365306 58.9076254,298.465306 58.9076254,297.381633 C58.9076254,296.830612 58.9076254,295.930612 58.6828382,294.828571 C58.4355724,293.561224 58.2107852,292.844898 58.2107852,292.477551 C57.7387323,287.757143 57.5139451,283.753061 57.5139451,279.95102 C57.5139451,273.228571 58.4355724,267.057143 59.8292526,261.602041 C61.44772,256.165306 63.5382403,251.610204 66.0783349,247.62449 C68.8656954,243.620408 72.3274172,240.35102 76.4859792,237.44898 C80.6445412,234.546939 85.2751561,232.177551 90.1305582,230.359184 C94.9859603,228.540816 100.76299,227.089796 107.236859,226.006122 C113.710728,225.087755 120.409385,224.371429 127.13052,223.820408 C133.829177,223.453061 141.247152,223.269388 149.811542,223.269388 L167.704598,223.269388 L167.704598,249.057143 C167.704598,250.87551 168.401438,252.326531 170.019905,253.593878 C171.86316,254.861224 173.728893,255.595918 176.021722,255.595918 C178.112242,255.595918 180.180284,254.861224 181.82123,253.593878 L247.751296,201.834694 C249.369763,200.567347 250.291391,199.116327 250.291391,197.297959 C250.291391,195.479592 249.369763,194.028571 247.751296,192.761224 L181.82123,141.002041 C180.202763,139.734694 178.112242,139 176.044201,139 C173.728893,139 171.885639,139.734694 170.042384,141.002041 C168.423917,142.269388 167.727077,143.720408 167.727077,145.538776 L167.727077,171.326531 L149.811542,171.326531 C88.5120908,171.326531 50.8152886,184.955102 36.9234437,212.193878 C32.3153075,221.267347 30,232.526531 30,245.971429 C30,257.046939 35.5522422,272.291837 46.4094607,291.540816 C46.6567266,292.091837 47.1063009,292.826531 47.803141,294.093878 Z" id="Shape-Copy" fill="#000000" fill-rule="nonzero" transform="translate(140.145695, 220.000000) scale(-1, 1) translate(-140.145695, -220.000000) "></path>
|
||||
</g>
|
||||
</g>
|
||||
</defs>
|
||||
</svg>
|
||||
<header>
|
||||
<h1>"""
|
||||
f'{path_top_dir.name}'
|
||||
"""</h1>
|
||||
</header>
|
||||
<main>
|
||||
<div class="listing">
|
||||
<table aria-describedby="summary">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>Name</th>
|
||||
<th>Size</th>
|
||||
<th class="hideable">
|
||||
Modified
|
||||
</th>
|
||||
<th class="hideable"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="clickable">
|
||||
<td></td>
|
||||
<td><a href=".."><svg width="1.5em" height="1em" version="1.1" viewBox="0 0 24 24"><use xlink:href="#go-up"></use></svg>
|
||||
<span class="goup">..</span></a></td>
|
||||
<td>—</td>
|
||||
<td class="hideable">—</td>
|
||||
<td class="hideable"></td>
|
||||
</tr>
|
||||
""")
|
||||
|
||||
# sort dirs first
|
||||
sorted_entries = sorted(path_top_dir.glob('*'), key=lambda p: (p.is_file(), p.name), reverse=True)
|
||||
|
||||
entry: Path
|
||||
for entry in sorted_entries:
|
||||
|
||||
# don't include index.html in the file listing
|
||||
if entry.name.lower() == opts.output_file.lower():
|
||||
continue
|
||||
|
||||
if entry.name.lower() in EXCLUDED_PATHS:
|
||||
continue
|
||||
|
||||
if entry.is_dir() and opts.recursive:
|
||||
process_dir(entry, opts)
|
||||
|
||||
# From Python 3.6, os.access() accepts path-like objects
|
||||
if (not entry.is_symlink()) and not os.access(str(entry), os.W_OK):
|
||||
print(f"*** WARNING *** entry {entry.absolute()} is not writable! SKIPPING!")
|
||||
continue
|
||||
if opts.verbose:
|
||||
print(f'{entry.absolute()}')
|
||||
|
||||
size_bytes = -1 ## is a folder
|
||||
size_pretty = '—'
|
||||
last_modified = '-'
|
||||
last_modified_human_readable = '-'
|
||||
last_modified_iso = ''
|
||||
try:
|
||||
if entry.is_file():
|
||||
size_bytes = entry.stat().st_size
|
||||
size_pretty = pretty_size(size_bytes)
|
||||
|
||||
if entry.is_dir() or entry.is_file():
|
||||
last_modified = datetime.datetime.fromtimestamp(entry.stat().st_mtime).replace(microsecond=0)
|
||||
last_modified_iso = last_modified.isoformat()
|
||||
last_modified_human_readable = last_modified.strftime("%c")
|
||||
|
||||
except Exception as e:
|
||||
print('ERROR accessing file name:', e, entry)
|
||||
continue
|
||||
|
||||
entry_path = str(entry.name)
|
||||
|
||||
if entry.is_dir() and not entry.is_symlink():
|
||||
entry_type = 'folder'
|
||||
if os.name not in ('nt',):
|
||||
# append trailing slash to dirs, unless it's windows
|
||||
entry_path = os.path.join(entry.name, '')
|
||||
|
||||
elif entry.is_dir() and entry.is_symlink():
|
||||
entry_type = 'folder-shortcut'
|
||||
print('dir-symlink', entry.absolute())
|
||||
|
||||
elif entry.is_file() and entry.is_symlink():
|
||||
entry_type = 'file-shortcut'
|
||||
print('file-symlink', entry.absolute())
|
||||
|
||||
else:
|
||||
entry_type = 'file'
|
||||
|
||||
index_file.write(f"""
|
||||
<tr class="file">
|
||||
<td></td>
|
||||
<td>
|
||||
<a href="{quote(entry_path)}">
|
||||
<svg width="1.5em" height="1em" version="1.1" viewBox="0 0 265 323"><use xlink:href="#{entry_type}"></use></svg>
|
||||
<span class="name">{entry.name}</span>
|
||||
</a>
|
||||
</td>
|
||||
<td data-order="{size_bytes}">{size_pretty}</td>
|
||||
<td class="hideable"><time datetime="{last_modified_iso}">{last_modified_human_readable}</time></td>
|
||||
<td class="hideable"></td>
|
||||
</tr>
|
||||
""")
|
||||
|
||||
index_file.write("""
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</main>
|
||||
</body>
|
||||
</html>""")
|
||||
if index_file:
|
||||
index_file.close()
|
||||
|
||||
|
||||
# bytes pretty-printing
|
||||
UNITS_MAPPING = [
|
||||
(1024 ** 5, ' PB'),
|
||||
(1024 ** 4, ' TB'),
|
||||
(1024 ** 3, ' GB'),
|
||||
(1024 ** 2, ' MB'),
|
||||
(1024 ** 1, ' KB'),
|
||||
(1024 ** 0, (' byte', ' bytes')),
|
||||
]
|
||||
|
||||
|
||||
def pretty_size(bytes, units=UNITS_MAPPING):
|
||||
"""Human-readable file sizes.
|
||||
|
||||
ripped from https://pypi.python.org/pypi/hurry.filesize/
|
||||
"""
|
||||
for factor, suffix in units:
|
||||
if bytes >= factor:
|
||||
break
|
||||
amount = int(bytes / factor)
|
||||
|
||||
if isinstance(suffix, tuple):
|
||||
singular, multiple = suffix
|
||||
if amount == 1:
|
||||
suffix = singular
|
||||
else:
|
||||
suffix = multiple
|
||||
return str(amount) + suffix
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser(description='''DESCRIPTION:
|
||||
Generate directory index files (recursive is OFF by default).
|
||||
Start from current dir or from folder passed as first positional argument.
|
||||
Optionally filter by file types with --filter "*.py". ''')
|
||||
|
||||
parser.add_argument('top_dir',
|
||||
nargs='?',
|
||||
action='store',
|
||||
help='top folder from which to start generating indexes, '
|
||||
'use current folder if not specified',
|
||||
default=os.getcwd())
|
||||
|
||||
parser.add_argument('--output-file', '-o',
|
||||
metavar='filename',
|
||||
default=DEFAULT_OUTPUT_FILE,
|
||||
help=f'Custom output file, by default "{DEFAULT_OUTPUT_FILE}"')
|
||||
|
||||
parser.add_argument('--recursive', '-r',
|
||||
action='store_true',
|
||||
help="recursively process nested dirs (FALSE by default)",
|
||||
required=False)
|
||||
|
||||
parser.add_argument('--verbose', '-v',
|
||||
action='store_true',
|
||||
help='***WARNING: can take longer time with complex file tree structures on slow terminals***'
|
||||
' verbosely list every processed file',
|
||||
required=False)
|
||||
|
||||
config = parser.parse_args(sys.argv[1:])
|
||||
process_dir(config.top_dir, config)
|
||||
@@ -36,6 +36,10 @@ env:
|
||||
{
|
||||
"number": "01",
|
||||
"version": "1.1.0"
|
||||
},
|
||||
{
|
||||
"number": "02",
|
||||
"version": "1.1.0"
|
||||
}
|
||||
]'
|
||||
|
||||
|
||||
7
.github/workflows/interop.yml
vendored
7
.github/workflows/interop.yml
vendored
@@ -19,6 +19,11 @@ env:
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
marker_expression:
|
||||
default: 'interop'
|
||||
description: 'Pytest marker expression that will be used to select the tests to execute'
|
||||
required: false
|
||||
|
||||
defaults:
|
||||
run:
|
||||
@@ -96,7 +101,7 @@ jobs:
|
||||
- -c
|
||||
- |
|
||||
cd tests
|
||||
pytest -m "interop_and and interop_iOS" -s -vvv --testbed=interop -o 'jobName=Github-Interop' -o 'jobNumber=${{ github.run_number }}' --skip-testrail --alluredir=/tmp/allure-results
|
||||
pytest -m "${{ github.event.inputs.marker_expression || 'interop' }}" -s -vvv --testbed=interop -o 'jobName=Github-Interop' -o 'jobNumber=${{ github.run_number }}' --skip-testrail --alluredir=/tmp/allure-results
|
||||
ret=\$?
|
||||
# sleep some time to be able to download the Allure results
|
||||
sleep 60
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
name: nightly build
|
||||
name: sanity testing
|
||||
env:
|
||||
# thirdparties
|
||||
DOCKER_SERVER: tip-tip-wlan-cloud-docker-repo.jfrog.io
|
||||
@@ -19,9 +19,9 @@ env:
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
testbed:
|
||||
default: 'basic-02'
|
||||
description: 'Testbed to test'
|
||||
testbeds:
|
||||
default: '["basic-01","basic-02"]'
|
||||
description: 'Testbed(s) to test'
|
||||
required: false
|
||||
marker_expression:
|
||||
default: 'sanity'
|
||||
@@ -117,9 +117,29 @@ jobs:
|
||||
# kubectl get pods -n tip
|
||||
# kubectl describe pods -n tip
|
||||
|
||||
generate-matrix:
|
||||
name: generate testbed matrix
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||
steps:
|
||||
- name: generate-matrix
|
||||
id: set-matrix
|
||||
run: |
|
||||
set -x
|
||||
TESTBEDS="${{ github.event.inputs.testbeds || '[\"basic-01\",\"basic-02\"]' }}"
|
||||
echo "$TESTBEDS"
|
||||
TESTBED_ARRAY=$(echo "$TESTBEDS" | jq -c 'map({"testbed":.})')
|
||||
echo "$TESTBED_ARRAY"
|
||||
echo "::set-output name=matrix::{\"include\":${TESTBED_ARRAY}}"
|
||||
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [ build ]
|
||||
needs: [ build, generate-matrix ]
|
||||
strategy:
|
||||
max-parallel: 1
|
||||
fail-fast: false
|
||||
matrix: ${{ fromJson( needs.generate-matrix.outputs.matrix ) }}
|
||||
steps:
|
||||
- name: get EKS access credentials
|
||||
run: aws eks update-kubeconfig --name ${{ env.AWS_EKS_NAME }}
|
||||
@@ -131,7 +151,15 @@ jobs:
|
||||
|
||||
- name: set job name
|
||||
id: job
|
||||
run: echo "::set-output name=name::nightly-ci-${{ github.run_number }}"
|
||||
run: echo "::set-output name=name::testing-${{ github.run_number }}"
|
||||
|
||||
- name: prepare namespace
|
||||
id: namespace
|
||||
run: |
|
||||
NAMESPACE="testing-${{ github.run_number }}-${{ matrix.testbed }}"
|
||||
kubectl create ns $NAMESPACE
|
||||
kubectl config set-context --current --namespace=$NAMESPACE
|
||||
echo "::set-output name=name::${NAMESPACE}"
|
||||
|
||||
- name: create configuration.py secret
|
||||
run: |
|
||||
@@ -160,7 +188,7 @@ jobs:
|
||||
- -c
|
||||
- |
|
||||
cd tests
|
||||
pytest -m "${{ github.event.inputs.marker_expression }}" -s -vvv --testbed="${{ github.event.inputs.testbed }}" --skip-testrail --alluredir=/tmp/allure-results
|
||||
pytest -m "${{ github.event.inputs.marker_expression || 'sanity' }}" -s -vvv --testbed="${{ matrix.testbed }}" --skip-testrail --alluredir=/tmp/allure-results
|
||||
ret=\$?
|
||||
# sleep some time to be able to download the Allure results
|
||||
sleep 60
|
||||
@@ -180,10 +208,15 @@ jobs:
|
||||
backoffLimit: 0
|
||||
EOF
|
||||
|
||||
sleep 60 # wait for the pod to come up
|
||||
# wait for pod to spawn
|
||||
sleep 1
|
||||
|
||||
podname=$(kubectl get pods --no-headers -o custom-columns=":metadata.name" -l job-name="${{ steps.job.outputs.name }}" | sed "s/pod\///")
|
||||
|
||||
kubectl wait "pod/$podname" --for condition=ready
|
||||
|
||||
#sleep 30 # wait for the pod to come up
|
||||
|
||||
until [ -s test_everything.xml ]
|
||||
do
|
||||
sleep 10
|
||||
@@ -201,31 +234,106 @@ jobs:
|
||||
exit $(kubectl get pod $podname --output="jsonpath={.status.containerStatuses[].state.terminated.exitCode}")
|
||||
|
||||
- name: print logs
|
||||
if: ${{ always() }}
|
||||
if: always()
|
||||
run: |
|
||||
podname=$(kubectl get pods --no-headers -o custom-columns=":metadata.name" -l job-name="${{ steps.job.outputs.name }}" | sed "s/pod\///")
|
||||
kubectl logs $podname
|
||||
|
||||
- name: upload Allure results as artifact
|
||||
if: ${{ always() }}
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: allure-results
|
||||
name: allure-results-${{ matrix.testbed }}
|
||||
path: allure-results
|
||||
|
||||
- name: cleanup
|
||||
if: always()
|
||||
run: |
|
||||
kubectl delete ns "${{ steps.namespace.outputs.name }}" --wait=true
|
||||
|
||||
report:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [ test, generate-matrix ]
|
||||
if: always()
|
||||
strategy:
|
||||
max-parallel: 1
|
||||
fail-fast: false
|
||||
matrix: ${{ fromJson( needs.generate-matrix.outputs.matrix ) }}
|
||||
steps:
|
||||
- name: install Allure CLI tool
|
||||
run: |
|
||||
wget https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline/${{ env.ALLURE_CLI_VERSION }}/allure-commandline-${{ env.ALLURE_CLI_VERSION }}.tgz
|
||||
tar -xzf allure-commandline-${{ env.ALLURE_CLI_VERSION }}.tgz
|
||||
|
||||
- uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: allure-results-${{ matrix.testbed }}
|
||||
path: allure-results
|
||||
|
||||
- name: checkout testing repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: wlan-testing
|
||||
|
||||
- name: get reports branch
|
||||
uses: actions/checkout@v2
|
||||
continue-on-error: true
|
||||
with:
|
||||
ref: gh-pages
|
||||
path: reports
|
||||
|
||||
- name: copy history into results
|
||||
run: |
|
||||
if [ -e "reports/sanity/${{ matrix.testbed }}/latest" ] ; then
|
||||
cp -r reports/sanity/${{ matrix.testbed }}/latest/history/ allure-results/history
|
||||
fi
|
||||
|
||||
- name: add report metadata
|
||||
run: |
|
||||
cat << EOF >> allure-results/environment.properties
|
||||
Testbed=${{ matrix.testbed }}
|
||||
Tests.CommitId=$(cd wlan-testing && git rev-parse --short HEAD)
|
||||
CiRun.Id=${{ github.run_id }}
|
||||
CiRun.Number=${{ github.run_number }}
|
||||
CiRun.Url=https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
|
||||
EOF
|
||||
|
||||
- name: generate Allure report
|
||||
if: ${{ always() }}
|
||||
run: allure-${{ env.ALLURE_CLI_VERSION }}/bin/allure generate
|
||||
|
||||
- name: upload Allure report as artifact
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: allure-report
|
||||
name: allure-report-${{ matrix.testbed }}
|
||||
path: allure-report
|
||||
|
||||
- name: cleanup
|
||||
if: ${{ always() }}
|
||||
|
||||
- name: copy new report
|
||||
if: ${{ (github.event.inputs.marker_expression || 'sanity') == 'sanity' }}
|
||||
run: |
|
||||
kubectl delete job "${{ steps.job.outputs.name }}" --wait=true --ignore-not-found=true
|
||||
kubectl delete secret configuration --wait=true --ignore-not-found=true
|
||||
mkdir -p reports/sanity/${{ matrix.testbed }}
|
||||
cp -Tr allure-report reports/sanity/${{ matrix.testbed }}/${{ github.run_number }}
|
||||
|
||||
- name: update latest symlink
|
||||
if: ${{ (github.event.inputs.marker_expression || 'sanity') == 'sanity' }}
|
||||
working-directory: reports/sanity/${{ matrix.testbed }}
|
||||
run: ln -fns ${{ github.run_number }} latest
|
||||
|
||||
- name: generate new index.html
|
||||
run: python wlan-testing/.github/tools/generate_directory_index.py -r reports
|
||||
|
||||
- name: commit reports update
|
||||
working-directory: reports
|
||||
run: |
|
||||
git config --global user.name "github-actions[bot]"
|
||||
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
|
||||
git add .
|
||||
git commit -m "Automated deployment: $(date -u)"
|
||||
|
||||
- name: push
|
||||
if: github.ref == 'refs/heads/master'
|
||||
uses: ad-m/github-push-action@v0.6.0
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branch: gh-pages
|
||||
directory: reports
|
||||
@@ -61,9 +61,9 @@ https://docs.pytest.org/en/latest/example/markers.html
|
||||
https://docs.pytest.org/en/latest/usage.html
|
||||
http://pythontesting.net/framework/pytest/pytest-introduction/
|
||||
|
||||
### Build status
|
||||
|
||||
[](https://github.com/Telecominfraproject/wlan-testing/actions/workflows/nightly.yml)
|
||||
### Test status
|
||||
[](https://github.com/Telecominfraproject/wlan-testing/actions/workflows/sanity.yml)
|
||||
[](https://github.com/Telecominfraproject/wlan-testing/actions/workflows/interop.yml)
|
||||
|
||||
### Best Practice
|
||||
|
||||
|
||||
@@ -34,11 +34,13 @@ class APNOS:
|
||||
client = self.ssh_cli_connect()
|
||||
cmd = '[ -f ~/cicd-git/ ] && echo "True" || echo "False"'
|
||||
stdin, stdout, stderr = client.exec_command(cmd)
|
||||
print(stdout.read())
|
||||
if str(stdout.read()).__contains__("False"):
|
||||
cmd = 'mkdir ~/cicd-git/'
|
||||
client.exec_command(cmd)
|
||||
cmd = '[ -f ~/cicd-git/openwrt_ctl.py ] && echo "True" || echo "False"'
|
||||
stdin, stdout, stderr = client.exec_command(cmd)
|
||||
print(stdout.read())
|
||||
if str(stdout.read()).__contains__("False"):
|
||||
print("Copying openwrt_ctl serial control Script...")
|
||||
with SCPClient(client.get_transport()) as scp:
|
||||
@@ -46,6 +48,7 @@ class APNOS:
|
||||
cmd = '[ -f ~/cicd-git/openwrt_ctl.py ] && echo "True" || echo "False"'
|
||||
stdin, stdout, stderr = client.exec_command(cmd)
|
||||
var = str(stdout.read())
|
||||
print(var)
|
||||
if var.__contains__("True"):
|
||||
allure.attach(name="openwrt_ctl Setup", body=str(var))
|
||||
print("APNOS Serial Setup OK")
|
||||
@@ -86,8 +89,6 @@ class APNOS:
|
||||
f"cmd --value \"{cmd}\" "
|
||||
stdin, stdout, stderr = client.exec_command(cmd)
|
||||
output = stdout.read()
|
||||
allure.attach(body=str("VIF Config: " + str(vif_config) + "\n" + "VIF State: " + str(vif_state)),
|
||||
name="SSID Profiles in VIF Config and VIF State: ")
|
||||
client.close()
|
||||
allure.attach(name="iwinfo Output Msg: ", body=str(output))
|
||||
allure.attach(name="iwinfo config Err Msg: ", body=str(stderr))
|
||||
@@ -147,10 +148,36 @@ class APNOS:
|
||||
info.append(":".join(mac_info_list).replace("'", ""))
|
||||
if ssid[0].split(":")[0] == "b'security":
|
||||
security = ssid[0].split(":")[1].split(",")[2].replace("]", "").replace('"', "").replace("'", "")
|
||||
info.append(security)
|
||||
print(ssid[0].split(":")[1])
|
||||
if security != "OPEN":
|
||||
security_key = ssid[0].split(":")[1].split(",")[4].replace('"', "").replace("]", "")
|
||||
if security == "WPA-PSK":
|
||||
if ssid[0].split(":")[1].split(",")[6].__contains__("1"):
|
||||
info.append("WPA")
|
||||
security_key = ssid[0].split(":")[1].split(",")[4].replace('"', "").replace("]", "")
|
||||
if ssid[0].split(":")[1].split(",")[6].__contains__("2"):
|
||||
info.append("WPA2")
|
||||
security_key = ssid[0].split(":")[1].split(",")[4].replace('"', "").replace("]", "")
|
||||
if ssid[0].split(":")[1].split(",")[6].__contains__("mixed"):
|
||||
info.append("WPA | WPA2")
|
||||
security_key = ssid[0].split(":")[1].split(",")[4].replace('"', "").replace("]", "")
|
||||
if security == "WPA-SAE":
|
||||
if ssid[0].split(":")[1].split(",")[6].__contains__("3"):
|
||||
info.append("WPA3_PERSONAL")
|
||||
security_key = ssid[0].split(":")[1].split(",")[4].replace('"', "").replace("]", "")
|
||||
if ssid[0].split(":")[1].split(",")[6].__contains__("mixed"):
|
||||
info.append("WPA3_PERSONAL")
|
||||
security_key = ssid[0].split(":")[1].split(",")[4].replace('"', "").replace("]", "")
|
||||
if security == "WPA-EAP":
|
||||
info.append("EAP-TTLS")
|
||||
security_key = ssid[0].split(":")[1].split(",")[4].replace('"', "").replace("]", "")
|
||||
if security == "WPA3-EAP":
|
||||
info.append("EAP-TTLS")
|
||||
security_key = ssid[0].split(":")[1].split(",")[4].replace('"', "").replace("]", "")
|
||||
else:
|
||||
security_key = ssid[0].split(":")[1].split(",")[4].replace('"', "").replace("]", "")
|
||||
info.append(security_key)
|
||||
else:
|
||||
info.append("OPEN")
|
||||
if ssid[0].split(":")[0] == "b'ssid":
|
||||
info.append(ssid[0].split(":")[1].replace("'", ""))
|
||||
ssid_info_list.append(info)
|
||||
@@ -241,6 +268,7 @@ class APNOS:
|
||||
f"cmd --value \"{cmd}\" "
|
||||
stdin, stdout, stderr = client.exec_command(cmd)
|
||||
output = stdout.read()
|
||||
print(output, stderr.read())
|
||||
status = output.decode('utf-8').splitlines()
|
||||
allure.attach(name="get_redirector output ", body=str(stderr))
|
||||
redirector = status[1].replace(" ", "").split("|")[1]
|
||||
@@ -253,7 +281,6 @@ class APNOS:
|
||||
return redirector
|
||||
|
||||
def run_generic_command(self, cmd=""):
|
||||
allure.attach(name="run_generic_command ", body=cmd)
|
||||
try:
|
||||
client = self.ssh_cli_connect()
|
||||
cmd = cmd
|
||||
@@ -261,30 +288,48 @@ class APNOS:
|
||||
cmd = f"cd ~/cicd-git/ && ./openwrt_ctl.py {self.owrt_args} -t {self.tty} --action " \
|
||||
f"cmd --value \"{cmd}\" "
|
||||
stdin, stdout, stderr = client.exec_command(cmd)
|
||||
input = stdin.read().decode('utf-8').splitlines()
|
||||
output = stdout.read().decode('utf-8').splitlines()
|
||||
error = stderr.read().decode('utf-8').splitlines()
|
||||
output = stdout.read()
|
||||
print(output, stderr.read())
|
||||
status = output.decode('utf-8').splitlines()
|
||||
allure.attach(name="get_redirector output ", body=str(stderr))
|
||||
redirector = status[1].replace(" ", "").split("|")[1]
|
||||
client.close()
|
||||
except Exception as e:
|
||||
print(e)
|
||||
allure.attach(name="run_generic_command - Exception ", body=str(e))
|
||||
input = "Error"
|
||||
output = "Error"
|
||||
error = "Error"
|
||||
allure.attach(name="run_generic_command ", body=input)
|
||||
allure.attach(name="run_generic_command ", body=str(output))
|
||||
allure.attach(name="run_generic_command ", body=error)
|
||||
return [input, output, error]
|
||||
allure.attach(name="get_redirector - Exception ", body=str(e))
|
||||
redirector = "Error"
|
||||
allure.attach(name="get_redirector ", body=redirector)
|
||||
return redirector
|
||||
|
||||
def logread(self):
|
||||
try:
|
||||
client = self.ssh_cli_connect()
|
||||
cmd = "logread"
|
||||
if self.mode:
|
||||
cmd = f"cd ~/cicd-git/ && ./openwrt_ctl.py {self.owrt_args} -t {self.tty} --action " \
|
||||
f"cmd --value \"{cmd}\" "
|
||||
stdin, stdout, stderr = client.exec_command(cmd)
|
||||
output = stdout.read()
|
||||
status = output.decode('utf-8').splitlines()
|
||||
logread = status
|
||||
logs = ""
|
||||
for i in logread:
|
||||
logs = logs + i + "\n"
|
||||
client.close()
|
||||
except Exception as e:
|
||||
print(e)
|
||||
logs = ""
|
||||
return logs
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
obj = {
|
||||
'jumphost': True,
|
||||
'ip': "192.168.80.99",
|
||||
'ip': "localhost",
|
||||
'username': "lanforge",
|
||||
'password': "lanforge",
|
||||
'port': 22,
|
||||
'jumphost_tty': '/dev/ttyAP1',
|
||||
'password': "pumpkin77",
|
||||
'port': 8803,
|
||||
'jumphost_tty': '/dev/ttyAP2',
|
||||
|
||||
}
|
||||
var = APNOS(credentials=obj)
|
||||
|
||||
@@ -28,17 +28,17 @@ class ConfigureController:
|
||||
def set_credentials(self, controller_data=None):
|
||||
if dict(controller_data).keys().__contains__("username") and dict(controller_data).keys().__contains__(
|
||||
"password"):
|
||||
self.configuration.username = controller_data["username"]
|
||||
self.configuration.password = controller_data["password"]
|
||||
print("Login Credentials set to custom: \n user_id: %s\n password: %s\n" % (controller_data["username"],
|
||||
controller_data["password"]))
|
||||
return True
|
||||
else:
|
||||
self.configuration.username = "support@example.com"
|
||||
self.configuration.password = "support"
|
||||
print("Login Credentials set to default: \n user_id: %s\n password: %s\n" % ("support@example.com",
|
||||
"support"))
|
||||
return False
|
||||
else:
|
||||
self.configuration.username = controller_data["username"]
|
||||
self.configuration.password = controller_data["password"]
|
||||
print("Login Credentials set to custom: \n user_id: %s\n password: %s\n" % (controller_data['userId'],
|
||||
controller_data['password']))
|
||||
return True
|
||||
|
||||
def select_controller_data(self, controller_data=None):
|
||||
if dict(controller_data).keys().__contains__("url") is None:
|
||||
@@ -103,6 +103,8 @@ class Controller(ConfigureController):
|
||||
"Authorization": "Bearer " + self.bearer._access_token
|
||||
}
|
||||
self.api_client.configuration.refresh_api_key_hook = self.refresh_instance
|
||||
self.ping_response = self.portal_ping()
|
||||
print("Portal details :: \n", self.ping_response)
|
||||
except Exception as e:
|
||||
self.bearer = False
|
||||
print(e)
|
||||
@@ -118,7 +120,7 @@ class Controller(ConfigureController):
|
||||
|
||||
def refresh_instance(self):
|
||||
# Refresh token 10 seconds before it's expiry
|
||||
if time.time() - self.token_timestamp > self.token_expiry:
|
||||
if time.time() - self.token_timestamp > self.token_expiry - 10:
|
||||
self.token_timestamp = time.time()
|
||||
print("Refreshing the controller API token")
|
||||
self.disconnect_Controller()
|
||||
@@ -134,7 +136,7 @@ class Controller(ConfigureController):
|
||||
}
|
||||
self.api_client.configuration.refresh_api_key_hook = self.refresh_instance
|
||||
self.ping_response = self.portal_ping()
|
||||
# print(self.bearer)
|
||||
print("Portal details :: \n", self.ping_response)
|
||||
if self.ping_response._application_name != 'PortalServer':
|
||||
print("Server not Reachable")
|
||||
exit()
|
||||
@@ -287,8 +289,13 @@ class ProfileUtility:
|
||||
"ssid": [],
|
||||
"ap": [],
|
||||
"radius": [],
|
||||
"rf": []
|
||||
"rf": [],
|
||||
"passpoint_osu_id_provider": [],
|
||||
"passpoint_operator": [],
|
||||
"passpoint_venue": [],
|
||||
"passpoint": []
|
||||
}
|
||||
self.profile_name_with_id = {}
|
||||
self.default_profiles = {}
|
||||
self.profile_ids = []
|
||||
|
||||
@@ -298,8 +305,13 @@ class ProfileUtility:
|
||||
"ssid": [],
|
||||
"ap": [],
|
||||
"radius": [],
|
||||
"rf": []
|
||||
"rf": [],
|
||||
"passpoint_osu_id_provider": [],
|
||||
"passpoint_operator": [],
|
||||
"passpoint_venue": [],
|
||||
"passpoint": []
|
||||
}
|
||||
self.profile_name_with_id = {}
|
||||
self.default_profiles = {}
|
||||
self.profile_ids = []
|
||||
|
||||
@@ -462,9 +474,13 @@ class ProfileUtility:
|
||||
default_profile._details["rfConfigMap"]["is5GHz"]["rf"] = profile_data["name"]
|
||||
default_profile._details["rfConfigMap"]["is5GHzL"]["rf"] = profile_data["name"]
|
||||
default_profile._details["rfConfigMap"]["is5GHzU"]["rf"] = profile_data["name"]
|
||||
# for i in profile_data['rfConfigMap']:
|
||||
# for j in profile_data['rfConfigMap'][i]:
|
||||
# default_profile._details["rfConfigMap"][i][j] = profile_data['rfConfigMap'][i][j]
|
||||
for i in default_profile._details["rfConfigMap"]:
|
||||
for j in profile_data:
|
||||
if i == j:
|
||||
for k in default_profile._details["rfConfigMap"][i]:
|
||||
for l in profile_data[j]:
|
||||
if l == k:
|
||||
default_profile._details["rfConfigMap"][i][l] = profile_data[j][l]
|
||||
profile = self.profile_client.create_profile(body=default_profile)
|
||||
self.profile_creation_ids['rf'].append(profile._id)
|
||||
return profile
|
||||
@@ -482,6 +498,13 @@ class ProfileUtility:
|
||||
default_profile._details["rfConfigMap"]["is5GHzL"]["rf"] = profile_data["name"]
|
||||
default_profile._details["rfConfigMap"]["is5GHzU"]["rf"] = profile_data["name"]
|
||||
default_profile._name = profile_data["name"]
|
||||
for i in default_profile._details["rfConfigMap"]:
|
||||
for j in profile_data:
|
||||
if i == j:
|
||||
for k in default_profile._details["rfConfigMap"][i]:
|
||||
for l in profile_data[j]:
|
||||
if l == k:
|
||||
default_profile._details["rfConfigMap"][i][l] = profile_data[j][l]
|
||||
profile = self.profile_client.create_profile(body=default_profile)
|
||||
self.profile_creation_ids['rf'].append(profile._id)
|
||||
return profile
|
||||
@@ -508,6 +531,7 @@ class ProfileUtility:
|
||||
profile_id = profile._id
|
||||
self.profile_creation_ids['ssid'].append(profile_id)
|
||||
self.profile_ids.append(profile_id)
|
||||
self.profile_name_with_id[profile_data["ssid_name"]] = profile_id
|
||||
except Exception as e:
|
||||
print(e)
|
||||
profile = "error"
|
||||
@@ -798,6 +822,258 @@ class ProfileUtility:
|
||||
profile = False
|
||||
return profile
|
||||
|
||||
def __get_boolean(self, flag):
|
||||
return 'true' if flag in ["Enabled", "True"] else 'false'
|
||||
|
||||
# wpa eap general method
|
||||
def __create_wpa_eap_passpoint_ssid_profiles(self, profile_data=None, secure_mode=None):
|
||||
try:
|
||||
if profile_data is None or secure_mode is None:
|
||||
return False
|
||||
default_profile = self.default_profiles["ssid"]
|
||||
default_profile._details["appliedRadios"] = profile_data["appliedRadios"]
|
||||
default_profile._name = profile_data["profile_name"]
|
||||
default_profile._details["vlanId"] = profile_data["vlan"]
|
||||
default_profile._details["ssid"] = profile_data["ssid_name"]
|
||||
default_profile._details["forwardMode"] = profile_data["mode"]
|
||||
default_profile._details["radiusServiceId"] = self.profile_creation_ids["radius"][0]
|
||||
default_profile._child_profile_ids = self.profile_creation_ids["radius"]
|
||||
default_profile._details["secureMode"] = secure_mode
|
||||
profile = self.profile_client.create_profile(body=default_profile)
|
||||
profile_id = profile._id
|
||||
self.profile_creation_ids["ssid"].append(profile_id)
|
||||
self.profile_ids.append(profile_id)
|
||||
self.profile_name_with_id[profile_data["ssid_name"]] = profile_id
|
||||
except Exception as e:
|
||||
print(e)
|
||||
profile = False
|
||||
return profile
|
||||
|
||||
# wpa eap passpoint
|
||||
def create_wpa_eap_passpoint_ssid_profile(self, profile_data=None):
|
||||
if profile_data is None:
|
||||
return False
|
||||
return self.__create_wpa_eap_passpoint_ssid_profiles(profile_data, "wpaEAP")
|
||||
|
||||
# wpa2 eap passpoint
|
||||
def create_wpa2_eap_passpoint_ssid_profile(self, profile_data=None):
|
||||
if profile_data is None:
|
||||
return False
|
||||
return self.__create_wpa_eap_passpoint_ssid_profiles(profile_data, "wpa2EAP")
|
||||
|
||||
# wpa2only eap passpoint
|
||||
def create_wpa2_only_eap_passpoint_ssid_profile(self, profile_data=None):
|
||||
if profile_data is None:
|
||||
return False
|
||||
return self.__create_wpa_eap_passpoint_ssid_profiles(profile_data, "wpa2OnlyEAP")
|
||||
|
||||
# passpoint osu id provider profile
|
||||
def create_passpoint_osu_id_provider_profile(self, profile_data=None):
|
||||
try:
|
||||
if profile_data is None:
|
||||
return False
|
||||
default_profile = dict()
|
||||
default_profile["model_type"] = "Profile"
|
||||
default_profile["customerId"] = self.sdk_client.customer_id
|
||||
default_profile["profileType"] = "passpoint_osu_id_provider"
|
||||
default_profile["name"] = profile_data["profile_name"]
|
||||
details = dict()
|
||||
details["model_type"] = "PasspointOsuProviderProfile"
|
||||
mcc_mnc = dict()
|
||||
if (profile_data["mcc"] and profile_data["mnc"]) is not None:
|
||||
mcc_mnc = {"mcc": profile_data["mcc"], "mnc": profile_data["mnc"]}
|
||||
if profile_data["network"] is not None:
|
||||
mcc_mnc["network"] = profile_data["network"]
|
||||
if mcc_mnc:
|
||||
details["mccMncList"] = [mcc_mnc]
|
||||
if (profile_data["mcc"] and profile_data["mnc"]) is not None:
|
||||
details["mccMncList"] = [{"mcc": profile_data["mcc"], "mnc": profile_data["mnc"]}]
|
||||
if profile_data["osu_nai_standalone"] is not None:
|
||||
details["osuNaiStandalone"] = profile_data["osu_nai_standalone"]
|
||||
if profile_data["osu_nai_shared"] is not None:
|
||||
details["osuNaiShared"] = profile_data["osu_nai_shared"]
|
||||
if profile_data["nai_realms"] is not None:
|
||||
details["naiRealmList"] = [{"naiRealms": [profile_data["nai_realms"]["domain"]],
|
||||
"encoding": profile_data["nai_realms"]["encoding"],
|
||||
"eapMap": profile_data["nai_realms"]["eap_map"]
|
||||
}]
|
||||
details["roamingOi"] = profile_data["roaming_oi"]
|
||||
default_profile['details'] = details
|
||||
default_profile['childProfileIds'] = []
|
||||
profile = self.profile_client.create_profile(body=default_profile)
|
||||
profile_id = profile._id
|
||||
self.profile_creation_ids["passpoint_osu_id_provider"].append(profile_id)
|
||||
self.profile_ids.append(profile_id)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
profile = False
|
||||
return profile
|
||||
|
||||
# passpoint operator profile
|
||||
def create_passpoint_operator_profile(self, profile_data=None):
|
||||
try:
|
||||
if profile_data is None:
|
||||
return False
|
||||
default_profile = dict()
|
||||
default_profile["model_type"] = "Profile"
|
||||
default_profile["customerId"] = self.sdk_client.customer_id
|
||||
default_profile["profileType"] = "passpoint_operator"
|
||||
default_profile["name"] = profile_data["profile_name"]
|
||||
|
||||
default_profile["details"] = dict()
|
||||
default_profile["details"]["model_type"] = "PasspointOperatorProfile"
|
||||
default_profile["details"]["serverOnlyAuthenticatedL2EncryptionNetwork"] = \
|
||||
self.__get_boolean(profile_data["osen"])
|
||||
operator_names = []
|
||||
operators = profile_data["operator_names"]
|
||||
for operator in profile_data["operator_names"]:
|
||||
operator_temp = dict()
|
||||
for key in operator.keys():
|
||||
if key == "name":
|
||||
operator_temp["dupleName"] = operator["name"]
|
||||
else:
|
||||
operator_temp[key] = operator[key]
|
||||
operator_names.append(operator_temp)
|
||||
default_profile["details"]["operatorFriendlyName"] = operator_names
|
||||
default_profile["details"]["domainNameList"] = profile_data["domain_name_list"]
|
||||
default_profile["childProfileIds"] = []
|
||||
profile = self.profile_client.create_profile(body=default_profile)
|
||||
profile_id = profile._id
|
||||
self.profile_creation_ids["passpoint_operator"].append(profile_id)
|
||||
self.profile_ids.append(profile_id)
|
||||
except Exception as e:
|
||||
profile = False
|
||||
return profile
|
||||
|
||||
# passpoint venue profile
|
||||
def create_passpoint_venue_profile(self, profile_data=None):
|
||||
try:
|
||||
if profile_data is None:
|
||||
return False
|
||||
default_profile = dict()
|
||||
default_profile["model_type"] = "Profile"
|
||||
default_profile["customerId"] = self.sdk_client.customer_id
|
||||
default_profile["profileType"] = "passpoint_venue"
|
||||
default_profile["name"] = profile_data["profile_name"]
|
||||
default_profile["details"] = dict()
|
||||
default_profile["details"]["model_type"] = "PasspointVenueProfile"
|
||||
venue_names = []
|
||||
for venue in profile_data["venue_names"]:
|
||||
venue_temp = dict()
|
||||
for key in venue.keys():
|
||||
if key == "name":
|
||||
venue_temp["dupleName"] = venue["name"]
|
||||
if key == "url":
|
||||
venue_temp["venueUrl"] = venue["url"]
|
||||
venue_names.append(venue_temp)
|
||||
default_profile["details"]["venueNameSet"] = venue_names
|
||||
allowed_venue_groups = {"Unspecified": 0, "Assembly": 1, "Business": 2, "Educational": 3,
|
||||
"Factory and Industrial": 4, "Institutional": 5, "Mercantile": 6, "Residential": 7}
|
||||
allowed_venue_types = {"Unspecified Assembly": 0, "Areana": 1, "Stadium": 2, "Passenger Terminal": 3,
|
||||
"Amphitheatre": 4, "Amusement Park": 5, "Place of Worship": 6,
|
||||
"Convention Center": 7,
|
||||
"Library": 8, "Museum": 9, "Restaurant": 10, "Theatre": 11, "Bar": 12,
|
||||
"Coffee Shop": 13,
|
||||
"Zoo or Aquarium": 14, "Emergency Coordination Center": 15,
|
||||
"Unspecified Business": 0, "Doctor or Dentist office": 1, "Bank": 2,
|
||||
"Fire Station": 3,
|
||||
"Police Station": 4, "Post Office": 5, "Professional Office": 6,
|
||||
"Research and Development Facility": 7, "Attorney Office": 8,
|
||||
"Unspecified Educational": 0, "School, Primary": 1, "School, Secondary": 2,
|
||||
"University or College": 3, "Unspecified Factory and Industrial": 0, "Factory": 1,
|
||||
"Unspecified Institutional": 0, "Hospital": 1, "Long-Term Care Facility": 2,
|
||||
"Alcohol and Drug Re-habilitation Center": 3, "Group Home": 4, "Prison or Jail": 5,
|
||||
"Unspecified Mercantile": 0, "Retail Store": 1, "Grocery Market": 2,
|
||||
"Automotive Service Station": 3, "Shopping Mall": 4, "Gas Station": 5,
|
||||
"Unspecified Residential": 0, "Pivate Residence": 1, "Hotel or Model": 2,
|
||||
"Dormitory": 3, "Boarding House": 4}
|
||||
default_profile["details"]["venueTypeAssignment"] = {"venueGroupId":
|
||||
allowed_venue_groups[
|
||||
profile_data["venue_type"]["group"]],
|
||||
"venueTypeId":
|
||||
allowed_venue_types[
|
||||
profile_data["venue_type"]["type"]]}
|
||||
default_profile["childProfileIds"] = []
|
||||
profile = self.profile_client.create_profile(body=default_profile)
|
||||
profile_id = profile._id
|
||||
self.profile_creation_ids["passpoint_venue"].append(profile_id)
|
||||
self.profile_ids.append(profile_id)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
profile = False
|
||||
return profile
|
||||
|
||||
# passpoint profile
|
||||
def create_passpoint_profile(self, profile_data=None):
|
||||
try:
|
||||
if profile_data is None:
|
||||
return False
|
||||
default_profile = dict()
|
||||
default_profile["model_type"] = "Profile"
|
||||
default_profile["customerId"] = self.sdk_client.customer_id
|
||||
default_profile["profileType"] = "passpoint"
|
||||
default_profile["name"] = profile_data["profile_name"]
|
||||
|
||||
default_profile["details"] = dict()
|
||||
default_profile["details"]["model_type"] = "PasspointProfile"
|
||||
default_profile["details"]["enableInterworkingAndHs20"] = self.__get_boolean(
|
||||
profile_data["interworking_hs2dot0"])
|
||||
if profile_data["hessid"] is not None:
|
||||
default_profile["details"]["hessid"] = dict()
|
||||
default_profile["details"]["hessid"]["addressAsString"] = profile_data["hessid"]
|
||||
default_profile["details"]["passpointAccessNetworkType"] = \
|
||||
profile_data["access_network"]["Access Network Type"].replace(' ', '_').lower()
|
||||
default_profile["details"]["passpointNetworkAuthenticationType"] = \
|
||||
profile_data["access_network"]["Authentication Type"].replace('&', 'and').replace(' ', '_').lower()
|
||||
default_profile["details"]["emergencyServicesReachable"] = self.__get_boolean(
|
||||
profile_data["access_network"][
|
||||
"Emergency Services Reachable"])
|
||||
default_profile["details"]["unauthenticatedEmergencyServiceAccessible"] = self.__get_boolean(
|
||||
profile_data["access_network"][
|
||||
"Unauthenticated Emergency Service"])
|
||||
default_profile["details"]["internetConnectivity"] = self.__get_boolean(profile_data["ip_connectivity"][
|
||||
"Internet Connectivity"])
|
||||
capability_set = []
|
||||
for cap in profile_data["ip_connectivity"]["Connection Capability"]:
|
||||
capability_info = dict()
|
||||
capability_info["connectionCapabilitiesPortNumber"] = cap["port"]
|
||||
capability_info["connectionCapabilitiesIpProtocol"] = cap["protocol"]
|
||||
capability_info["connectionCapabilitiesStatus"] = cap["status"]
|
||||
capability_set.append(capability_info)
|
||||
default_profile["details"]["connectionCapabilitySet"] = capability_set
|
||||
default_profile["details"]["ipAddressTypeAvailability"] = profile_data["ip_connectivity"]["IP Address Type"]
|
||||
allowed_gas_address_behavior = {"P2P Spec Workaround From Request": "p2pSpecWorkaroundFromRequest",
|
||||
"forceNonCompliantBehaviourFromRequest": "forceNonCompliantBehaviourFromRequest",
|
||||
"IEEE 80211 Standard Compliant Only": "ieee80211StandardCompliantOnly"}
|
||||
default_profile["details"]["gasAddr3Behaviour"] = allowed_gas_address_behavior[
|
||||
profile_data["ip_connectivity"]
|
||||
["GAS Address 3 Behaviour"]]
|
||||
default_profile["details"]["anqpDomainId"] = profile_data["ip_connectivity"]["ANQP Domain ID"]
|
||||
default_profile["details"]["disableDownstreamGroupAddressedForwarding"] = self.__get_boolean(
|
||||
profile_data["ip_connectivity"][
|
||||
"Disable DGAF"])
|
||||
default_profile["details"]["associatedAccessSsidProfileIds"] = profile_data["allowed_ssids"]
|
||||
default_profile["details"]["passpointOperatorProfileId"] = self.profile_creation_ids["passpoint_operator"][0]
|
||||
default_profile["details"]["passpointVenueProfileId"] = self.profile_creation_ids["passpoint_venue"][0]
|
||||
default_profile["details"]["passpointOsuProviderProfileIds"] = self.profile_creation_ids[
|
||||
"passpoint_osu_id_provider"]
|
||||
default_profile["details"]["accessNetworkType"] = \
|
||||
profile_data["access_network"]["Access Network Type"].replace(' ', '_').lower()
|
||||
# osuSsidProfileId is needed for R2
|
||||
default_profile["details"]["networkAuthenticationType"] = \
|
||||
profile_data["access_network"]["Authentication Type"].replace('&', 'and').replace(' ', '_').lower()
|
||||
default_profile["childProfileIds"] = self.profile_creation_ids["passpoint_venue"] + \
|
||||
self.profile_creation_ids["passpoint_operator"] + \
|
||||
self.profile_creation_ids["passpoint_osu_id_provider"]
|
||||
profile = self.profile_client.create_profile(body=default_profile)
|
||||
profile_id = profile._id
|
||||
self.profile_creation_ids["passpoint"].append(profile_id)
|
||||
self.profile_ids.append(profile_id)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
profile = False
|
||||
return profile
|
||||
|
||||
"""
|
||||
method call: used to create a ap profile that contains the given ssid profiles
|
||||
"""
|
||||
@@ -809,7 +1085,8 @@ class ProfileUtility:
|
||||
default_profile = self.default_profiles['equipment_ap_2_radios']
|
||||
default_profile._child_profile_ids = []
|
||||
for i in self.profile_creation_ids:
|
||||
if i != 'ap':
|
||||
if i not in ["ap", "passpoint_osu_id_provider", "passpoint_operator", "passpoint_venue", "passpoint",
|
||||
"radius"]:
|
||||
for j in self.profile_creation_ids[i]:
|
||||
default_profile._child_profile_ids.append(j)
|
||||
|
||||
@@ -820,11 +1097,61 @@ class ProfileUtility:
|
||||
self.profile_ids.append(default_profile._id)
|
||||
return default_profile
|
||||
|
||||
"""
|
||||
method call: used to create a ap profile that contains the given ssid profiles
|
||||
"""
|
||||
|
||||
def set_ap_profile_custom(self, profile_data=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
if profile_data is None:
|
||||
return False
|
||||
default_profile = self.default_profiles['equipment_ap_2_radios']
|
||||
default_profile._child_profile_ids = []
|
||||
for i in self.profile_creation_ids:
|
||||
if i not in ["ap", "passpoint_osu_id_provider", "passpoint_operator", "passpoint_venue", "passpoint",
|
||||
"radius", "ssid"]:
|
||||
for j in self.profile_creation_ids[i]:
|
||||
default_profile._child_profile_ids.append(j)
|
||||
for ssid in profile_data["ssid_names"]:
|
||||
default_profile._child_profile_ids.append(self.profile_name_with_id[ssid])
|
||||
default_profile._name = profile_data['profile_name']
|
||||
default_profile = self.profile_client.create_profile(body=default_profile)
|
||||
self.profile_creation_ids['ap'] = default_profile._id
|
||||
self.profile_ids.append(default_profile._id)
|
||||
return default_profile
|
||||
|
||||
"""
|
||||
method call: used to create a ap profile that contains the specific ssid profiles
|
||||
"""
|
||||
|
||||
def update_ap_profile(self, profile_data=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
if profile_data is None:
|
||||
print("profile info is None, Please specify the profile info that you want to update")
|
||||
return False
|
||||
|
||||
child_profiles_to_apply = []
|
||||
try:
|
||||
for ssid in profile_data["ssid_names"]:
|
||||
child_profiles_to_apply.append(self.profile_name_with_id[ssid])
|
||||
default_profile = self.get_profile_by_name(profile_name=profile_data["profile_name"])
|
||||
for i in self.profile_creation_ids:
|
||||
if i not in ["ap", "passpoint_osu_id_provider", "passpoint_operator", "passpoint_venue", "passpoint",
|
||||
"radius", "ssid"]:
|
||||
for j in self.profile_creation_ids[i]:
|
||||
child_profiles_to_apply.append(j)
|
||||
default_profile._child_profile_ids = child_profiles_to_apply
|
||||
default_profile = self.profile_client.update_profile(default_profile)
|
||||
return True
|
||||
except Exception as e:
|
||||
print(e)
|
||||
return False
|
||||
|
||||
"""
|
||||
method call: used to create a radius profile with the settings given
|
||||
"""
|
||||
|
||||
def create_radius_profile(self, radius_info=None):
|
||||
def create_radius_profile(self, radius_info=None, radius_accounting_info=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
default_profile = self.default_profiles['radius']
|
||||
default_profile._name = radius_info['name']
|
||||
@@ -832,6 +1159,11 @@ class ProfileUtility:
|
||||
default_profile._details['primaryRadiusAuthServer']['ipAddress'] = radius_info['ip']
|
||||
default_profile._details['primaryRadiusAuthServer']['port'] = radius_info['port']
|
||||
default_profile._details['primaryRadiusAuthServer']['secret'] = radius_info['secret']
|
||||
if radius_accounting_info is not None:
|
||||
default_profile._details["primaryRadiusAccountingServer"] = {}
|
||||
default_profile._details["primaryRadiusAccountingServer"]["ipAddress"] = radius_accounting_info["ip"]
|
||||
default_profile._details["primaryRadiusAccountingServer"]["port"] = radius_accounting_info["port"]
|
||||
default_profile._details["primaryRadiusAccountingServer"]["secret"] = radius_accounting_info["secret"]
|
||||
default_profile = self.profile_client.create_profile(body=default_profile)
|
||||
self.profile_creation_ids['radius'] = [default_profile._id]
|
||||
self.profile_ids.append(default_profile._id)
|
||||
@@ -874,6 +1206,44 @@ class ProfileUtility:
|
||||
except Exception as e:
|
||||
return False
|
||||
|
||||
def update_ssid_profile(self, profile_info=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
if profile_info is None:
|
||||
print("profile info is None, Please specify the profile info that you want to update")
|
||||
return False
|
||||
|
||||
try:
|
||||
profile = self.get_profile_by_name(profile_name=profile_info["ssid_profile_name"])
|
||||
profile._details["radiusServiceId"] = self.profile_creation_ids["radius"][0]
|
||||
profile._child_profile_ids = self.profile_creation_ids["radius"] + self.profile_creation_ids["passpoint"]
|
||||
if "radius_configuration" in profile_info.keys():
|
||||
if "radius_acounting_service_interval" in profile_info["radius_configuration"].keys():
|
||||
profile._details["radiusAcountingServiceInterval"] = profile_info["radius_configuration"]["radius_acounting_service_interval"]
|
||||
if "user_defined_nas_id" in profile_info["radius_configuration"].keys():
|
||||
profile._details["radiusClientConfiguration"]["userDefinedNasId"] = profile_info["radius_configuration"]["user_defined_nas_id"]
|
||||
if "operator_id" in profile_info["radius_configuration"].keys():
|
||||
profile._details["radiusClientConfiguration"]["operatorId"] = profile_info["radius_configuration"]["operator_id"]
|
||||
self.profile_client.update_profile(profile)
|
||||
return True
|
||||
except Exception as e:
|
||||
print(e)
|
||||
return False
|
||||
|
||||
def clear_ssid_profile(self, profile_name=None):
|
||||
if profile_name is None:
|
||||
print("profile name is None, Please specify the ssid profile name that you want to update")
|
||||
return False
|
||||
|
||||
try:
|
||||
profile = self.get_profile_by_name(profile_name=profile_name)
|
||||
profile._details["radiusServiceId"] = None
|
||||
profile._child_profile_ids = []
|
||||
self.profile_client.update_profile(profile)
|
||||
return True
|
||||
except Exception as e:
|
||||
print(e)
|
||||
return False
|
||||
|
||||
"""
|
||||
method to delete a profile by its id
|
||||
"""
|
||||
@@ -979,7 +1349,7 @@ class FirmwareUtility:
|
||||
obj = self.equipment_gateway_client.request_firmware_update(equipment_id=equipment_id,
|
||||
firmware_version_id=firmware_id)
|
||||
print("Request firmware upgrade Success! waiting for 300 sec")
|
||||
time.sleep(300)
|
||||
time.sleep(400)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
obj = False
|
||||
@@ -1023,7 +1393,15 @@ if __name__ == '__main__':
|
||||
}
|
||||
api = Controller(controller_data=controller)
|
||||
profile = ProfileUtility(sdk_client=api)
|
||||
profile.cleanup_profiles()
|
||||
profile_data = {
|
||||
"name": "test-rf-wifi-6",
|
||||
"is2dot4GHz": {},
|
||||
"is5GHz": {"channelBandwidth": "is20MHz"},
|
||||
"is5GHzL": {"channelBandwidth": "is20MHz"},
|
||||
"is5GHzU": {"channelBandwidth": "is20MHz"}
|
||||
}
|
||||
profile.set_rf_profile(profile_data=profile_data, mode="wifi6")
|
||||
print(profile.default_profiles["rf"])
|
||||
# profile.get_default_profiles()
|
||||
# profile_data = {
|
||||
# "profile_name": "ssid_wep_2g",
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
import sys
|
||||
import os
|
||||
|
||||
import allure
|
||||
|
||||
sys.path.append(
|
||||
os.path.dirname(
|
||||
os.path.realpath(__file__)
|
||||
@@ -46,7 +48,7 @@ class RunTest:
|
||||
self.ax_prefix = lanforge_data["AX-Station-Name"]
|
||||
self.debug = debug
|
||||
self.lf_ssh_port = lanforge_data["ssh_port"]
|
||||
self.staConnect = StaConnect2(self.lanforge_ip, self.lanforge_port, debug_=debug)
|
||||
self.staConnect = None
|
||||
self.dataplane_obj = None
|
||||
self.influx_params = influx_params
|
||||
self.influxdb = RecordInflux(_lfjson_host=self.lanforge_ip,
|
||||
@@ -59,10 +61,12 @@ class RunTest:
|
||||
self.local_report_path = local_report_path
|
||||
if not os.path.exists(self.local_report_path):
|
||||
os.mkdir(self.local_report_path)
|
||||
# self.staConnect = StaConnect2(self.lanforge_ip, self.lanforge_port, debug_=self.debug)
|
||||
|
||||
def Client_Connectivity(self, ssid="[BLANK]", passkey="[BLANK]", security="open", extra_securities=[],
|
||||
station_name=[], mode="BRIDGE", vlan_id=1, band="twog"):
|
||||
"""SINGLE CLIENT CONNECTIVITY using test_connect2.py"""
|
||||
self.staConnect = StaConnect2(self.lanforge_ip, self.lanforge_port, debug_=self.debug)
|
||||
self.staConnect.sta_mode = 0
|
||||
self.staConnect.upstream_resource = 1
|
||||
if mode == "BRIDGE":
|
||||
@@ -83,13 +87,26 @@ class RunTest:
|
||||
self.staConnect.dut_security = security
|
||||
self.staConnect.station_names = station_name
|
||||
self.staConnect.runtime_secs = 40
|
||||
self.staConnect.bringup_time_sec = 60
|
||||
self.staConnect.bringup_time_sec = 80
|
||||
self.staConnect.cleanup_on_exit = True
|
||||
# self.staConnect.cleanup()
|
||||
self.staConnect.setup(extra_securities=extra_securities)
|
||||
self.staConnect.start()
|
||||
print("napping %f sec" % self.staConnect.runtime_secs)
|
||||
time.sleep(self.staConnect.runtime_secs)
|
||||
for sta_name in self.staConnect.station_names:
|
||||
try:
|
||||
station_data_str = ""
|
||||
sta_url = self.staConnect.get_station_url(sta_name)
|
||||
station_info = self.staConnect.json_get(sta_url)
|
||||
for i in station_info["interface"]:
|
||||
try:
|
||||
station_data_str = station_data_str + i + " : " + str(station_info["interface"][i]) + "\n"
|
||||
except Exception as e:
|
||||
print(e)
|
||||
allure.attach(name=str(sta_name), body=str(station_data_str))
|
||||
except Exception as e:
|
||||
print(e)
|
||||
self.staConnect.stop()
|
||||
self.staConnect.cleanup()
|
||||
run_results = self.staConnect.get_result_list()
|
||||
@@ -109,7 +126,7 @@ class RunTest:
|
||||
mode="BRIDGE", band="twog", vlan_id=100,
|
||||
station_name=[], key_mgmt="WPA-EAP",
|
||||
pairwise="NA", group="NA", wpa_psk="DEFAULT",
|
||||
ttls_passwd="nolastart",
|
||||
ttls_passwd="nolastart", ieee80211w=1,
|
||||
wep_key="NA", ca_cert="NA", eap="TTLS", identity="nolaradius"):
|
||||
self.eap_connect = TTLSTest(host=self.lanforge_ip, port=self.lanforge_port,
|
||||
sta_list=station_name, vap=False, _debug_on=self.debug)
|
||||
@@ -133,10 +150,13 @@ class RunTest:
|
||||
# self.eap_connect.sta_prefix = self.fiveg_prefix
|
||||
# self.eap_connect.resource = 1
|
||||
if eap == "TTLS":
|
||||
self.eap_connect.ieee80211w = 0
|
||||
self.eap_connect.ieee80211w = ieee80211w
|
||||
self.eap_connect.key_mgmt = key_mgmt
|
||||
self.eap_connect.station_profile.set_command_flag("add_sta", "80211u_enable", 0)
|
||||
self.eap_connect.identity = identity
|
||||
self.eap_connect.ttls_passwd = ttls_passwd
|
||||
self.eap_connect.pairwise = pairwise
|
||||
self.eap_connect.group = group
|
||||
if eap == "TLS":
|
||||
self.eap_connect.key_mgmt = "WPA-EAP-SUITE-B"
|
||||
self.eap_connect.station_profile.set_command_flag("add_sta", "80211u_enable", 0)
|
||||
@@ -151,7 +171,31 @@ class RunTest:
|
||||
self.eap_connect.sta_list = station_name
|
||||
self.eap_connect.build(extra_securities=extra_securities)
|
||||
self.eap_connect.start(station_name, True, True)
|
||||
for sta_name in station_name:
|
||||
# try:
|
||||
station_data_str = ""
|
||||
# sta_url = self.eap_connect.get_station_url(sta_name)
|
||||
# station_info = self.eap_connect.json_get(sta_url)
|
||||
station_info = self.eap_connect.json_get("port/1/1/" + sta_name)
|
||||
for i in station_info["interface"]:
|
||||
try:
|
||||
station_data_str = station_data_str + i + " : " + str(station_info["interface"][i]) + "\n"
|
||||
except Exception as e:
|
||||
print(e)
|
||||
allure.attach(name=str(sta_name), body=str(station_data_str))
|
||||
# except Exception as e:
|
||||
# print(e)
|
||||
|
||||
self.eap_connect.stop()
|
||||
endp_data = []
|
||||
for i in self.eap_connect.resulting_endpoints:
|
||||
endp_data.append(self.eap_connect.resulting_endpoints[i]["endpoint"])
|
||||
cx_data = ""
|
||||
for i in endp_data:
|
||||
for j in i:
|
||||
cx_data = cx_data + str(j) + " : " + str(i[j]) + "\n"
|
||||
cx_data = cx_data + "\n"
|
||||
allure.attach(name="cx_data", body=str(cx_data))
|
||||
self.eap_connect.cleanup(station_name)
|
||||
return self.eap_connect.passes()
|
||||
|
||||
@@ -215,14 +259,15 @@ class RunTest:
|
||||
return True
|
||||
|
||||
def dataplane(self, station_name=None, mode="BRIDGE", vlan_id=100, download_rate="85%", dut_name="TIP",
|
||||
upload_rate="0kbps", duration="1m", instance_name="test_demo",raw_data=None):
|
||||
upload_rate="0kbps", duration="1m", instance_name="test_demo", raw_data=None):
|
||||
if mode == "BRIDGE":
|
||||
self.client_connect.upstream_port = self.upstream_port
|
||||
elif mode == "NAT":
|
||||
self.client_connect.upstream_port = self.upstream_port
|
||||
else:
|
||||
self.client_connect.upstream_port = self.upstream_port + "." + str(vlan_id)
|
||||
|
||||
if raw_data == None:
|
||||
raw_data = [['pkts: MTU'], ['directions: DUT Transmit;DUT Receive'], ['traffic_types: UDP;TCP'], ["show_3s: 1"], ["show_ll_graphs: 1"], ["show_log: 1"]]
|
||||
self.dataplane_obj = DataplaneTest(lf_host=self.lanforge_ip,
|
||||
lf_port=self.lanforge_port,
|
||||
ssh_port=self.lf_ssh_port,
|
||||
@@ -239,8 +284,7 @@ class RunTest:
|
||||
duration=duration,
|
||||
dut=dut_name,
|
||||
station="1.1." + station_name[0],
|
||||
raw_lines=raw_data
|
||||
)
|
||||
raw_lines=raw_data)
|
||||
#print("raw lines",self.raw_lines)
|
||||
#[['pkts: 60'], ['cust_pkt_sz: 88 '], ['directions: DUT Receive'], ['traffic_types: TCP'], ['bandw_options: 20'], ['spatial_streams: 2']]
|
||||
|
||||
@@ -256,8 +300,9 @@ class RunTest:
|
||||
|
||||
if __name__ == '__main__':
|
||||
lanforge_data = {
|
||||
"ip": "192.168.200.81",
|
||||
"port": 8080,
|
||||
"ip": "localhost",
|
||||
"port": 8801,
|
||||
"ssh_port": 22,
|
||||
"2.4G-Radio": ["wiphy0"],
|
||||
"5G-Radio": ["wiphy1"],
|
||||
"AX-Radio": ["wiphy2"],
|
||||
@@ -267,5 +312,7 @@ if __name__ == '__main__':
|
||||
"AX-Station-Name": "ax",
|
||||
}
|
||||
obj = RunTest(lanforge_data=lanforge_data, debug=False)
|
||||
# a = obj.staConnect.json_get("/events/since/")
|
||||
# print(a)
|
||||
# print(obj.eap_connect.json_get("port/1/1/sta0000?fields=ap,ip"))
|
||||
# obj.EAP_Connect(station_name=["sta0000", "sta0001"], eap="TTLS", ssid="testing_radius")
|
||||
|
||||
@@ -35,6 +35,18 @@ def closeApp(appName, setup_perfectoMobile):
|
||||
params = {'identifier': appName}
|
||||
setup_perfectoMobile[0].execute_script('mobile:application:close', params)
|
||||
|
||||
def scrollDown(setup_perfectoMobile):
|
||||
print("Scroll Down")
|
||||
setup_perfectoMobile[1].step_start("Scroll Down")
|
||||
params2 = {}
|
||||
params2["start"] = "50%,90%"
|
||||
params2["end"] = "50%,20%"
|
||||
params2["duration"] = "4"
|
||||
time.sleep(5)
|
||||
setup_perfectoMobile[0].execute_script('mobile:touch:swipe', params2)
|
||||
time.sleep(5)
|
||||
|
||||
|
||||
def getDeviceID(setup_perfectoMobile):
|
||||
report = setup_perfectoMobile[1]
|
||||
driver = setup_perfectoMobile[0]
|
||||
@@ -406,7 +418,7 @@ def ForgetWifiConnection(request, setup_perfectoMobile, WifiName, connData):
|
||||
report.step_start("Verify if wifi is disconnected from: " + WifiName)
|
||||
WifiForget= driver.find_element_by_xpath("//*[@resource-id='com.android.settings:id/summary' and @text='Connected']/parent::*/android.widget.TextView[@text='" + WifiName + "']")
|
||||
print("Wifi Not disconnected, check xpath for: " + WifiName)
|
||||
except NoSuchElementException:
|
||||
except NoSuchElementException and Exception:
|
||||
print("Wifi Disconnected Successfully: " + WifiName)
|
||||
|
||||
else:
|
||||
@@ -430,10 +442,11 @@ def ForgetWifiConnection(request, setup_perfectoMobile, WifiName, connData):
|
||||
print("Verify if wifi is disconnected from: " + WifiName)
|
||||
try:
|
||||
report.step_start("Verify if wifi is disconnected from: " + WifiName)
|
||||
WifiForget= driver.find_element_by_xpath("//*[@resource-id='com.android.settings:id/summary' and @text='Connected']/parent::*/android.widget.TextView[@text='" + WifiName + "']")
|
||||
#WifiForget= driver.find_element_by_xpath("//*[@resource-id='com.android.settings:id/summary' and @text='Connected']/parent::*/android.widget.TextView[@text='" + WifiName + "']")
|
||||
print("Wifi Not disconnected, check xpath for: " + WifiName)
|
||||
|
||||
except NoSuchElementException:
|
||||
WifiForget = WebDriverWait(driver, 20).until(EC.presence_of_element_located((MobileBy.XPATH, "//*[@resource-id='com.android.settings:id/summary' and @text='Connected']/parent::*/android.widget.TextView[@text='" + WifiName + "']")))
|
||||
except NoSuchElementException and TimeoutException and Exception:
|
||||
assert True
|
||||
print("Wifi Disconnected Successfully: " + WifiName)
|
||||
|
||||
|
||||
@@ -615,7 +628,7 @@ def Toggle_WifiMode_android(request, setup_perfectoMobile, WifiName, connData):
|
||||
WifiNameElement3 = WebDriverWait(driver, 35).until(EC.presence_of_element_located((MobileBy.XPATH, "//*[@resource-id='android:id/summary']")))
|
||||
Wifi_AP_Name3 = WifiNameElement3.text
|
||||
print("Current Wifi Status Name: " + Wifi_AP_Name3)
|
||||
except NoSuchElementException:
|
||||
except NoSuchElementException and TimeoutException:
|
||||
Wifi_AP_Name3="Null"
|
||||
print("Device did not connect back to Wifi: " + WifiName)
|
||||
|
||||
@@ -682,4 +695,201 @@ def verifyUploadDownloadSpeed_android(request, setup_perfectoMobile, get_APToMob
|
||||
print("Access Point Verification NOT Completed, checking Connection....")
|
||||
|
||||
return currentResult
|
||||
|
||||
|
||||
def downloadInstallOpenRoamingProfile(request, profileDownloadURL, setup_perfectoMobile, connData):
|
||||
print("\n-------------------------------------")
|
||||
print("Installing Android Profile ")
|
||||
print("-------------------------------------")
|
||||
|
||||
OpenRoamingWifiName = ""
|
||||
|
||||
report = setup_perfectoMobile[1]
|
||||
driver = setup_perfectoMobile[0]
|
||||
|
||||
driver.switch_to.context('WEBVIEW_1')
|
||||
|
||||
print("Launching Safari with OpenRoaming Profile")
|
||||
report.step_start("Open Roaming Download Page")
|
||||
driver.get(profileDownloadURL)
|
||||
|
||||
try:
|
||||
print("Accept Popup")
|
||||
report.step_start("Accept Popup")
|
||||
driver.switch_to.context('NATIVE_APP')
|
||||
WebDriverWait(driver, 40).until(EC.alert_is_present(), 'Time out confirmation popup to appear')
|
||||
alert = driver.switch_to.alert
|
||||
alert.accept()
|
||||
print("Alert Accepted")
|
||||
except TimeoutException:
|
||||
print("no alert")
|
||||
#//*[@resource-id="android:id/button1"]
|
||||
#Open Settings Application
|
||||
#openApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile)
|
||||
|
||||
def deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile, connData):
|
||||
print("\n-----------------------------")
|
||||
print("Delete Open Roaming Profile")
|
||||
print("-----------------------------")
|
||||
|
||||
report = setup_perfectoMobile[1]
|
||||
driver = setup_perfectoMobile[0]
|
||||
|
||||
report.step_start("Switching Driver Context")
|
||||
print("Switching Context to Native")
|
||||
driver.switch_to.context('NATIVE_APP')
|
||||
contexts = driver.contexts
|
||||
|
||||
#Open Settings Application
|
||||
openApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
|
||||
deviceModelName = getDeviceModelName(setup_perfectoMobile)
|
||||
|
||||
if deviceModelName!=("Pixel 4"):
|
||||
#Not a pixel Device
|
||||
print ("Selected Device Model: " + deviceModelName)
|
||||
report.step_start("Forget Profile: " + profileName)
|
||||
|
||||
# three dotss
|
||||
#//*[@resource-id='com.android.settings:id/round_corner']
|
||||
try:
|
||||
print("Click Connections")
|
||||
report.step_start("Click Connections")
|
||||
connElement = driver.find_element_by_xpath("//*[@text='Connections']")
|
||||
connElement.click()
|
||||
except NoSuchElementException:
|
||||
print("Exception: Verify Xpath - Update/check Xpath for Click Connections")
|
||||
|
||||
try:
|
||||
report.step_start("Clicking Wi-Fi")
|
||||
wifiElement = driver.find_element_by_xpath("//*[@text='Wi-Fi']")
|
||||
wifiElement.click()
|
||||
except NoSuchElementException:
|
||||
print("Exception: Clicking Wi-Fi - Update/check Xpath for Click Wifi Connection ")
|
||||
|
||||
try:
|
||||
print ("Click Advanced Menu 3 Dot")
|
||||
report.step_start("Click Advanced Menu 3 Dot")
|
||||
ThreeDotMenuBtn = driver.find_element_by_xpath("//*[@content-desc='More options']")
|
||||
ThreeDotMenuBtn.click()
|
||||
except NoSuchElementException:
|
||||
print("Exception: Click Advanced Menu Not Loaded")
|
||||
|
||||
# Click Advanced
|
||||
# //*[@text='Advanced']
|
||||
try:
|
||||
print ("Click Advanced")
|
||||
report.step_start("Click Advanced")
|
||||
AdvBtn = driver.find_element_by_xpath("//*[@text='Advanced']")
|
||||
AdvBtn.click()
|
||||
except NoSuchElementException:
|
||||
print("Exception: Click Advanced")
|
||||
|
||||
#Scroll Down
|
||||
scrollDown(setup_perfectoMobile)
|
||||
|
||||
#Click HotSpot
|
||||
#//*[@text="Hotspot 2.0"]
|
||||
try:
|
||||
print ("Click HotSpot")
|
||||
report.step_start("Click HotSpot")
|
||||
HotSpotBtn = driver.find_element_by_xpath("//*[@text='Hotspot 2.0']")
|
||||
HotSpotBtn.click()
|
||||
except NoSuchElementException:
|
||||
print("Exception: Click HotSpot")
|
||||
|
||||
#Click Ameriband
|
||||
#//*[@text="Ameriband"]
|
||||
try:
|
||||
print ("Click Ameriband")
|
||||
report.step_start("Click Ameriband")
|
||||
AmeribandXpath = "//*[@text='Ameriband']"
|
||||
AmeribandBtn = WebDriverWait(driver, 25).until(EC.presence_of_element_located((MobileBy.XPATH, AmeribandXpath)))
|
||||
AmeribandBtn.click()
|
||||
|
||||
except NoSuchElementException and TimeoutException and Exception:
|
||||
report.step_start("Exception: Profile Don't Exist")
|
||||
print("Exception: Profile Don't Exist")
|
||||
|
||||
#Click Forget
|
||||
#//*[@resource-id="com.android.settings:id/icon"]
|
||||
try:
|
||||
print ("Click Forget")
|
||||
report.step_start("Click Forget")
|
||||
ForgetBTN = driver.find_element_by_xpath("//*[@resource-id='com.android.settings:id/icon']")
|
||||
ForgetBTN.click()
|
||||
except NoSuchElementException:
|
||||
print("Exception: Click Forget")
|
||||
|
||||
#Click Forget Confirm
|
||||
#//*[@resource-id="android:id/button1"]
|
||||
try:
|
||||
print ("Click Forget Confirm")
|
||||
report.step_start("Click Forget Confirm")
|
||||
ForgetConfirm = driver.find_element_by_xpath("//*[@resource-id='android:id/button1']")
|
||||
ForgetConfirm.click()
|
||||
except NoSuchElementException:
|
||||
print("Exception: Click Forget Confirm")
|
||||
|
||||
else:
|
||||
#Pixel Device
|
||||
print ("Pixel Device Not supported: " + deviceModelName)
|
||||
report.step_start("Pixel Device Not supported: ")
|
||||
assert False
|
||||
|
||||
closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
|
||||
def verify_APconnMobileDevice_Android(request, profileNameSSID, setup_perfectoMobile, connData):
|
||||
print("\n-----------------------------")
|
||||
print("Verify Connected Network ")
|
||||
print("-----------------------------")
|
||||
|
||||
report = setup_perfectoMobile[1]
|
||||
driver = setup_perfectoMobile[0]
|
||||
|
||||
report.step_start("Switching Driver Context")
|
||||
print("Switching Context to Native")
|
||||
driver.switch_to.context('NATIVE_APP')
|
||||
contexts = driver.contexts
|
||||
|
||||
#Open Settings Application
|
||||
openApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
|
||||
deviceModelName = getDeviceModelName(setup_perfectoMobile)
|
||||
|
||||
if deviceModelName!=("Pixel 4"):
|
||||
#Not a pixel Device
|
||||
print ("Selected Device Model: " + deviceModelName)
|
||||
|
||||
report.step_start("Click Connections")
|
||||
try:
|
||||
print("Click Connections")
|
||||
report.step_start("Click Connections")
|
||||
connElement = driver.find_element_by_xpath("//*[@text='Connections']")
|
||||
connElement.click()
|
||||
except NoSuchElementException:
|
||||
print("Exception: Verify Xpath - Update/check Xpath for Click Connections")
|
||||
|
||||
print("Clicking Wi-Fi")
|
||||
report.step_start("Clicking Wi-Fi")
|
||||
wifiElement = driver.find_element_by_xpath("//*[@text='Wi-Fi']")
|
||||
wifiElement.click()
|
||||
|
||||
try:
|
||||
print("Verify if Wifi is Connected to: " + profileNameSSID)
|
||||
report.step_start("Verify if Wifi is Connected: " + profileNameSSID)
|
||||
#WifiInternetErrMsg = driver.find_element_by_xpath("//*[@resource-id='com.android.settings:id/summary' and @text='Connected']/parent::*/android.widget.TextView[@text='" + profileNameSSID + "']")
|
||||
WifiInternetErrMsg = driver.find_element_by_xpath("//*[@resource-id='com.android.settings:id/summary' and @text='Connected']/parent::*/android.widget.TextView[@text='Ameriband']")
|
||||
print("Wifi Successfully Connected")
|
||||
|
||||
except NoSuchElementException:
|
||||
print("Wifi Connection Error: " + profileNameSSID)
|
||||
report.step_start("Wifi Connection Error: " + profileNameSSID)
|
||||
assert False
|
||||
|
||||
else:
|
||||
#Pixel Device
|
||||
print ("Pixel Device Not supported: " + deviceModelName)
|
||||
report.step_start("Pixel Device Not supported: ")
|
||||
assert False
|
||||
|
||||
closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
|
||||
@@ -31,15 +31,16 @@ def openApp(appName, setup_perfectoMobile):
|
||||
setup_perfectoMobile[0].execute_script('mobile:application:open', params)
|
||||
|
||||
def scrollDown(setup_perfectoMobile):
|
||||
#print("Refreshing App: " + appName)
|
||||
print("Scroll Down")
|
||||
setup_perfectoMobile[1].step_start("Scroll Down")
|
||||
params = {'start': "40%,90%"}
|
||||
params = {'end': "40%,20%"}
|
||||
params = {'duration': "2"}
|
||||
#Open/Close/Open Action is performed to ensure the app is back to its Original Settings
|
||||
setup_perfectoMobile[0].execute_script('mobile:application:swipe', params)
|
||||
params2 = {}
|
||||
params2["start"] = "50%,90%"
|
||||
params2["end"] = "50%,20%"
|
||||
params2["duration"] = "4"
|
||||
time.sleep(5)
|
||||
setup_perfectoMobile[0].execute_script('mobile:touch:swipe', params2)
|
||||
time.sleep(5)
|
||||
|
||||
|
||||
def closeApp(appName, setup_perfectoMobile):
|
||||
#print("Closing App.." + appName)
|
||||
setup_perfectoMobile[1].step_start("Closing App: " + appName)
|
||||
@@ -52,7 +53,7 @@ def rebootPhone(setup_perfectoMobile):
|
||||
params = {}
|
||||
setup_perfectoMobile[0].execute_script('mobile:handset:reboot', params)
|
||||
|
||||
def set_APconnMobileDevice_iOS(request, WifiName, WifiPass, setup_perfectoMobile, connData):
|
||||
def set_APconnMobileDevice_iOS(request, WifiNameSSID, WifiPass, setup_perfectoMobile, connData):
|
||||
consoleOutput = ""
|
||||
|
||||
print("\n-------------------------------------")
|
||||
@@ -67,12 +68,13 @@ def set_APconnMobileDevice_iOS(request, WifiName, WifiPass, setup_perfectoMobile
|
||||
|
||||
report.step_start("Switching Driver Context")
|
||||
print("Switching Context to Native")
|
||||
contexts = driver.contexts
|
||||
#contexts = driver.contexts
|
||||
#print(contexts)
|
||||
driver.switch_to.context('NATIVE_APP')
|
||||
#driver.switch_to.context(contexts[0])
|
||||
|
||||
driver.switch_to.context(contexts[0])
|
||||
|
||||
report.step_start("Set Wifi Network to " + WifiName)
|
||||
print(WifiNameSSID)
|
||||
report.step_start("Set Wifi Network to " + WifiNameSSID)
|
||||
#Open Settings Application
|
||||
openApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile)
|
||||
|
||||
@@ -87,7 +89,7 @@ def set_APconnMobileDevice_iOS(request, WifiName, WifiPass, setup_perfectoMobile
|
||||
#print("Wifi Name Matches - Already Connected To: " + Wifi_AP_Name)
|
||||
#print("Wifi Name Matches - Already Connected To: " + WifiName)
|
||||
|
||||
if Wifi_AP_Name.__eq__(WifiName):
|
||||
if Wifi_AP_Name.__eq__(WifiNameSSID):
|
||||
print("Wifi Name Matches - Already Connected To: " + Wifi_AP_Name)
|
||||
|
||||
#Verify if Ap is connected with Wifi
|
||||
@@ -115,13 +117,13 @@ def set_APconnMobileDevice_iOS(request, WifiName, WifiPass, setup_perfectoMobile
|
||||
print("No Error with Wifi-AP Connection: " + Wifi_AP_Name)
|
||||
|
||||
else:
|
||||
print("Selecting Wifi: " + WifiName)
|
||||
print("Selecting Wifi: " + WifiNameSSID)
|
||||
#consoleOutput+=str(WifiName)+ "\n"
|
||||
report.step_start("Selecting Wifi...: " + WifiName)
|
||||
report.step_start("Selecting Wifi...: " + WifiNameSSID)
|
||||
element = driver.find_element_by_xpath("//XCUIElementTypeCell[@name='Wi-Fi']/XCUIElementTypeStaticText[2]")
|
||||
element.click()
|
||||
try:
|
||||
wifiXpath2 = WebDriverWait(driver, 30).until(EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='"+ WifiName + "']")))
|
||||
wifiXpath2 = WebDriverWait(driver, 30).until(EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='"+ WifiNameSSID + "']")))
|
||||
wifiXpath2.click()
|
||||
except Exception as e:
|
||||
print("Exception on Selecting Wifi Network. Please check wifi Name or signal")
|
||||
@@ -147,7 +149,9 @@ def set_APconnMobileDevice_iOS(request, WifiName, WifiPass, setup_perfectoMobile
|
||||
reportFlag = False
|
||||
except NoSuchElementException:
|
||||
reportFlag = True
|
||||
print("No Wifi-AP Error Internet Error: " + WifiName)
|
||||
print("No Wifi-AP Error Internet Error: " + WifiNameSSID)
|
||||
#Need to add Wait for Selected Wifi Xpath
|
||||
time.sleep(3)
|
||||
return reportFlag
|
||||
|
||||
def Toggle_AirplaneMode_iOS(request, setup_perfectoMobile, connData):
|
||||
@@ -220,32 +224,47 @@ def verify_APconnMobileDevice_iOS(request, WifiName, setup_perfectoMobile, connD
|
||||
|
||||
#Verifies if AP is connected to Wifi status
|
||||
try:
|
||||
# print("Verifying Connected Wifi Connection")
|
||||
wifiXpath2 = WebDriverWait(driver, 30).until(EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='"+ WifiName + "']")))
|
||||
wifiXpath2.click()
|
||||
print("Get Connected Wifi Name")
|
||||
report.step_start("Get Connected Wifi Name")
|
||||
element = WebDriverWait(driver, 45).until(EC.presence_of_element_located((MobileBy.XPATH, "//XCUIElementTypeCell[@name='Wi-Fi']/XCUIElementTypeStaticText[2]")))
|
||||
#element = driver.find_element_by_xpath("")
|
||||
element.click()
|
||||
|
||||
report.step_start("Verifying Connected Wifi Connection")
|
||||
element = driver.find_element_by_xpath("//XCUIElementTypeCell[@name='Wi-Fi']/XCUIElementTypeStaticText[2]")
|
||||
Wifi_AP_Name = element.text
|
||||
|
||||
except Exception as e:
|
||||
print("Exception on Selecting Wifi Network. Please check wifi Name or signal")
|
||||
request.config.cache.set(key="SelectingWifiFailed", value=str(e))
|
||||
#allure.attach(name="Raj", body="hello world")
|
||||
assert False
|
||||
print("Verifying if SSID Wifi Shows up")
|
||||
report.step_start("Verifying if SSID Wifi Shows up")
|
||||
wifiXpath2 = WebDriverWait(driver, 45).until(EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='"+ WifiName + "']")))
|
||||
print("SSID is Present: " + WifiName)
|
||||
report.step_start("SSID is Present: " + WifiName)
|
||||
|
||||
try:
|
||||
if Wifi_AP_Name.__eq__(WifiName):
|
||||
print("Wifi Name Matched Successful ")
|
||||
#print("Wifi_AP_ConnName: " + "'"+ Wifi_AP_Name + "'" + " Not Equal To: " + WifiName + "....Check AP Name Syntax")
|
||||
return True
|
||||
else:
|
||||
print ("-- Wifi Don't Match Match -- ")
|
||||
#print("Wifi_AP_ConnName: " + "'"+ Wifi_AP_Name + "'" + " Not Equal To: " + WifiName + "....Check AP Name Syntax")
|
||||
return False
|
||||
except NoSuchElementException:
|
||||
print("Exception Checking Wifi/AP connection NAME...")
|
||||
return None
|
||||
try:
|
||||
print("Waiting for Auto Connection to: " + WifiName)
|
||||
report.step_start("Waiting for Auto Connection to: " + WifiName)
|
||||
selectedWifiNetwork = "//*[@label='selected']/parent::*/parent::*/XCUIElementTypeStaticText[@label='"+ WifiName + "']/parent::*/XCUIElementTypeButton[@label='More Info']"
|
||||
passPointWifi = WebDriverWait(driver, 30).until(EC.presence_of_element_located((MobileBy.XPATH, selectedWifiNetwork)))
|
||||
except Exception as e:
|
||||
#Toggle Wifi Mode
|
||||
Toggle_WifiMode_iOS(request, setup_perfectoMobile, connData)
|
||||
time.sleep(15)
|
||||
|
||||
try:
|
||||
print("Waiting for Auto Connection After Toggle: " + WifiName)
|
||||
selectedWifiNetwork2 = "//*[@label='selected']/parent::*/parent::*/XCUIElementTypeStaticText[@label='"+ WifiName + "']/parent::*/XCUIElementTypeButton[@label='More Info']"
|
||||
passPointWifi = WebDriverWait(driver, 30).until(EC.presence_of_element_located((MobileBy.XPATH, selectedWifiNetwork2)))
|
||||
except Exception as e:
|
||||
print("SSID Not Connected Within allocated Time: " + WifiName)
|
||||
report.step_start("SSID Not Connected: " + WifiName)
|
||||
request.config.cache.set(key="SelectingWifiFailed", value=str(e))
|
||||
reportFlag = False
|
||||
assert reportFlag
|
||||
|
||||
except Exception as e:
|
||||
print("SSID Not Connected Within allocated Time: " + WifiName)
|
||||
report.step_start("SSID Not Connected: " + WifiName)
|
||||
request.config.cache.set(key="SelectingWifiFailed", value=str(e))
|
||||
reportFlag = False
|
||||
assert reportFlag
|
||||
|
||||
return True
|
||||
|
||||
def ForgetWifiConnection(request, setup_perfectoMobile, wifiName, connData):
|
||||
print("\n-----------------------------")
|
||||
@@ -258,7 +277,7 @@ def ForgetWifiConnection(request, setup_perfectoMobile, wifiName, connData):
|
||||
report.step_start("Switching Driver Context")
|
||||
print("Switching Context to Native")
|
||||
driver.switch_to.context('NATIVE_APP')
|
||||
contexts = driver.contexts
|
||||
#contexts = driver.contexts
|
||||
#print(contexts)
|
||||
|
||||
report.step_start("Forget Existing Wifi")
|
||||
@@ -323,17 +342,19 @@ def Toggle_WifiMode_iOS(request, setup_perfectoMobile, connData):
|
||||
report = setup_perfectoMobile[1]
|
||||
driver = setup_perfectoMobile[0]
|
||||
|
||||
#Open Settings Application
|
||||
#openApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile)
|
||||
|
||||
report.step_start("Toggle Wifi Mode")
|
||||
print("Toggle Wifi Mode..")
|
||||
try:
|
||||
print("Disable Wifi Radio Btn")
|
||||
report.step_start("Disable Wifi Radio Btn")
|
||||
WifiMode = driver.find_element_by_xpath("//*[@label='Wi-Fi' and @value='1']")
|
||||
#Toggle Wifi Mode
|
||||
WifiMode.click()
|
||||
time.sleep(5)
|
||||
#Verify Radio Button Mode
|
||||
try:
|
||||
print("Enable Wifi Radio Btn")
|
||||
report.step_start("Enable Wifi Radio Btn")
|
||||
WifiDissconnected = driver.find_element_by_xpath("//*[@label='Wi-Fi' and @value='0']")
|
||||
#self.assertEqual(WifiDissconnected.text, "Airplane Mode", "Airplane Mode Not Triggerd")
|
||||
print("Wifi Radio Button Toggled to Disable")
|
||||
@@ -532,7 +553,7 @@ def verifyUploadDownloadSpeediOS(request, setup_perfectoMobile, get_APToMobileDe
|
||||
|
||||
return currentResult
|
||||
|
||||
def downloadInstallOpenRoamingProfile(request, setup_perfectoMobile, get_APToMobileDevice_data):
|
||||
def downloadInstallOpenRoamingProfile(request, profileDownloadURL, setup_perfectoMobile, get_APToMobileDevice_data):
|
||||
print("\n-------------------------------------")
|
||||
print("Download Open Roaming Profile")
|
||||
print("-------------------------------------")
|
||||
@@ -551,7 +572,7 @@ def downloadInstallOpenRoamingProfile(request, setup_perfectoMobile, get_APToMob
|
||||
|
||||
print("Launching Safari with OpenRoaming Profile")
|
||||
report.step_start("Open Roaming Download Page")
|
||||
driver.get(connData["openRoaming-iOS-URL"])
|
||||
driver.get(profileDownloadURL)
|
||||
|
||||
try:
|
||||
print("Accept Popup")
|
||||
@@ -620,22 +641,38 @@ def downloadInstallOpenRoamingProfile(request, setup_perfectoMobile, get_APToMob
|
||||
|
||||
closeApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile)
|
||||
|
||||
#Open Settings Application
|
||||
openApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile)
|
||||
print("Switching Context to Webview")
|
||||
driver.switch_to.context('WEBVIEW_1')
|
||||
print("Launching Google to Reset Browser")
|
||||
report.step_start("Launching Google to Reset Browser")
|
||||
driver.get("https://www.google.com")
|
||||
|
||||
print("Switching Context to Native")
|
||||
report.step_start("Switching Driver Context Native")
|
||||
driver.switch_to.context('NATIVE_APP')
|
||||
|
||||
closeApp(connData["bundleId-iOS-Safari"], setup_perfectoMobile)
|
||||
|
||||
#Open Settings Application
|
||||
#openApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile)
|
||||
|
||||
try:
|
||||
print("Verifying OpenRoaming Connected Wifi")
|
||||
time.sleep(20)
|
||||
report.step_start("Verifying Connected Wifi Name")
|
||||
element = driver.find_element_by_xpath("//XCUIElementTypeCell[@name='Wi-Fi']/XCUIElementTypeStaticText[2]")
|
||||
OpenRoamingWifiName = element.text
|
||||
element.click()
|
||||
|
||||
except Exception as e:
|
||||
OpenRoamingWifiName = "None"
|
||||
print("Wifi Not Connected to OpenRoaming Profile: ")
|
||||
request.config.cache.set(key="SelectingWifiFailed", value=str(e))
|
||||
assert False
|
||||
|
||||
# try:
|
||||
# print("Verifying OpenRoaming Connected Wifi")
|
||||
# time.sleep(3)
|
||||
# report.step_start("Verifying Connected Wifi Name")
|
||||
# element = driver.find_element_by_xpath("//XCUIElementTypeCell[@name='Wi-Fi']/XCUIElementTypeStaticText[2]")
|
||||
# OpenRoamingWifiName = element.text
|
||||
# element.click()
|
||||
|
||||
# except Exception as e:
|
||||
# OpenRoamingWifiName = "None"
|
||||
# print("Wifi Not Connected to OpenRoaming Profile: ")
|
||||
# request.config.cache.set(key="SelectingWifiFailed", value=str(e))
|
||||
# assert False
|
||||
|
||||
|
||||
|
||||
#try:
|
||||
# report.step_start("Verify Wifi Connected Status")
|
||||
@@ -651,7 +688,7 @@ def downloadInstallOpenRoamingProfile(request, setup_perfectoMobile, get_APToMob
|
||||
|
||||
#return OpenRoamingWifiName
|
||||
|
||||
def ForgetAllWifiConnection(request, setup_perfectoMobile, connData):
|
||||
def ForgetProfileWifiConnection(request, setup_perfectoMobile, installedProfileSSID, connData):
|
||||
print("\n-----------------------------")
|
||||
print("Forget All Wifi/AP Connection")
|
||||
print("-----------------------------")
|
||||
@@ -669,37 +706,55 @@ def ForgetAllWifiConnection(request, setup_perfectoMobile, connData):
|
||||
openApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile)
|
||||
|
||||
try:
|
||||
#Also have to check with Connected Status xpath
|
||||
print("Verifying Connected Wifi Connection")
|
||||
report.step_start("Verifying Existing Connected Wifi Connection")
|
||||
element = driver.find_element_by_xpath("//XCUIElementTypeCell[@name='Wi-Fi']/XCUIElementTypeStaticText[2]")
|
||||
Wifi_AP_Name = element.text
|
||||
element.click()
|
||||
element22 = driver.find_element_by_xpath("//XCUIElementTypeCell[@name='Wi-Fi']/XCUIElementTypeStaticText[2]")
|
||||
element22.click()
|
||||
|
||||
#WifiXpath2= "//*[@label='selected']/parent::*/parent::*/XCUIElementTypeStaticText[2]"
|
||||
WifiXpath2 = WebDriverWait(driver, 20).until(EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='selected']/parent::*/parent::*/XCUIElementTypeStaticText[2]")))
|
||||
elementMoreInfo = driver.find_element_by_xpath(WifiXpath2)
|
||||
Wifi_AP_Name = elementMoreInfo.text
|
||||
print ("Connected to: " + Wifi_AP_Name)
|
||||
except NoSuchElementException:
|
||||
|
||||
except NoSuchElementException and TimeoutException:
|
||||
Wifi_AP_Name = "None"
|
||||
print("Wifi Not Connected to anything")
|
||||
|
||||
if Wifi_AP_Name.__eq__("Not Connected"):
|
||||
print("Not Connected to any wifi")
|
||||
|
||||
#deleteOpenRoamingInstalledProfile(request, installedProfileSSID, setup_perfectoMobile, connData)
|
||||
elif Wifi_AP_Name.__eq__("None"):
|
||||
#deleteOpenRoamingInstalledProfile(request, installedProfileSSID, setup_perfectoMobile, connData)
|
||||
print("Not Connected to any wifi Network/None")
|
||||
elif Wifi_AP_Name.__eq__(installedProfileSSID):
|
||||
deleteOpenRoamingInstalledProfile(request, installedProfileSSID, setup_perfectoMobile, connData)
|
||||
else:
|
||||
report.step_start("Click on More Info on Wifi")
|
||||
WifiXpathMoreInfo = "//*[@label='selected']/parent::*/parent::*/XCUIElementTypeStaticText[@label='"+ Wifi_AP_Name + "']/parent::*/XCUIElementTypeButton[@label='More Info']"
|
||||
elementMoreInfo = driver.find_element_by_xpath(WifiXpathMoreInfo)
|
||||
elementMoreInfo.click()
|
||||
try:
|
||||
#element22.click()
|
||||
report.step_start("Click on More Info on Wifi")
|
||||
WifiXpathMoreInfo = "//*[@label='selected']/parent::*/parent::*/XCUIElementTypeStaticText[@label='"+ Wifi_AP_Name + "']/parent::*/XCUIElementTypeButton[@label='More Info']"
|
||||
elementMoreInfo = driver.find_element_by_xpath(WifiXpathMoreInfo)
|
||||
elementMoreInfo.click()
|
||||
|
||||
print("Forget Wifi Network " + Wifi_AP_Name)
|
||||
report.step_start("Forget Wifi Network")
|
||||
WifiXpathForgetWifi = "//*[@label='Forget This Network']"
|
||||
elementforgetWifi = driver.find_element_by_xpath(WifiXpathForgetWifi)
|
||||
elementforgetWifi.click()
|
||||
print("Forget Wifi Network " + Wifi_AP_Name)
|
||||
report.step_start("Forget Wifi Network")
|
||||
WifiXpathForgetWifi = "//*[@label='Forget This Network']"
|
||||
elementforgetWifi = driver.find_element_by_xpath(WifiXpathForgetWifi)
|
||||
elementforgetWifi.click()
|
||||
|
||||
report.step_start("Confirm Forget Wifi Network")
|
||||
WifiXpathForgetWifi = "//*[@label='Forget']"
|
||||
elementforgetWifi = driver.find_element_by_xpath(WifiXpathForgetWifi)
|
||||
elementforgetWifi.click()
|
||||
report.step_start("Confirm Forget Wifi Network")
|
||||
WifiXpathForgetWifi = "//*[@label='Forget']"
|
||||
elementforgetWifi = driver.find_element_by_xpath(WifiXpathForgetWifi)
|
||||
elementforgetWifi.click()
|
||||
|
||||
def deleteOpenRoamingInstalledProfile(request, setup_perfectoMobile, connData):
|
||||
except NoSuchElementException:
|
||||
|
||||
print("Exception General Menu Not found")
|
||||
assert False
|
||||
|
||||
def deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile, connData):
|
||||
print("\n-----------------------------")
|
||||
print("Delete Open Roaming Profile")
|
||||
print("-----------------------------")
|
||||
@@ -728,45 +783,66 @@ def deleteOpenRoamingInstalledProfile(request, setup_perfectoMobile, connData):
|
||||
scrollDown(setup_perfectoMobile)
|
||||
|
||||
try:
|
||||
print("Select Profile ")
|
||||
report.step_start("Select Profile")
|
||||
element = driver.find_element_by_xpath("//*[@name='ManagedConfigurationList' and @label='Profile']")
|
||||
element.click()
|
||||
except NoSuchElementException:
|
||||
print("Exception Select Profile Button")
|
||||
assert False
|
||||
print("Verify if any Profile Installed ")
|
||||
try:
|
||||
print("Select Profile ")
|
||||
report.step_start("Select Profile")
|
||||
elementProfile = driver.find_element_by_xpath("//*[@name='ManagedConfigurationList' and @label='Profile']")
|
||||
elementProfile.click()
|
||||
except NoSuchElementException:
|
||||
#Verify Multi Profiles
|
||||
print("Multiple Profiles Maybe Installed, Checking Profiles")
|
||||
try:
|
||||
elementProfiles = driver.find_element_by_xpath("//*[@name='ManagedConfigurationList' and @label='Profiles']")
|
||||
elementProfiles.click()
|
||||
print("Exception Select Profile Button")
|
||||
except NoSuchElementException:
|
||||
print("No Profile Installed")
|
||||
|
||||
try:
|
||||
print("Click Configuration Profile ")
|
||||
report.step_start("Click Configuration Profile ")
|
||||
element = driver.find_element_by_xpath("//XCUIElementTypeStaticText[@label='AmeriBand']")
|
||||
element.click()
|
||||
except NoSuchElementException:
|
||||
print("Exception Click Configuration Button")
|
||||
assert False
|
||||
try:
|
||||
print("Click Configuration Profile ")
|
||||
report.step_start("Click Configuration Profile ")
|
||||
element = driver.find_element_by_xpath("//XCUIElementTypeStaticText[@label='" + profileName + "']")
|
||||
element.click()
|
||||
except NoSuchElementException:
|
||||
print("Exception Click AmeriBand Profile Btn")
|
||||
assert False
|
||||
|
||||
try:
|
||||
print("Remove Profile")
|
||||
report.step_start("Remove Profile ")
|
||||
element = driver.find_element_by_xpath("//*[@label='Remove Profile']")
|
||||
element.click()
|
||||
except NoSuchElementException:
|
||||
print("Exception Remove")
|
||||
assert False
|
||||
|
||||
try:
|
||||
print("Click Remove Button")
|
||||
report.step_start("Click Remove Button")
|
||||
element = driver.find_element_by_xpath("//*[@label='Remove']")
|
||||
element.click()
|
||||
except NoSuchElementException:
|
||||
print("Exception Remove Button")
|
||||
assert False
|
||||
try:
|
||||
print("Remove Profile")
|
||||
report.step_start("Remove Profile ")
|
||||
element = driver.find_element_by_xpath("//*[@label='Remove Profile']")
|
||||
element.click()
|
||||
except NoSuchElementException:
|
||||
print("Exception Remove")
|
||||
assert False
|
||||
|
||||
try:
|
||||
print("Click Remove Button")
|
||||
report.step_start("Click Remove Button")
|
||||
element = driver.find_element_by_xpath("//*[@label='Remove']")
|
||||
element.click()
|
||||
except NoSuchElementException:
|
||||
print("Exception Remove Button")
|
||||
assert False
|
||||
|
||||
try:
|
||||
print("Verify No Profile Installed Msg")
|
||||
report.step_start("Verify No Profile Installed Msg")
|
||||
element = driver.find_element_by_xpath("//*[@label='No profiles are currently installed.']")
|
||||
except NoSuchElementException:
|
||||
print("Exception Verify No Profile Installed Msg")
|
||||
assert False
|
||||
#try:
|
||||
# print("Verify No Profile Installed Msg")
|
||||
# report.step_start("Verify No Profile Installed Msg")
|
||||
# wifiXpath2 = WebDriverWait(driver, 30).until(EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='No profiles are currently installed.']")))
|
||||
# assert True
|
||||
#except NoSuchElementException and TimeoutException and Exception:
|
||||
# assert True
|
||||
# print("Exception Verify No Profile Installed Msg, There may be more Profiles Installed")
|
||||
|
||||
# try:
|
||||
# print("Checking if " + profileName + " is removed")
|
||||
# element = driver.find_element_by_xpath("//XCUIElementTypeStaticText[@label='" + profileName + "']")
|
||||
# assert False
|
||||
# except NoSuchElementException and Exception:
|
||||
# print("Exception Verify No Profile Installed Msg, There may be more Profiles Installed")
|
||||
# assert True
|
||||
|
||||
except Exception:
|
||||
print("Exception There may be No Profiles Installed")
|
||||
report.step_start("Exception There may be No Profiles Installed")
|
||||
@@ -1,7 +1,14 @@
|
||||
"""
|
||||
1.X Testbed Access using ssh tunnel
|
||||
ssh -C -L 8801:lab-ctlr:22 -L 8802:lf1:8080 -L 8803:lf1:22 -L 8804:lf2:8080 -L 8805:lf2:22 -L 3389:lf1:3389 -L 3390:lf2:3389 ubuntu@orch
|
||||
|
||||
2.X Testbed Access using ssh tunnel
|
||||
|
||||
"""
|
||||
CONFIGURATION = {
|
||||
"basic-01": {
|
||||
"basic-01": {
|
||||
"controller": {
|
||||
'url': "https://wlan-portal-svc-nola-ext-04.cicd.lab.wlan.tip.build", # API base url for the controller
|
||||
'url': "https://wlan-portal-svc-nola-02.cicd.lab.wlan.tip.build", # API base url for the controller
|
||||
'username': 'support@example.com',
|
||||
'password': 'support',
|
||||
'version': '1.1.0-SNAPSHOT',
|
||||
@@ -16,7 +23,87 @@ CONFIGURATION = {
|
||||
'ip': "localhost", # localhost
|
||||
'username': "lanforge",
|
||||
'password': "pumpkin77",
|
||||
'port': 8803, # 22,
|
||||
'port': 8801, # 22,
|
||||
'jumphost_tty': '/dev/ttyAP1',
|
||||
'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/ecw5410/dev/ecw5410-2021-06-16-pending-e8418c0.tar.gz"
|
||||
}
|
||||
],
|
||||
"traffic_generator": {
|
||||
"name": "lanforge",
|
||||
"details": {
|
||||
"ip": "localhost", # localhost,
|
||||
"port": 8802, # 8802,
|
||||
"ssh_port": 8803,
|
||||
"2.4G-Radio": ["wiphy0", "wiphy4"],
|
||||
"5G-Radio": ["wiphy0", "wiphy5"],
|
||||
"AX-Radio": ["wiphy0", "wiphy1", "wiphy2", "wiphy3"],
|
||||
"upstream": "1.1.eth2",
|
||||
"upstream_subnet": "10.28.2.1/24",
|
||||
"uplink": "1.1.eth3",
|
||||
"2.4G-Station-Name": "twog0",
|
||||
"5G-Station-Name": "fiveg0",
|
||||
"AX-Station-Name": "ax"
|
||||
}
|
||||
}
|
||||
}, # 1.X wifi-5 basic-01
|
||||
"basic-02": {
|
||||
"controller": {
|
||||
'url': "https://wlan-portal-svc-nola-02.cicd.lab.wlan.tip.build", # API base url for the controller
|
||||
'username': 'support@example.com',
|
||||
'password': 'support',
|
||||
'version': "1.1.0-SNAPSHOT",
|
||||
'commit_date': "2021-06-01"
|
||||
},
|
||||
'access_point': [
|
||||
{
|
||||
'model': 'eap101',
|
||||
'mode': 'wifi6',
|
||||
'serial': '34efb6af48db',
|
||||
'jumphost': True,
|
||||
'ip': "localhost",
|
||||
'username': "lanforge",
|
||||
'password': "pumpkin77",
|
||||
'port': 8801,
|
||||
'jumphost_tty': '/dev/ttyAP2',
|
||||
'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/eap101/dev/eap101-2021-06-15-pending-39bd8f3.tar.gz"
|
||||
}
|
||||
],
|
||||
"traffic_generator": {
|
||||
"name": "lanforge",
|
||||
"details": {
|
||||
"ip": "localhost",
|
||||
"port": 8804,
|
||||
"ssh_port": 8805,
|
||||
"2.4G-Radio": ["wiphy0", "wiphy4"],
|
||||
"5G-Radio": ["wiphy0", "wiphy5"],
|
||||
"AX-Radio": ["wiphy0", "wiphy1", "wiphy2", "wiphy3"],
|
||||
"upstream": "1.1.eth2",
|
||||
"upstream_subnet": "10.28.2.1/24",
|
||||
"uplink": "1.1.eth3",
|
||||
"2.4G-Station-Name": "sta0",
|
||||
"5G-Station-Name": "sta1",
|
||||
"AX-Station-Name": "ax"
|
||||
}
|
||||
}
|
||||
}, # 1.x wifi-6 basic-02
|
||||
"ext-03-01": {
|
||||
"controller": {
|
||||
'url': "https://wlan-portal-svc-nola-ext-03.cicd.lab.wlan.tip.build", # API base url for the controller
|
||||
'username': 'support@example.com',
|
||||
'password': 'support',
|
||||
'version': '1.1.0-SNAPSHOT',
|
||||
'commit_date': "2021-06-01"
|
||||
},
|
||||
'access_point': [
|
||||
{
|
||||
'model': 'ecw5410',
|
||||
'mode': 'wifi5',
|
||||
'serial': '903cb3944857',
|
||||
'jumphost': True,
|
||||
'ip': "192.168.200.80", # localhost
|
||||
'username': "lanforge",
|
||||
'password': "lanforge",
|
||||
'port': 22, # 22,
|
||||
'jumphost_tty': '/dev/ttyAP1',
|
||||
'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/ecw5410/trunk/ecw5410-1.1.0.tar.gz"
|
||||
}
|
||||
@@ -24,235 +111,298 @@ CONFIGURATION = {
|
||||
"traffic_generator": {
|
||||
"name": "lanforge",
|
||||
"details": {
|
||||
"ip": "localhost", # localhost,
|
||||
"port": 8802, # 8802,
|
||||
"ssh_port": 8804,
|
||||
"2.4G-Radio": ["wiphy4"],
|
||||
"ip": "192.168.200.80", # localhost,
|
||||
"port": 8080, # 8802,
|
||||
"ssh_port": 22,
|
||||
"2.4G-Radio": ["wiphy0"],
|
||||
"5G-Radio": ["wiphy5"],
|
||||
"AX-Radio": ["wiphy0", "wiphy1", "wiphy2", "wiphy3"],
|
||||
"upstream": "1.1.eth2",
|
||||
"upstream_subnet": "10.28.2.1/24",
|
||||
"uplink": "1.1.eth3",
|
||||
"2.4G-Station-Name": "wlan0",
|
||||
"5G-Station-Name": "wlan0",
|
||||
"AX-Station-Name": "ax"
|
||||
"AX-Radio": [],
|
||||
"upstream": "1.1.eth1",
|
||||
"upstream_subnet": "192.168.200.1/24",
|
||||
"uplink": "1.1.eth2",
|
||||
"2.4G-Station-Name": "twog0",
|
||||
"5G-Station-Name": "fiveg0",
|
||||
"AX-Station-Name": "ax0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"basic-03": {
|
||||
}, # Anjali 192.168.200.80
|
||||
"ext-03-02": {
|
||||
"controller": {
|
||||
'url': "https://wlan-portal-svc-nola-ext-04.cicd.lab.wlan.tip.build", # API base url for the controller
|
||||
'url': "https://wlan-portal-svc-nola-ext-03.cicd.lab.wlan.tip.build", # API base url for the controller
|
||||
'username': 'support@example.com',
|
||||
'password': 'support',
|
||||
'version': '1.1.0-SNAPSHOT',
|
||||
'commit_date': "2021-06-01"
|
||||
},
|
||||
'access_point': [
|
||||
{
|
||||
'model': 'ec420',
|
||||
'mode': 'wifi5',
|
||||
'serial': '001122090801',
|
||||
'jumphost': True,
|
||||
'ip': "localhost", #"10.28.3.100", # localhost
|
||||
'username': "lanforge",
|
||||
'password': "pumpkin77",
|
||||
'port': 8833,
|
||||
'jumphost_tty': '/dev/ttyAP3',
|
||||
'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/eap101/trunk/eap101-1.1.0.tar.gz"
|
||||
}
|
||||
],
|
||||
"traffic_generator": {
|
||||
"name": "lanforge",
|
||||
"details": {
|
||||
"ip": "localhost", # localhost
|
||||
"port": 8832,
|
||||
"ssh_port": 8833,
|
||||
"2.4G-Radio": ["wiphy4"],
|
||||
"5G-Radio": ["wiphy5"],
|
||||
"AX-Radio": ["wiphy0", "wiphy1", "wiphy2", "wiphy3"],
|
||||
"upstream": "1.1.eth2",
|
||||
"upstream_subnet": "10.28.2.1/24",
|
||||
"uplink": "1.1.eth3",
|
||||
"2.4G-Station-Name": "wlan0",
|
||||
"5G-Station-Name": "wlan0",
|
||||
"AX-Station-Name": "ax"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
"basic-02": {
|
||||
"controller": {
|
||||
'url': "https://wlan-portal-svc-nola-ext-04.cicd.lab.wlan.tip.build", # API base url for the controller
|
||||
'username': 'support@example.com',
|
||||
'password': 'support',
|
||||
'version': '1.1.0-SNAPSHOT',
|
||||
'commit_date': "2021-06-01"
|
||||
},
|
||||
'access_point': [
|
||||
{
|
||||
'model': 'eap101',
|
||||
'mode': 'wifi5',
|
||||
'serial': '34efb6af48db',
|
||||
'jumphost': True,
|
||||
'ip': "localhost", # localhost
|
||||
'username': "lanforge",
|
||||
'password': "pumpkin77",
|
||||
'port': 8803, # 22,
|
||||
'jumphost_tty': '/dev/ttyAP1',
|
||||
'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/eap101/trunk/eap101-1.1.0-rc2.tar.gz"
|
||||
}
|
||||
],
|
||||
"traffic_generator": {
|
||||
"name": "lanforge",
|
||||
"details": {
|
||||
"ip": "localhost", # localhost,
|
||||
"port": 8802, # 8802,
|
||||
"ssh_port": 8804,
|
||||
"2.4G-Radio": ["wiphy4"],
|
||||
"5G-Radio": ["wiphy5"],
|
||||
"AX-Radio": ["wiphy0", "wiphy1", "wiphy2", "wiphy3"],
|
||||
"upstream": "1.1.eth2",
|
||||
"upstream_subnet": "10.28.2.1/24",
|
||||
"uplink": "1.1.eth3",
|
||||
"2.4G-Station-Name": "wlan0",
|
||||
"5G-Station-Name": "wlan0",
|
||||
"AX-Station-Name": "ax"
|
||||
}
|
||||
}
|
||||
},
|
||||
# This is sample Config of a Testbed
|
||||
"basic-ext-01": {
|
||||
"controller": {
|
||||
'url': "http://wlan-portal-svc-digicert.cicd.lab.wlan.tip.build", # API base url for the controller
|
||||
'username': 'support@example.com', # cloud controller Login
|
||||
'password': 'support', # Cloud Controller Login Password
|
||||
'version': '1.1.0-SNAPSHOT', # Controller version
|
||||
'commit_date': "2021-04-27" # Controller version sdk, commit date
|
||||
},
|
||||
'access_point': [
|
||||
{
|
||||
'model': 'ecw5410', # AP Model, can be found in ap console using "node" command
|
||||
'mode': 'wifi5', # wifi5/wifi6 can be found on AP Hardware page on Confluence
|
||||
'serial': '903cb3944873', # "node" command has serial_number information
|
||||
'jumphost': True,
|
||||
# True, if you have AP On serial console and not ssh access, False, if you have AP ssh access from the machine
|
||||
'ip': "192.168.80.99",
|
||||
# IP Address of System, which has AP Connected to serial cable (if jumphost is True), else - AP IP Address
|
||||
'username': "lanforge", # ssh username of system (lab-ctlr/ap)
|
||||
'password': "lanforge", # ssh password for system (lab-ctlr/ap)
|
||||
'port': 22, # 22, # ssh port for system (lab-ctlr/ap)
|
||||
'jumphost_tty': '/dev/ttyAP1', # if jumphost is True, enter the serial console device name
|
||||
'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/ecw5410/trunk/ecw5410-1.1.0.tar.gz"
|
||||
# Enter the Target AP Version URL for Testing
|
||||
}
|
||||
],
|
||||
# Traffic generator
|
||||
"traffic_generator": {
|
||||
"name": "lanforge", # ( lanforge/ perfecto)
|
||||
# Details for LANforge system
|
||||
"details": {
|
||||
"ip": "192.168.80.99", # localhost,
|
||||
"port": 8080, # 8802,
|
||||
"2.4G-Radio": ["wiphy4"],
|
||||
"5G-Radio": ["wiphy5"],
|
||||
"AX-Radio": ["wiphy0", "wiphy1", "wiphy2", "wiphy3"],
|
||||
"upstream": "1.1.eth2",
|
||||
"upstream_subnet": "10.28.2.1/24",
|
||||
"uplink": "1.1.eth3",
|
||||
"2.4G-Station-Name": "wlan0",
|
||||
"5G-Station-Name": "wlan0",
|
||||
"AX-Station-Name": "ax"
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
"basic-lab": {
|
||||
"controller": {
|
||||
'url': "https://wlan-portal-svc-nola-ext-04.cicd.lab.wlan.tip.build", # API base url for the controller
|
||||
'username': 'support@example.com', # cloud controller Login
|
||||
'password': 'support', # Cloud Controller Login Password
|
||||
'version': '1.1.0-SNAPSHOT', # Controller version
|
||||
'commit_date': "2021-04-27" # Controller version sdk, commit date
|
||||
},
|
||||
'access_point': [
|
||||
{
|
||||
'model': 'ecw5410', # AP Model, can be found in ap console using "node" command
|
||||
'mode': 'wifi5', # wifi5/wifi6 can be found on AP Hardware page on Confluence
|
||||
'serial': '903cb3944873', # "node" command has serial_number information
|
||||
'jumphost': True,
|
||||
# True, if you have AP On serial console and not ssh access, False, if you have AP ssh access from the machine
|
||||
'ip': "localhost",
|
||||
# IP Address of System, which has AP Connected to serial cable (if jumphost is True), else - AP IP Address
|
||||
'username': "lanforge", # ssh username of system (lab-ctlr/ap)
|
||||
'password': "pumpkin77", # ssh password for system (lab-ctlr/ap)
|
||||
'port': 8803, # 22, # ssh port for system (lab-ctlr/ap)
|
||||
'jumphost_tty': '/dev/ttyAP1', # if jumphost is True, enter the serial console device name
|
||||
'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/ecw5410/trunk/ecw5410-1.1.0.tar.gz"
|
||||
# Enter the Target AP Version URL for Testing
|
||||
}
|
||||
],
|
||||
# Traffic generator
|
||||
"traffic_generator": {
|
||||
"name": "lanforge", # ( lanforge/ perfecto)
|
||||
# Details for LANforge system
|
||||
"details": {
|
||||
"ip": "localhost", # localhost,
|
||||
"port": 8802, # 8802,
|
||||
"2.4G-Radio": ["wiphy4"],
|
||||
"5G-Radio": ["wiphy5"],
|
||||
"AX-Radio": ["wiphy0", "wiphy1", "wiphy2", "wiphy3"],
|
||||
"upstream": "1.1.eth2",
|
||||
"upstream_subnet": "10.28.2.1/24",
|
||||
"uplink": "1.1.eth3",
|
||||
"2.4G-Station-Name": "wlan0",
|
||||
"5G-Station-Name": "wlan0",
|
||||
"AX-Station-Name": "ax"
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
"interop": {
|
||||
"controller": {
|
||||
'url': "https://wlan-portal-svc-nola-01.cicd.lab.wlan.tip.build", # API base url for the controller
|
||||
'username': 'support@example.com',
|
||||
'password': 'support',
|
||||
'version': '1.0.0-SNAPSHOT',
|
||||
'commit_date': '2021-03-01'
|
||||
},
|
||||
'access_point': [
|
||||
{
|
||||
'model': 'ecw5410',
|
||||
'mode': 'wifi5',
|
||||
'serial': '68215fd2f78c',
|
||||
'serial': '903cb394486f',
|
||||
'jumphost': True,
|
||||
'ip': "localhost",
|
||||
'ip': "192.168.200.81", # localhost
|
||||
'username': "lanforge",
|
||||
'password': "pumpkin77",
|
||||
'port': 8803,
|
||||
'password': "lanforge",
|
||||
'port': 22, # 22,
|
||||
'jumphost_tty': '/dev/ttyAP1',
|
||||
'version': "ecw5410-2021-04-26-pending-3fc41fa"
|
||||
'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/ecw5410/trunk/ecw5410-1.1.0.tar.gz"
|
||||
}
|
||||
],
|
||||
"traffic_generator": {
|
||||
"name": "Perfecto",
|
||||
"traffic_generator": {
|
||||
"name": "lanforge",
|
||||
"details": {
|
||||
"securityToken": "eyJhbGciOiJIUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICI3NzkzZGM0Ni1jZmU4LTQ4ODMtYjhiOS02ZWFlZGU2OTc2MDkifQ.eyJqdGkiOiJjYjRjYjQzYi05Y2FiLTQxNzQtOTYxYi04MDEwNTZkNDM2MzgiLCJleHAiOjAsIm5iZiI6MCwiaWF0IjoxNjExNTk0NzcxLCJpc3MiOiJodHRwczovL2F1dGgyLnBlcmZlY3RvbW9iaWxlLmNvbS9hdXRoL3JlYWxtcy90aXAtcGVyZmVjdG9tb2JpbGUtY29tIiwiYXVkIjoiaHR0cHM6Ly9hdXRoMi5wZXJmZWN0b21vYmlsZS5jb20vYXV0aC9yZWFsbXMvdGlwLXBlcmZlY3RvbW9iaWxlLWNvbSIsInN1YiI6IjdiNTMwYWUwLTg4MTgtNDdiOS04M2YzLTdmYTBmYjBkZGI0ZSIsInR5cCI6Ik9mZmxpbmUiLCJhenAiOiJvZmZsaW5lLXRva2VuLWdlbmVyYXRvciIsIm5vbmNlIjoiZTRmOTY4NjYtZTE3NS00YzM2LWEyODMtZTQwMmI3M2U5NzhlIiwiYXV0aF90aW1lIjowLCJzZXNzaW9uX3N0YXRlIjoiYWNkNTQ3MTctNzJhZC00MGU3LWI0ZDctZjlkMTAyNDRkNWZlIiwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIm9mZmxpbmVfYWNjZXNzIiwidW1hX2F1dGhvcml6YXRpb24iXX0sInJlc291cmNlX2FjY2VzcyI6eyJyZXBvcnRpdW0iOnsicm9sZXMiOlsiYWRtaW5pc3RyYXRvciJdfSwiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJvcGVuaWQgcHJvZmlsZSBvZmZsaW5lX2FjY2VzcyBlbWFpbCJ9.SOL-wlZiQ4BoLLfaeIW8QoxJ6xzrgxBjwSiSzkLBPYw",
|
||||
"perfectoURL": "tip"
|
||||
"ip": "192.168.200.81", # localhost,
|
||||
"port": 8080, # 8802,
|
||||
"ssh_port": 22,
|
||||
"2.4G-Radio": ["wiphy0"],
|
||||
"5G-Radio": ["wiphy5"],
|
||||
"AX-Radio": [],
|
||||
"upstream": "1.1.eth1",
|
||||
"upstream_subnet": "192.168.200.1/24",
|
||||
"uplink": "1.1.eth2",
|
||||
"2.4G-Station-Name": "twog0",
|
||||
"5G-Station-Name": "fiveg0",
|
||||
"AX-Station-Name": "ax0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"interop": {
|
||||
"controller": {
|
||||
'url': "https://wlan-portal-svc-nola-02.cicd.lab.wlan.tip.build", # API base url for the controller
|
||||
'username': 'support@example.com',
|
||||
'password': 'support',
|
||||
'version': '1.1.0-SNAPSHOT',
|
||||
'commit_date': '2021-06-01'
|
||||
},
|
||||
'access_point': [
|
||||
{
|
||||
'model': 'ecw5410',
|
||||
'mode': 'wifi5',
|
||||
'serial': '3c2c99f44e53',
|
||||
'jumphost': True,
|
||||
'ip': "localhost",
|
||||
'username': "lanforge",
|
||||
'password': "pumpkin77",
|
||||
'port': 8803,
|
||||
'jumphost_tty': '/dev/ttyAP4',
|
||||
'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/ecw5410/trunk/ecw5410-1.1.0-rc3.tar.gz"
|
||||
}
|
||||
],
|
||||
"traffic_generator": {
|
||||
"name": "Perfecto",
|
||||
"details": {
|
||||
"securityToken": "eyJhbGciOiJIUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICI3NzkzZGM0Ni1jZmU4LTQ4ODMtYjhiOS02ZWFlZGU2OTc2MDkifQ.eyJqdGkiOiJjYjRjYjQzYi05Y2FiLTQxNzQtOTYxYi04MDEwNTZkNDM2MzgiLCJleHAiOjAsIm5iZiI6MCwiaWF0IjoxNjExNTk0NzcxLCJpc3MiOiJodHRwczovL2F1dGgyLnBlcmZlY3RvbW9iaWxlLmNvbS9hdXRoL3JlYWxtcy90aXAtcGVyZmVjdG9tb2JpbGUtY29tIiwiYXVkIjoiaHR0cHM6Ly9hdXRoMi5wZXJmZWN0b21vYmlsZS5jb20vYXV0aC9yZWFsbXMvdGlwLXBlcmZlY3RvbW9iaWxlLWNvbSIsInN1YiI6IjdiNTMwYWUwLTg4MTgtNDdiOS04M2YzLTdmYTBmYjBkZGI0ZSIsInR5cCI6Ik9mZmxpbmUiLCJhenAiOiJvZmZsaW5lLXRva2VuLWdlbmVyYXRvciIsIm5vbmNlIjoiZTRmOTY4NjYtZTE3NS00YzM2LWEyODMtZTQwMmI3M2U5NzhlIiwiYXV0aF90aW1lIjowLCJzZXNzaW9uX3N0YXRlIjoiYWNkNTQ3MTctNzJhZC00MGU3LWI0ZDctZjlkMTAyNDRkNWZlIiwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIm9mZmxpbmVfYWNjZXNzIiwidW1hX2F1dGhvcml6YXRpb24iXX0sInJlc291cmNlX2FjY2VzcyI6eyJyZXBvcnRpdW0iOnsicm9sZXMiOlsiYWRtaW5pc3RyYXRvciJdfSwiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJvcGVuaWQgcHJvZmlsZSBvZmZsaW5lX2FjY2VzcyBlbWFpbCJ9.SOL-wlZiQ4BoLLfaeIW8QoxJ6xzrgxBjwSiSzkLBPYw",
|
||||
"perfectoURL": "tip"
|
||||
}
|
||||
}, # Nikita 192.168.200.81
|
||||
"ext-03-03": {
|
||||
"controller": {
|
||||
'url': "https://wlan-portal-svc-nola-ext-03.cicd.lab.wlan.tip.build", # API base url for the controller
|
||||
'username': 'support@example.com',
|
||||
'password': 'support',
|
||||
'version': '1.1.0-SNAPSHOT',
|
||||
'commit_date': "2021-06-01"
|
||||
},
|
||||
'access_point': [
|
||||
{
|
||||
'model': 'ecw5410',
|
||||
'mode': 'wifi5',
|
||||
'serial': '903cb3944817',
|
||||
'jumphost': True,
|
||||
'ip': "192.168.200.82", # localhost
|
||||
'username': "lanforge",
|
||||
'password': "lanforge",
|
||||
'port': 22, # 22,
|
||||
'jumphost_tty': '/dev/ttyAP1',
|
||||
'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/ecw5410/trunk/ecw5410-1.1.0.tar.gz"
|
||||
}
|
||||
],
|
||||
"traffic_generator": {
|
||||
"name": "lanforge",
|
||||
"details": {
|
||||
"ip": "192.168.200.82", # localhost,
|
||||
"port": 8080, # 8802,
|
||||
"ssh_port": 22,
|
||||
"2.4G-Radio": ["wiphy0"],
|
||||
"5G-Radio": ["wiphy5"],
|
||||
"AX-Radio": [],
|
||||
"upstream": "1.1.eth1",
|
||||
"upstream_subnet": "192.168.200.1/24",
|
||||
"uplink": "1.1.eth2",
|
||||
"2.4G-Station-Name": "twog0",
|
||||
"5G-Station-Name": "fiveg0",
|
||||
"AX-Station-Name": "ax0"
|
||||
}
|
||||
}
|
||||
}, # Mahesh 192.168.200.82
|
||||
"ext-03-04": {
|
||||
"controller": {
|
||||
'url': "https://wlan-portal-svc-nola-ext-03.cicd.lab.wlan.tip.build", # API base url for the controller
|
||||
'username': 'support@example.com',
|
||||
'password': 'support',
|
||||
'version': '1.1.0-SNAPSHOT',
|
||||
'commit_date': "2021-06-01"
|
||||
},
|
||||
'access_point': [
|
||||
{
|
||||
'model': 'ecw5410',
|
||||
'mode': 'wifi5',
|
||||
'serial': '903cb3944873',
|
||||
'jumphost': True,
|
||||
'ip': "192.168.200.52", # localhost
|
||||
'username': "lanforge",
|
||||
'password': "lanforge",
|
||||
'port': 22, # 22,
|
||||
'jumphost_tty': '/dev/ttyAP1',
|
||||
'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/ecw5410/trunk/ecw5410-1.1.0.tar.gz"
|
||||
}
|
||||
],
|
||||
"traffic_generator": {
|
||||
"name": "lanforge",
|
||||
"details": {
|
||||
"ip": "192.168.52.100", # localhost,
|
||||
"port": 8080, # 8802,
|
||||
"ssh_port": 22,
|
||||
"2.4G-Radio": ["wiphy0"],
|
||||
"5G-Radio": ["wiphy5"],
|
||||
"AX-Radio": [],
|
||||
"upstream": "1.1.eth1",
|
||||
"upstream_subnet": "192.168.52.1/24",
|
||||
"uplink": "1.1.eth2",
|
||||
"2.4G-Station-Name": "twog0",
|
||||
"5G-Station-Name": "fiveg0",
|
||||
"AX-Station-Name": "ax0"
|
||||
}
|
||||
}
|
||||
}, # Shivam 192.168.52.100
|
||||
"ext-03-05": {
|
||||
"controller": {
|
||||
'url': "https://wlan-portal-svc-nola-ext-03.cicd.lab.wlan.tip.build", # API base url for the controller
|
||||
'username': 'support@example.com',
|
||||
'password': 'support',
|
||||
'version': '1.1.0-SNAPSHOT',
|
||||
'commit_date': "2021-06-01"
|
||||
},
|
||||
'access_point': [
|
||||
{
|
||||
'model': 'ecw5410',
|
||||
'mode': 'wifi5',
|
||||
'serial': '903cb3944857',
|
||||
'jumphost': True,
|
||||
'ip': "192.168.200.80", # localhost
|
||||
'username': "lanforge",
|
||||
'password': "lanforge",
|
||||
'port': 22, # 22,
|
||||
'jumphost_tty': '/dev/ttyAP1',
|
||||
'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/ecw5410/trunk/ecw5410-1.1.0.tar.gz"
|
||||
}
|
||||
],
|
||||
"traffic_generator": {
|
||||
"name": "lanforge",
|
||||
"details": {
|
||||
"ip": "192.168.200.80", # localhost,
|
||||
"port": 8080, # 8802,
|
||||
"ssh_port": 22,
|
||||
"2.4G-Radio": ["wiphy0"],
|
||||
"5G-Radio": ["wiphy5"],
|
||||
"AX-Radio": [],
|
||||
"upstream": "1.1.eth1",
|
||||
"upstream_subnet": "192.168.200.1/24",
|
||||
"uplink": "1.1.eth2",
|
||||
"2.4G-Station-Name": "twog0",
|
||||
"5G-Station-Name": "fiveg0",
|
||||
"AX-Station-Name": "ax0"
|
||||
}
|
||||
}
|
||||
}, # Sushant 192.168.51.___
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
RADIUS_SERVER_DATA = {
|
||||
"ip": "10.10.10.72",
|
||||
"ip": "192.168.200.75",
|
||||
"port": 1812,
|
||||
"secret": "testing123",
|
||||
"user": "user",
|
||||
"password": "password",
|
||||
"user": "nolaradius",
|
||||
"password": "nolastart",
|
||||
"pk_password": "whatever"
|
||||
}
|
||||
|
||||
PASSPOINT_RADIUS_SERVER_DATA = {
|
||||
"ip": "52.234.179.191",
|
||||
"port": 11812,
|
||||
"secret": "yeababy20!",
|
||||
"user": "nolaradius",
|
||||
"password": "nolastart",
|
||||
"pk_password": "whatever"
|
||||
}
|
||||
|
||||
PASSPOINT_RADIUS_ACCOUNTING_SERVER_DATA = {
|
||||
"ip": "52.234.179.191",
|
||||
"port": 11813,
|
||||
"secret": "yeababy20!"
|
||||
}
|
||||
|
||||
PASSPOINT_PROVIDER_INFO = {
|
||||
"mcc": None,
|
||||
"mnc": None,
|
||||
"network": None,
|
||||
"nai_realms": {
|
||||
"domain": "oss.ameriband.com",
|
||||
"encoding": 0,
|
||||
"eap_map": {"EAP-TTLS with username/password": ["Credential Type:username/password",
|
||||
"Non-EAP Inner Authentication Type:MSCHAPV2"]}
|
||||
},
|
||||
"osu_nai_standalone": "anonymous@ameriband.com",
|
||||
"osu_nai_shared": "anonymous@ameriband.com",
|
||||
"roaming_oi": []
|
||||
}
|
||||
|
||||
PASSPOINT_OPERATOR_INFO = {
|
||||
"osen": "Disabled",
|
||||
"domain_name_list": ["telecominfraproject.atlassian.net"],
|
||||
"operator_names": [
|
||||
{"locale": "eng", "name": "Default friendly passpoint_operator name"},
|
||||
{"locale": "fra", "name": "Nom de l'opérateur convivial par défaut"}
|
||||
]
|
||||
}
|
||||
|
||||
PASSPOINT_VENUE_INFO = {
|
||||
"venue_type": {"group": "Business", "type": "Police Station"},
|
||||
"venue_names": [
|
||||
{"locale": "eng", "name": "Example passpoint_venue", "url": "http://www.example.com/info-eng"},
|
||||
{"locale": "fra", "name": "Exemple de lieu", "url": "http://www.example.com/info-fra"}
|
||||
]
|
||||
}
|
||||
|
||||
PASSPOINT_PROFILE_INFO = {
|
||||
"profile_download_url_ios": "https://onboard.almondlabs.net/ttls/AmeriBand-Profile.mobileconfig",
|
||||
"profile_download_url_android": "https://onboard.almondlabs.net/ttls/androidconfig.cfg",
|
||||
"profile_name_on_device": "AmeriBand",
|
||||
"radius_configuration": {
|
||||
"user_defined_nas_id": "FB001AP001",
|
||||
"operator_id": "AmeribandTIP",
|
||||
"radius_acounting_service_interval": 60
|
||||
},
|
||||
"interworking_hs2dot0": "Enabled",
|
||||
"hessid": None,
|
||||
"access_network": {
|
||||
"Access Network Type": "Free Public Network",
|
||||
"Authentication Type": "Acceptance of Terms & Conditions",
|
||||
"Emergency Services Reachable": "Enabled",
|
||||
"Unauthenticated Emergency Service": "Disabled",
|
||||
},
|
||||
"ip_connectivity": {
|
||||
"Internet Connectivity": "Enabled",
|
||||
"IP Address Type": "Public IPv4 Address Available",
|
||||
"Connection Capability": [{"status": "open", "protocol": "TCP", "port": 8888}],
|
||||
"ANQP Domain ID": 1234,
|
||||
"GAS Address 3 Behaviour": "P2P Spec Workaround From Request",
|
||||
"Disable DGAF": False
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASES = {
|
||||
"ap_upgrade": 2233,
|
||||
"5g_wpa2_bridge": 2236,
|
||||
@@ -323,8 +473,8 @@ TEST_CASES = {
|
||||
"5g_wpa3_vlan": 9751,
|
||||
"ssid_2g_wpa3_eap_bridge": 9752,
|
||||
"ssid_5g_wpa3_eap_bridge": 9753,
|
||||
"2g_wpa3_eap_bridge": 9754,
|
||||
"5g_wpa3_eap_bridge": 9755,
|
||||
"2g_wpa3_eap_ttls_bridge": 9754,
|
||||
"5g_wpa3_eap_ttls_bridge": 9755,
|
||||
"ssid_2g_wpa3_eap_nat": 9756,
|
||||
"ssid_5g_wpa3_eap_nat": 9757,
|
||||
"ssid_2g_wpa3_eap_vlan": 9758,
|
||||
@@ -335,9 +485,9 @@ TEST_CASES = {
|
||||
"5g_wpa3_eap_ttls_vlan": 9763,
|
||||
"ssid_2g_wpa3_mixed_bridge": 9764,
|
||||
"ssid_5g_wpa3_mixed_bridge": 9765,
|
||||
# "2g_wpa3_mixed_wpa2_bridge": 9766,
|
||||
"2g_wpa3_mixed_eap_ttls_wpa3_bridge": 9766,
|
||||
"2g_wpa3_mixed_wpa3_bridge": 9767,
|
||||
# "5g_wpa3_mixed_wpa2_bridge": 9768,
|
||||
"5g_wpa3_mixed_eap_ttls_wpa3_bridge": 9768,
|
||||
"5g_wpa3_mixed_wpa3_bridge": 9769,
|
||||
"ssid_2g_wpa3_mixed_nat": 9770,
|
||||
"ssid_5g_wpa3_mixed_nat": 9771,
|
||||
@@ -440,5 +590,4 @@ TEST_CASES = {
|
||||
"5g_open_nat": 4322,
|
||||
"2g_open_vlan": 9897,
|
||||
"5g_open_vlan": 9898
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,9 +7,10 @@ import os
|
||||
import time
|
||||
import allure
|
||||
import logging
|
||||
|
||||
if "logs" not in os.listdir():
|
||||
os.mkdir("logs/")
|
||||
logging.basicConfig(level=logging.INFO, filename="logs/"+'{:%Y-%m-%d-%H-%M-%S}.log'.format(datetime.datetime.now()))
|
||||
logging.basicConfig(level=logging.INFO, filename="logs/" + '{:%Y-%m-%d-%H-%M-%S}.log'.format(datetime.datetime.now()))
|
||||
sys.path.append(
|
||||
os.path.dirname(
|
||||
os.path.realpath(__file__)
|
||||
@@ -59,6 +60,7 @@ def pytest_addoption(parser):
|
||||
parser.addini("influx_bucket", "influx bucket", default="tip-cicd")
|
||||
parser.addini("influx_org", "influx organization", default="tip")
|
||||
parser.addini("build", "AP Firmware build URL", default="0")
|
||||
parser.addini("cloud_ctlr", "AP Firmware build URL", default="0")
|
||||
|
||||
parser.addini("num_stations", "Number of Stations/Clients for testing")
|
||||
|
||||
@@ -183,9 +185,11 @@ def radius_info():
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def get_configuration(testbed):
|
||||
def get_configuration(testbed, request):
|
||||
"""yields the selected testbed information from lab info file (configuration.py)"""
|
||||
allure.attach(body=str(testbed), name="Testbed Selected: ")
|
||||
if request.config.getini("cloud_ctlr") != "0":
|
||||
CONFIGURATION[testbed]["controller"]["url"] = request.config.getini("cloud_ctlr")
|
||||
yield CONFIGURATION[testbed]
|
||||
|
||||
|
||||
@@ -224,6 +228,7 @@ def instantiate_access_point(testbed, get_apnos, get_configuration):
|
||||
@pytest.fixture(scope="session")
|
||||
def setup_controller(request, get_configuration, instantiate_access_point):
|
||||
"""sets up the controller connection and yields the sdk_client object"""
|
||||
|
||||
try:
|
||||
sdk_client = Controller(controller_data=get_configuration["controller"])
|
||||
allure.attach(body=str(get_configuration["controller"]), name="Controller Instantiated: ")
|
||||
@@ -286,11 +291,21 @@ def upload_firmware(should_upload_firmware, instantiate_firmware):
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def upgrade_firmware(request, instantiate_firmware, get_equipment_id, check_ap_firmware_cloud, get_latest_firmware,
|
||||
should_upgrade_firmware, should_upload_firmware):
|
||||
should_upgrade_firmware, should_upload_firmware, get_apnos, get_configuration):
|
||||
"""yields the status of upgrade of firmware. waits for 300 sec after each upgrade request"""
|
||||
print(should_upgrade_firmware, should_upload_firmware)
|
||||
status_list = []
|
||||
if get_latest_firmware != check_ap_firmware_cloud:
|
||||
active_fw_list = []
|
||||
try:
|
||||
for access_point in get_configuration['access_point']:
|
||||
ap_ssh = get_apnos(access_point)
|
||||
active_fw = ap_ssh.get_active_firmware()
|
||||
active_fw_list.append(active_fw)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
active_fw_list = []
|
||||
print(active_fw_list, get_latest_firmware)
|
||||
if get_latest_firmware != active_fw_list:
|
||||
if request.config.getoption("--skip-upgrade"):
|
||||
status = "skip-upgrade"
|
||||
status_list.append(status)
|
||||
@@ -304,7 +319,8 @@ def upgrade_firmware(request, instantiate_firmware, get_equipment_id, check_ap_f
|
||||
else:
|
||||
if should_upgrade_firmware:
|
||||
for i in range(0, len(instantiate_firmware)):
|
||||
status = instantiate_firmware[i].upgrade_fw(equipment_id=get_equipment_id[i], force_upload=False,
|
||||
status = instantiate_firmware[i].upgrade_fw(equipment_id=get_equipment_id[i],
|
||||
force_upload=should_upload_firmware,
|
||||
force_upgrade=should_upgrade_firmware)
|
||||
allure.attach(name="Firmware Upgrade Request", body=str(status))
|
||||
status_list.append(status)
|
||||
@@ -342,6 +358,7 @@ def check_ap_firmware_ssh(get_configuration):
|
||||
def setup_test_run(setup_controller, upgrade_firmware, get_configuration, get_equipment_id, get_latest_firmware,
|
||||
get_apnos):
|
||||
"""used to upgrade the firmware on AP and should be called on each test case on a module level"""
|
||||
|
||||
active_fw_list = []
|
||||
try:
|
||||
for access_point in get_configuration['access_point']:
|
||||
@@ -351,6 +368,7 @@ def setup_test_run(setup_controller, upgrade_firmware, get_configuration, get_eq
|
||||
except Exception as e:
|
||||
print(e)
|
||||
active_fw_list = []
|
||||
print(active_fw_list, get_latest_firmware)
|
||||
if active_fw_list == get_latest_firmware:
|
||||
yield True
|
||||
else:
|
||||
@@ -394,7 +412,7 @@ def get_security_flags():
|
||||
"""used to get the essential markers on security and band"""
|
||||
# Add more classifications as we go
|
||||
security = ["open", "wpa", "wep", "wpa2_personal", "wpa3_personal", "wpa3_personal_mixed",
|
||||
"wpa_wpa2_enterprise_mixed",
|
||||
"wpa_wpa2_enterprise_mixed", "wpa2_eap", "wpa2_only_eap",
|
||||
"wpa_wpa2_personal_mixed", "wpa_enterprise", "wpa2_enterprise", "wpa3_enterprise_mixed",
|
||||
"wpa3_enterprise", "twog", "fiveg", "radius"]
|
||||
yield security
|
||||
@@ -488,7 +506,6 @@ def traffic_generator_connectivity(testbed, get_configuration):
|
||||
yield True
|
||||
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_lanforge_chamberview_dut(get_configuration, testbed):
|
||||
""" Create a DUT on LANforge"""
|
||||
@@ -557,3 +574,6 @@ def setup_influx(request, testbed, get_configuration):
|
||||
"influx_tag": [testbed, get_configuration["access_point"][0]["model"]],
|
||||
}
|
||||
yield influx_params
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ class TestSetupBridgeEnterpriseSuiteA(object):
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa2_enterprise_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
@@ -87,7 +87,7 @@ class TestSetupBridgeEnterpriseSuiteA(object):
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa2_enterprise_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
@@ -135,6 +135,7 @@ class TestSetupBridgeEnterpriseSuiteA(object):
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.sanity_light
|
||||
def test_setup_equipment_ap_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
""" Equipment AP Profile Suite A Enterprise """
|
||||
@@ -149,6 +150,7 @@ class TestSetupBridgeEnterpriseSuiteA(object):
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.sanity_light
|
||||
def test_verify_vif_config(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
""" VIF Config Suite A Enterprise """
|
||||
@@ -163,6 +165,7 @@ class TestSetupBridgeEnterpriseSuiteA(object):
|
||||
msg='Failed to push profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.sanity_light
|
||||
@allure.severity(allure.severity_level.BLOCKER)
|
||||
def test_verify_vif_state(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
@@ -78,7 +78,7 @@ class TestSetupBridgeSuiteA(object):
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
@@ -96,7 +96,7 @@ class TestSetupBridgeSuiteA(object):
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
@@ -114,7 +114,7 @@ class TestSetupBridgeSuiteA(object):
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa2_personal_2g_ssid_profile(self, setup_profiles, update_report,
|
||||
@@ -133,7 +133,7 @@ class TestSetupBridgeSuiteA(object):
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa2_personal_5g_ssid_profile(self, setup_profiles, update_report,
|
||||
@@ -152,7 +152,7 @@ class TestSetupBridgeSuiteA(object):
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
def test_setup_equipment_ap_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
""" Equipment AP Profile SuiteA General """
|
||||
@@ -167,7 +167,7 @@ class TestSetupBridgeSuiteA(object):
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
def test_verify_vif_config(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
""" vifc SuiteA General """
|
||||
@@ -182,7 +182,7 @@ class TestSetupBridgeSuiteA(object):
|
||||
msg='Failed to push profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
@allure.severity(allure.severity_level.BLOCKER)
|
||||
def test_verify_vif_state(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
@@ -71,7 +71,7 @@ class TestSetupNATEnterpriseSuiteA(object):
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa2_enterprise_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
@@ -87,7 +87,7 @@ class TestSetupNATEnterpriseSuiteA(object):
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa2_enterprise_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
@@ -135,7 +135,7 @@ class TestSetupNATEnterpriseSuiteA(object):
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
def test_setup_equipment_ap_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
""" Equipment AP Profile Suite A Enterprise """
|
||||
@@ -150,7 +150,7 @@ class TestSetupNATEnterpriseSuiteA(object):
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
def test_verify_vif_config(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
""" VIF Config Suite A Enterprise """
|
||||
@@ -165,7 +165,7 @@ class TestSetupNATEnterpriseSuiteA(object):
|
||||
msg='Failed to push profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
@allure.severity(allure.severity_level.BLOCKER)
|
||||
def test_verify_vif_state(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
@@ -78,7 +78,7 @@ class TestSetupNATSuiteA(object):
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
@@ -96,7 +96,7 @@ class TestSetupNATSuiteA(object):
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
@@ -114,7 +114,7 @@ class TestSetupNATSuiteA(object):
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa2_personal_2g_ssid_profile(self, setup_profiles, update_report,
|
||||
@@ -133,7 +133,7 @@ class TestSetupNATSuiteA(object):
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa2_personal_5g_ssid_profile(self, setup_profiles, update_report,
|
||||
@@ -152,7 +152,7 @@ class TestSetupNATSuiteA(object):
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
def test_setup_equipment_ap_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
""" Equipment AP Profile SuiteA General """
|
||||
@@ -167,7 +167,7 @@ class TestSetupNATSuiteA(object):
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
def test_verify_vif_config(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
""" vifc SuiteA General """
|
||||
@@ -182,7 +182,7 @@ class TestSetupNATSuiteA(object):
|
||||
msg='Failed to push profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
@allure.severity(allure.severity_level.BLOCKER)
|
||||
def test_verify_vif_state(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
@@ -71,7 +71,7 @@ class TestSetupVLANEnterpriseSuiteA(object):
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa2_enterprise_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
@@ -87,7 +87,7 @@ class TestSetupVLANEnterpriseSuiteA(object):
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa2_enterprise_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
@@ -135,7 +135,7 @@ class TestSetupVLANEnterpriseSuiteA(object):
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
def test_setup_equipment_ap_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
""" Equipment AP Profile Suite A Enterprise """
|
||||
@@ -150,7 +150,7 @@ class TestSetupVLANEnterpriseSuiteA(object):
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
def test_verify_vif_config(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
""" VIF Config Suite A Enterprise """
|
||||
@@ -165,7 +165,7 @@ class TestSetupVLANEnterpriseSuiteA(object):
|
||||
msg='Failed to push profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
@allure.severity(allure.severity_level.BLOCKER)
|
||||
def test_verify_vif_state(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
@@ -78,7 +78,7 @@ class TestSetupVLANSuiteA(object):
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
@@ -96,7 +96,7 @@ class TestSetupVLANSuiteA(object):
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
@@ -114,7 +114,7 @@ class TestSetupVLANSuiteA(object):
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa2_personal_2g_ssid_profile(self, setup_profiles, update_report,
|
||||
@@ -133,7 +133,7 @@ class TestSetupVLANSuiteA(object):
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa2_personal_5g_ssid_profile(self, setup_profiles, update_report,
|
||||
@@ -152,7 +152,7 @@ class TestSetupVLANSuiteA(object):
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
def test_setup_equipment_ap_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
""" Equipment AP Profile SuiteA General """
|
||||
@@ -167,7 +167,7 @@ class TestSetupVLANSuiteA(object):
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
def test_verify_vif_config(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
""" vifc SuiteA General """
|
||||
@@ -182,7 +182,7 @@ class TestSetupVLANSuiteA(object):
|
||||
msg='Failed to push profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
@allure.severity(allure.severity_level.BLOCKER)
|
||||
def test_verify_vif_state(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
@@ -122,7 +122,7 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment
|
||||
# Radius Profile Creation
|
||||
if parameter["radius"]:
|
||||
radius_info = radius_info
|
||||
radius_info["name"] = testbed + "-Automation-Radius-Profile-" + testbed
|
||||
radius_info["name"] = testbed + "-Automation-Radius-Profile-" + mode
|
||||
instantiate_profile.delete_profile_by_name(profile_name=testbed + "-Automation-Radius-Profile-" + mode)
|
||||
try:
|
||||
instantiate_profile.create_radius_profile(radius_info=radius_info)
|
||||
@@ -568,14 +568,33 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment
|
||||
allure.attach(body=str("VIF Config: " + str(vif_config) + "\n" + "VIF State: " + str(vif_state)),
|
||||
name="SSID Profiles in VIF Config and VIF State: ")
|
||||
|
||||
ap_logs = ap_ssh.logread()
|
||||
allure.attach(body=ap_logs, name="AP LOgs: ")
|
||||
ssid_info = ap_ssh.get_ssid_info()
|
||||
ssid_data = []
|
||||
print(ssid_info)
|
||||
for i in range(0, len(ssid_info)):
|
||||
if ssid_info[i][1] == "OPEN":
|
||||
ssid_info[i].append("")
|
||||
ssid = ["ssid_idx=" + str(i) + " ssid=" + ssid_info[i][3] +
|
||||
" password=" + ssid_info[i][2] + " bssid=" + ssid_info[i][0]]
|
||||
if ssid_info[i][1] == "OPEN":
|
||||
ssid = ["ssid_idx=" + str(i) + " ssid=" + ssid_info[i][3] + " security=OPEN" +
|
||||
" password=" + ssid_info[i][2] + " bssid=" + ssid_info[i][0]]
|
||||
if ssid_info[i][1] == "WPA":
|
||||
ssid = ["ssid_idx=" + str(i) + " ssid=" + ssid_info[i][3] + " security=WPA" +
|
||||
" password=" + ssid_info[i][2] + " bssid=" + ssid_info[i][0]]
|
||||
if ssid_info[i][1] == "WPA2":
|
||||
ssid = ["ssid_idx=" + str(i) + " ssid=" + ssid_info[i][3] + " security=WPA2" +
|
||||
" password=" + ssid_info[i][2] + " bssid=" + ssid_info[i][0]]
|
||||
if ssid_info[i][1] == "WPA3_PERSONAL":
|
||||
ssid = ["ssid_idx=" + str(i) + " ssid=" + ssid_info[i][3] + " security=WPA3" +
|
||||
" password=" + ssid_info[i][2] + " bssid=" + ssid_info[i][0]]
|
||||
if ssid_info[i][1] == "WPA | WPA2":
|
||||
ssid = ["ssid_idx=" + str(i) + " ssid=" + ssid_info[i][3] + " security=WPA|WPA2" +
|
||||
" password=" + ssid_info[i][2] + " bssid=" + ssid_info[i][0]]
|
||||
if ssid_info[i][1] == "EAP-TTLS":
|
||||
ssid = ["ssid_idx=" + str(i) + " ssid=" + ssid_info[i][3] + " security=EAP-TTLS" +
|
||||
" password=" + ssid_info[i][2] + " bssid=" + ssid_info[i][0]]
|
||||
|
||||
ssid_data.append(ssid)
|
||||
|
||||
# Add bssid password and security from iwinfo data
|
||||
@@ -634,7 +653,9 @@ def num_stations(request):
|
||||
@pytest.fixture(scope="class")
|
||||
def get_vif_state(get_apnos, get_configuration):
|
||||
ap_ssh = get_apnos(get_configuration['access_point'][0], pwd="../libs/apnos/")
|
||||
vif_config = list(ap_ssh.get_vif_config_ssids())
|
||||
vif_state = list(ap_ssh.get_vif_state_ssids())
|
||||
vif_state.sort()
|
||||
vif_config.sort()
|
||||
allure.attach(name="vif_state", body=str(vif_state))
|
||||
yield vif_state
|
||||
|
||||
@@ -59,7 +59,7 @@ class TestDataplaneThroughputBridge(object):
|
||||
|
||||
if station:
|
||||
dp_obj = lf_test.dataplane(station_name=station_names_twog, mode=mode,
|
||||
instance_name="TIP_PERF_DPT_WPA2_2G",
|
||||
instance_name="TIP_DPT_DPT_WPA2_2G_BRIDGE",
|
||||
vlan_id=vlan, dut_name=dut_name)
|
||||
report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
|
||||
entries = os.listdir("../reports/" + report_name + '/')
|
||||
@@ -99,7 +99,7 @@ class TestDataplaneThroughputBridge(object):
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if station:
|
||||
dp_obj = lf_test.dataplane(station_name=station_names_fiveg, mode=mode, instance_name="TIP_PERF_DPT_WPA2_5G",
|
||||
dp_obj = lf_test.dataplane(station_name=station_names_fiveg, mode=mode, instance_name="TIP_DPT_DPT_WPA2_5G_BRIDGE",
|
||||
vlan_id=vlan, dut_name=dut_name)
|
||||
report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
|
||||
entries = os.listdir("../reports/"+report_name + '/')
|
||||
|
||||
@@ -59,7 +59,7 @@ class TestDataplaneThroughputNAT(object):
|
||||
|
||||
if station:
|
||||
dp_obj = lf_test.dataplane(station_name=station_names_twog, mode=mode,
|
||||
instance_name="TIP_PERF_DPT_WPA2_2G",
|
||||
instance_name="TIP_DPT_DPT_WPA2_2G_NAT",
|
||||
vlan_id=vlan, dut_name=dut_name)
|
||||
report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
|
||||
entries = os.listdir("../reports/" + report_name + '/')
|
||||
@@ -99,7 +99,7 @@ class TestDataplaneThroughputNAT(object):
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if station:
|
||||
dp_obj = lf_test.dataplane(station_name=station_names_fiveg, mode=mode, instance_name="TIP_PERF_DPT_WPA2_5G",
|
||||
dp_obj = lf_test.dataplane(station_name=station_names_fiveg, mode=mode, instance_name="TIP_DPT_DPT_WPA2_5G_NAT",
|
||||
vlan_id=vlan, dut_name=dut_name)
|
||||
report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
|
||||
entries = os.listdir("../reports/"+report_name + '/')
|
||||
|
||||
@@ -59,7 +59,7 @@ class TestDataplaneThroughputVLAN(object):
|
||||
|
||||
if station:
|
||||
dp_obj = lf_test.dataplane(station_name=station_names_twog, mode=mode,
|
||||
instance_name="TIP_PERF_DPT_WPA2_2G",
|
||||
instance_name="TIP_DPT_DPT_WPA2_2G_VLAN",
|
||||
vlan_id=vlan, dut_name=dut_name)
|
||||
report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
|
||||
entries = os.listdir("../reports/" + report_name + '/')
|
||||
@@ -99,8 +99,8 @@ class TestDataplaneThroughputVLAN(object):
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if station:
|
||||
dp_obj = lf_test.dataplane(station_name=station_names_fiveg, mode=mode, instance_name="TIP_PERF_DPT_WPA2_5G",
|
||||
vlan_id=vlan, dut_name=dut_name)
|
||||
dp_obj = lf_test.dataplane(station_name=station_names_fiveg, mode=mode,
|
||||
instance_name="TIP_DPT_DPT_WPA2_5G_VLAN", vlan_id=vlan, dut_name=dut_name)
|
||||
report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
|
||||
entries = os.listdir("../reports/"+report_name + '/')
|
||||
pdf = False
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
import allure
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.firmware, pytest.mark.sanity, pytest.mark.sanity_55,
|
||||
pytest.mark.usefixtures("setup_test_run")]
|
||||
pytestmark = [pytest.mark.firmware, pytest.mark.sanity, pytest.mark.sanity_light, pytest.mark.usefixtures("setup_test_run")]
|
||||
|
||||
|
||||
@allure.testcase("firmware upgrade from Cloud")
|
||||
@@ -44,8 +43,12 @@ class TestFirmware(object):
|
||||
assert PASS
|
||||
|
||||
@pytest.mark.check_active_firmware_cloud
|
||||
def test_active_version_cloud(self, get_latest_firmware, check_ap_firmware_cloud, update_report, test_cases):
|
||||
if get_latest_firmware != check_ap_firmware_cloud:
|
||||
def test_active_version_cloud(self, get_latest_firmware, get_equipment_id, setup_controller,
|
||||
update_report, test_cases):
|
||||
ap_fw_list = []
|
||||
for i in get_equipment_id:
|
||||
ap_fw_list.append(setup_controller.get_ap_firmware_old_method(equipment_id=i))
|
||||
if get_latest_firmware != ap_fw_list:
|
||||
update_report.update_testrail(case_id=test_cases["cloud_fw"],
|
||||
status_id=5,
|
||||
msg='CLOUDSDK reporting incorrect firmware version.')
|
||||
@@ -54,10 +57,11 @@ class TestFirmware(object):
|
||||
status_id=1,
|
||||
msg='CLOUDSDK reporting correct firmware version.')
|
||||
|
||||
assert get_latest_firmware == check_ap_firmware_cloud
|
||||
assert get_latest_firmware == ap_fw_list
|
||||
|
||||
|
||||
@pytest.mark.firmware_ap
|
||||
|
||||
def test_ap_firmware(get_configuration, get_apnos, get_latest_firmware, update_report,
|
||||
test_cases):
|
||||
"""yields the active version of firmware on ap"""
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
"""
|
||||
|
||||
Client Connectivity Enterprise TTLS
|
||||
pytest -m "client_connectivity and bridge and enterprise and ttls"
|
||||
|
||||
"""
|
||||
import allure
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.client_connectivity, pytest.mark.bridge, pytest.mark.enterprise, pytest.mark.ttls,
|
||||
pytest.mark.sanity, pytest.mark.usefixtures("setup_test_run")]
|
||||
mode = "BRIDGE"
|
||||
|
||||
pytestmark = [pytest.mark.client_connectivity, pytest.mark.usefixtures("setup_test_run"), pytest.mark.bridge, pytest.mark.enterprise, pytest.mark.ttls,
|
||||
pytest.mark.sanity]
|
||||
|
||||
setup_params_enterprise = {
|
||||
"mode": "BRIDGE",
|
||||
"mode": mode,
|
||||
"ssid_modes": {
|
||||
"wpa_enterprise": [
|
||||
{"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
@@ -28,7 +24,6 @@ setup_params_enterprise = {
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.suiteA
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_enterprise],
|
||||
@@ -36,33 +31,29 @@ setup_params_enterprise = {
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestBridgeModeEnterpriseTTLSSuiteA(object):
|
||||
""" SuiteA Enterprise Test Cases
|
||||
pytest -m "client_connectivity and bridge and enterprise and ttls and suiteA"
|
||||
"""
|
||||
class TestbridgeModeEnterpriseTTLSSuiteOne(object):
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa_enterprise_2g(self, get_vif_state,
|
||||
station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa_enterprise_2g(self, get_vif_state,station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
""" wpa enterprise 2g
|
||||
pytest -m "client_connectivity and bridge and enterprise and ttls and wpa_enterprise and twog"
|
||||
"""
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa"
|
||||
extra_secu = ["wpa2"]
|
||||
mode = "BRIDGE"
|
||||
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
ieee80211w = 1
|
||||
if ssid_name not in get_vif_state:
|
||||
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
|
||||
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, extra_securities=extra_secu,
|
||||
mode=mode, band=band,
|
||||
mode=mode, band=band, ieee80211w=ieee80211w,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
@@ -82,23 +73,27 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object):
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa_enterprise_5g(self, get_vif_state,station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
""" wpa enterprise 2g
|
||||
pytest -m "client_connectivity and bridge and enterprise and ttls and wpa_enterprise and fiveg"
|
||||
"""
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa"
|
||||
extra_secu = ["wpa2"]
|
||||
mode = "BRIDGE"
|
||||
band = "twog"
|
||||
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
pairwise = "CCMP"
|
||||
group = "CCMP"
|
||||
ieee80211w =1
|
||||
identity = radius_info['user']
|
||||
if ssid_name not in get_vif_state:
|
||||
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
|
||||
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, extra_securities=extra_secu,
|
||||
mode=mode, band=band,
|
||||
mode=mode, band=band, group=group, pairwise=pairwise, ieee80211w=ieee80211w,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
@@ -110,25 +105,22 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object):
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa_eap_ttls_bridge"],
|
||||
status_id=5,
|
||||
msg='5G Enterprise WPA Client Connectivity Failed - bridge mode' + str(
|
||||
msg='5G WPA Enterprise Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa2_enterprise_2g(self, get_vif_state,
|
||||
station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa2_enterprise_2g(self, get_vif_state,station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
""" wpa enterprise 2g
|
||||
pytest -m "client_connectivity and bridge and enterprise and ttls and wpa2_enterprise and twog"
|
||||
"""
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa2"
|
||||
mode = "BRIDGE"
|
||||
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
@@ -156,19 +148,16 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object):
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa2_enterprise_5g(self, get_vif_state,
|
||||
station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa2_enterprise_5g(self, get_vif_state, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
""" wpa enterprise 2g
|
||||
pytest -m "client_connectivity and bridge and enterprise and ttls and wpa2_enterprise and fiveg"
|
||||
"""
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa2"
|
||||
mode = "BRIDGE"
|
||||
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
@@ -198,36 +187,34 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object):
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa3_enterprise_2g(self, get_vif_state,
|
||||
station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa3_enterprise_2g(self, get_vif_state,station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
""" wpa enterprise 2g
|
||||
pytest -m "client_connectivity and bridge and enterprise and ttls and wpa3_enterprise and twog"
|
||||
"""
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa3"
|
||||
mode = "BRIDGE"
|
||||
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
key_mgmt = "WPA-EAP-SHA256"
|
||||
identity = radius_info['user']
|
||||
if ssid_name not in get_vif_state:
|
||||
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
|
||||
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
mode=mode, band=band,
|
||||
mode=mode, band=band, key_mgmt=key_mgmt,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa3_eap_bridge"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa3_eap_ttls_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA3 Enterprise Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa3_eap_bridge"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa3_eap_ttls_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA3 Enterprise Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
@@ -237,36 +224,34 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object):
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa3_enterprise_5g(self, get_vif_state,
|
||||
station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa3_enterprise_5g(self, get_vif_state,station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
""" wpa enterprise 2g
|
||||
pytest -m "client_connectivity and bridge and enterprise and ttls and wpa3_enterprise and fiveg"
|
||||
"""
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa3"
|
||||
mode = "BRIDGE"
|
||||
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
key_mgmt = "WPA-EAP-SHA256"
|
||||
identity = radius_info['user']
|
||||
if ssid_name not in get_vif_state:
|
||||
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
|
||||
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
mode=mode, band=band,
|
||||
mode=mode, band=band, key_mgmt = "WPA-EAP-SHA256",
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa3_eap_bridge"],
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa3_eap_ttls_bridge"],
|
||||
status_id=1,
|
||||
msg='5G WPA3 Enterprise Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa3_eap_bridge"],
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa3_eap_ttls_bridge"],
|
||||
status_id=5,
|
||||
msg='5G WPA3 Enterprise Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
@@ -276,7 +261,7 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object):
|
||||
|
||||
|
||||
setup_params_enterprise_two = {
|
||||
"mode": "BRIDGE",
|
||||
"mode": mode,
|
||||
"ssid_modes": {
|
||||
"wpa_wpa2_enterprise_mixed": [
|
||||
{"ssid_name": "ssid_wpa_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
@@ -290,7 +275,7 @@ setup_params_enterprise_two = {
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.suiteB
|
||||
@pytest.mark.enterprise
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_enterprise_two],
|
||||
@@ -298,24 +283,18 @@ setup_params_enterprise_two = {
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestBridgeModeEnterpriseTTLSSuiteTwo(object):
|
||||
""" SuiteA Enterprise Test Cases
|
||||
pytest -m "client_connectivity and bridge and enterprise and ttls and suiteB"
|
||||
"""
|
||||
class TestbridgeModeEnterpriseTTLSSuiteTwo(object):
|
||||
|
||||
@pytest.mark.wpa_wpa2_enterprise_mixed
|
||||
@pytest.mark.twog
|
||||
def test_wpa_wpa2_enterprise_2g(self, get_vif_state,
|
||||
station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa_wpa2_enterprise_mixed_2g(self, get_vif_state,station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
""" wpa enterprise 2g
|
||||
pytest -m "client_connectivity and bridge and enterprise and ttls and wpa_wpa2_enterprise_mixed and twog"
|
||||
"""
|
||||
profile_data = setup_params_enterprise_two["ssid_modes"]["wpa_wpa2_enterprise_mixed"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa"
|
||||
extra_secu = ["wpa2"]
|
||||
mode = "BRIDGE"
|
||||
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
@@ -330,12 +309,12 @@ class TestBridgeModeEnterpriseTTLSSuiteTwo(object):
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa2_mixed_eap_wpa2_bridge"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa2_mixed_eap_ttls_wpa2_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA2 Mixed Enterprise Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa2_mixed_eap_wpa2_bridge"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa2_mixed_eap_ttls_wpa2_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA2 Mixed Enterprise Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
@@ -345,18 +324,15 @@ class TestBridgeModeEnterpriseTTLSSuiteTwo(object):
|
||||
|
||||
@pytest.mark.wpa_wpa2_enterprise_mixed
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa_wpa2_enterprise_5g(self, get_vif_state,
|
||||
station_names_fiveg, setup_profiles, get_lanforge_data, lf_test,
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa_wpa2_enterprise_mixed_5g(self, get_vif_state,station_names_fiveg, setup_profiles, get_lanforge_data, lf_test,
|
||||
update_report, test_cases, radius_info, exit_on_fail):
|
||||
""" wpa enterprise 2g
|
||||
pytest -m "client_connectivity and bridge and enterprise and ttls and wpa_wpa2_enterprise_mixed and fiveg"
|
||||
"""
|
||||
profile_data = setup_params_enterprise_two["ssid_modes"]["wpa_wpa2_enterprise_mixed"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa"
|
||||
extra_secu = ["wpa2"]
|
||||
mode = "BRIDGE"
|
||||
band = "twog"
|
||||
|
||||
band = "fievg"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
@@ -372,12 +348,12 @@ class TestBridgeModeEnterpriseTTLSSuiteTwo(object):
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa2_mixed_eap_ttls_wpa2_bridge"],
|
||||
status_id=1,
|
||||
msg='5G WPA Mixed Enterprise Client Connectivity Passed successfully - bridge mode' + str(
|
||||
msg='5G WPA2 Mixed Enterprise Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa2_mixed_eap_ttls_wpa2_bridge"],
|
||||
status_id=5,
|
||||
msg='25G WPA2 Mixed Enterprise Client Connectivity Failed - bridge mode' + str(
|
||||
msg='5G WPA2 Mixed Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
@@ -385,16 +361,13 @@ class TestBridgeModeEnterpriseTTLSSuiteTwo(object):
|
||||
|
||||
@pytest.mark.wpa3_enterprise_mixed
|
||||
@pytest.mark.twog
|
||||
def test_wpa3_enterprise_mixed_2g(self, get_vif_state,
|
||||
station_names_twog, setup_profiles, get_lanforge_data, lf_test,
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa3_enterprise_mixed_2g(self, get_vif_state,station_names_twog, setup_profiles, get_lanforge_data, lf_test,
|
||||
update_report, test_cases, radius_info, exit_on_fail):
|
||||
""" wpa enterprise 2g
|
||||
pytest -m "client_connectivity and bridge and enterprise and ttls and wpa3_enterprise_mixed and twog"
|
||||
"""
|
||||
profile_data = setup_params_enterprise_two["ssid_modes"]["wpa3_enterprise_mixed"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa3"
|
||||
mode = "BRIDGE"
|
||||
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
@@ -409,12 +382,12 @@ class TestBridgeModeEnterpriseTTLSSuiteTwo(object):
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa3_mixed_eap_ttls_wpa3_vlan"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa3_mixed_eap_ttls_wpa3_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA3 Mixed Enterprise Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa3_mixed_eap_ttls_wpa3_vlan"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa3_mixed_eap_ttls_wpa3_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA3 Mixed Enterprise Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
@@ -424,17 +397,13 @@ class TestBridgeModeEnterpriseTTLSSuiteTwo(object):
|
||||
|
||||
@pytest.mark.wpa3_enterprise_mixed
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa3_enterprise_mixed_5g(self, get_vif_state,
|
||||
station_names_fiveg, setup_profiles, get_lanforge_data, lf_test,
|
||||
def test_wpa3_enterprise_mixed_5g(self, get_vif_state,station_names_fiveg, setup_profiles, get_lanforge_data, lf_test,
|
||||
update_report, exit_on_fail,
|
||||
test_cases, radius_info):
|
||||
""" wpa enterprise 2g
|
||||
pytest -m "client_connectivity and bridge and enterprise and ttls and wpa3_enterprise_mixed and fiveg"
|
||||
"""
|
||||
profile_data = setup_params_enterprise_two["ssid_modes"]["wpa3_enterprise_mixed"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa3"
|
||||
mode = "BRIDGE"
|
||||
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
@@ -449,13 +418,12 @@ class TestBridgeModeEnterpriseTTLSSuiteTwo(object):
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa3_mixed_eap_ttls_wpa3_vlan"],
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa3_mixed_eap_ttls_wpa3_bridge"],
|
||||
status_id=1,
|
||||
msg='5G WPA3 Mixed Enterprise Client Connectivity Passed successfully - '
|
||||
'bridge mode' + str(
|
||||
msg='5G WPA3 Mixed Enterprise Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa3_mixed_eap_ttls_wpa3_vlan"],
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa3_mixed_eap_ttls_wpa3_bridge"],
|
||||
status_id=5,
|
||||
msg='5G WPA3 Mixed Enterprise Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"""
|
||||
|
||||
Client Connectivity and tcp-udp Traffic Test: Bridge Mode
|
||||
Client Connectivity and tcp-udp Traffic Test: bridge Mode
|
||||
pytest -m "client_connectivity and bridge and general"
|
||||
|
||||
"""
|
||||
@@ -8,11 +8,13 @@
|
||||
import allure
|
||||
import pytest
|
||||
|
||||
mode = "BRIDGE"
|
||||
|
||||
pytestmark = [pytest.mark.client_connectivity, pytest.mark.bridge, pytest.mark.general, pytest.mark.sanity,
|
||||
pytest.mark.usefixtures("setup_test_run")]
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "BRIDGE",
|
||||
"mode": mode,
|
||||
"ssid_modes": {
|
||||
"open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
@@ -29,7 +31,7 @@ setup_params_general = {
|
||||
|
||||
|
||||
@pytest.mark.suiteA
|
||||
@allure.feature("BRIDGE MODE CLIENT CONNECTIVITY")
|
||||
@allure.feature("bridge MODE CLIENT CONNECTIVITY")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_general],
|
||||
@@ -37,7 +39,7 @@ setup_params_general = {
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestBridgeModeConnectivitySuiteA(object):
|
||||
class TestbridgeModeConnectivitySuiteA(object):
|
||||
""" Client Connectivity SuiteA
|
||||
pytest -m "client_connectivity and bridge and general and suiteA"
|
||||
"""
|
||||
@@ -45,6 +47,7 @@ class TestBridgeModeConnectivitySuiteA(object):
|
||||
@pytest.mark.open
|
||||
@pytest.mark.twog
|
||||
@allure.story('open 2.4 GHZ Band')
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_open_ssid_2g(self, get_vif_state, setup_profiles, get_lanforge_data, lf_test, update_report, station_names_twog,
|
||||
test_cases):
|
||||
"""Client Connectivity open ssid 2.4G
|
||||
@@ -54,7 +57,6 @@ class TestBridgeModeConnectivitySuiteA(object):
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = "[BLANK]"
|
||||
security = "open"
|
||||
mode = "BRIDGE"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
if ssid_name not in get_vif_state:
|
||||
@@ -79,6 +81,7 @@ class TestBridgeModeConnectivitySuiteA(object):
|
||||
@pytest.mark.open
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('open 5 GHZ Band')
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_open_ssid_5g(self, get_vif_state,get_lanforge_data, lf_test, test_cases, station_names_fiveg, update_report):
|
||||
"""Client Connectivity open ssid 5G
|
||||
pytest -m "client_connectivity and bridge and general and open and fiveg"
|
||||
@@ -87,7 +90,7 @@ class TestBridgeModeConnectivitySuiteA(object):
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = "[BLANK]"
|
||||
security = "open"
|
||||
mode = "BRIDGE"
|
||||
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
if ssid_name not in get_vif_state:
|
||||
@@ -109,10 +112,11 @@ class TestBridgeModeConnectivitySuiteA(object):
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.twog
|
||||
@allure.story('wpa 2.4 GHZ Band')
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa_ssid_2g(self, get_vif_state,get_lanforge_data, update_report,
|
||||
lf_test, test_cases, station_names_twog):
|
||||
"""Client Connectivity wpa ssid 2.4G
|
||||
@@ -122,7 +126,7 @@ class TestBridgeModeConnectivitySuiteA(object):
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa"
|
||||
mode = "BRIDGE"
|
||||
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
if ssid_name not in get_vif_state:
|
||||
@@ -144,10 +148,11 @@ class TestBridgeModeConnectivitySuiteA(object):
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('wpa 5 GHZ Band')
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa_ssid_5g(self, get_vif_state,lf_test, update_report, test_cases, station_names_fiveg, get_lanforge_data):
|
||||
"""Client Connectivity wpa ssid 5G
|
||||
pytest -m "client_connectivity and bridge and general and wpa and fiveg"
|
||||
@@ -156,7 +161,7 @@ class TestBridgeModeConnectivitySuiteA(object):
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa"
|
||||
mode = "BRIDGE"
|
||||
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
if ssid_name not in get_vif_state:
|
||||
@@ -178,10 +183,11 @@ class TestBridgeModeConnectivitySuiteA(object):
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
@allure.story('wpa2_personal 2.4 GHZ Band')
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa2_personal_ssid_2g(self, get_vif_state,get_lanforge_data, lf_test, update_report, test_cases,
|
||||
station_names_twog):
|
||||
"""Client Connectivity wpa2_personal ssid 2.4G
|
||||
@@ -191,7 +197,7 @@ class TestBridgeModeConnectivitySuiteA(object):
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
mode = "BRIDGE"
|
||||
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
if ssid_name not in get_vif_state:
|
||||
@@ -213,10 +219,11 @@ class TestBridgeModeConnectivitySuiteA(object):
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('wpa2_personal 5 GHZ Band')
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa2_personal_ssid_5g(self, get_vif_state,get_lanforge_data, update_report, test_cases, station_names_fiveg,
|
||||
lf_test):
|
||||
"""Client Connectivity wpa2_personal ssid 5G
|
||||
@@ -226,7 +233,7 @@ class TestBridgeModeConnectivitySuiteA(object):
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
mode = "BRIDGE"
|
||||
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
if ssid_name not in get_vif_state:
|
||||
@@ -250,7 +257,7 @@ class TestBridgeModeConnectivitySuiteA(object):
|
||||
|
||||
|
||||
setup_params_general_two = {
|
||||
"mode": "BRIDGE",
|
||||
"mode": mode,
|
||||
"ssid_modes": {
|
||||
"wpa3_personal": [
|
||||
{"ssid_name": "ssid_wpa3_p_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
@@ -279,7 +286,7 @@ setup_params_general_two = {
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
class TestbridgeModeConnectivitySuiteB(object):
|
||||
""" Client Connectivity SuiteA
|
||||
pytest -m "client_connectivity and bridge and suiteB"
|
||||
"""
|
||||
@@ -287,6 +294,7 @@ class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
@pytest.mark.wpa3_personal
|
||||
@pytest.mark.twog
|
||||
@allure.story('open 2.4 GHZ Band')
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa3_personal_ssid_2g(self, get_vif_state,station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases):
|
||||
"""Client Connectivity open ssid 2.4G
|
||||
@@ -296,7 +304,7 @@ class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa3"
|
||||
mode = "BRIDGE"
|
||||
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
if ssid_name not in get_vif_state:
|
||||
@@ -321,6 +329,7 @@ class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
@pytest.mark.wpa3_personal
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('open 5 GHZ Band')
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa3_personal_ssid_5g(self, get_vif_state,station_names_fiveg, get_lanforge_data, lf_test, test_cases, update_report):
|
||||
"""Client Connectivity open ssid 2.4G
|
||||
pytest -m "client_connectivity and bridge and general and wpa3_personal and fiveg"
|
||||
@@ -329,7 +338,7 @@ class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa3"
|
||||
mode = "BRIDGE"
|
||||
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
if ssid_name not in get_vif_state:
|
||||
@@ -354,6 +363,7 @@ class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
@pytest.mark.wpa3_personal_mixed
|
||||
@pytest.mark.twog
|
||||
@allure.story('open 2.4 GHZ Band')
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa3_personal_mixed_ssid_2g(self, get_vif_state,station_names_twog, setup_profiles, get_lanforge_data, lf_test,
|
||||
update_report,
|
||||
test_cases):
|
||||
@@ -364,7 +374,7 @@ class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa3"
|
||||
mode = "BRIDGE"
|
||||
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
if ssid_name not in get_vif_state:
|
||||
@@ -389,6 +399,7 @@ class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
@pytest.mark.wpa3_personal_mixed
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('open 5 GHZ Band')
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa3_personal_mixed_ssid_5g(self, get_vif_state,station_names_fiveg, get_lanforge_data, lf_test, test_cases,
|
||||
update_report):
|
||||
"""Client Connectivity open ssid 2.4G
|
||||
@@ -398,7 +409,7 @@ class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa3"
|
||||
mode = "BRIDGE"
|
||||
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
if ssid_name not in get_vif_state:
|
||||
@@ -423,6 +434,7 @@ class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
@pytest.mark.wpa_wpa2_personal_mixed
|
||||
@pytest.mark.twog
|
||||
@allure.story('wpa wpa2 personal mixed 2.4 GHZ Band')
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa_wpa2_personal_ssid_2g(self, get_vif_state,station_names_twog, setup_profiles, get_lanforge_data, lf_test,
|
||||
update_report,
|
||||
test_cases):
|
||||
@@ -434,7 +446,7 @@ class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa"
|
||||
extra_secu = ["wpa2"]
|
||||
mode = "BRIDGE"
|
||||
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
if ssid_name not in get_vif_state:
|
||||
@@ -459,6 +471,7 @@ class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
@pytest.mark.wpa_wpa2_personal_mixed
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('wpa wpa2 personal mixed 5 GHZ Band')
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa_wpa2_personal_ssid_5g(self, get_vif_state,station_names_fiveg, get_lanforge_data, lf_test, test_cases,
|
||||
update_report):
|
||||
"""Client Connectivity open ssid 2.4G
|
||||
@@ -469,7 +482,7 @@ class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa"
|
||||
extra_secu = ["wpa2"]
|
||||
mode = "BRIDGE"
|
||||
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
if ssid_name not in get_vif_state:
|
||||
@@ -491,6 +504,7 @@ class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
passes))
|
||||
assert result
|
||||
|
||||
|
||||
# WEP Security Feature not available
|
||||
# setup_params_wep = {
|
||||
# "mode": "BRIDGE",
|
||||
@@ -524,7 +538,7 @@ class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
# wep_key = "[BLANK]"
|
||||
# security = "open"
|
||||
# extra_secu = []
|
||||
# mode = "BRIDGE"
|
||||
#
|
||||
# band = "twog"
|
||||
# vlan = 1
|
||||
# passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
@@ -552,7 +566,7 @@ class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
# wep_key = "[BLANK]"
|
||||
# security = "open"
|
||||
# extra_secu = []
|
||||
# mode = "BRIDGE"
|
||||
#
|
||||
# band = "twog"
|
||||
# vlan = 1
|
||||
# passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
import allure
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.client_connectivity, pytest.mark.usefixtures("setup_test_run"), pytest.mark.nat, pytest.mark.enterprise, pytest.mark.ttls,
|
||||
mode = "NAT"
|
||||
|
||||
pytestmark = [pytest.mark.client_connectivity, pytest.mark.usefixtures("setup_test_run"), pytest.mark.nat,
|
||||
pytest.mark.enterprise, pytest.mark.ttls,
|
||||
pytest.mark.sanity]
|
||||
|
||||
setup_params_enterprise = {
|
||||
"mode": "NAT",
|
||||
"mode": mode,
|
||||
"ssid_modes": {
|
||||
"wpa_enterprise": [
|
||||
{"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
@@ -33,23 +36,25 @@ class TestNATModeEnterpriseTTLSSuiteOne(object):
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.twog
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa_enterprise_2g(self, get_vif_state,station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa"
|
||||
extra_secu = ["wpa2"]
|
||||
mode = "NAT"
|
||||
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
ieee80211w = 1
|
||||
if ssid_name not in get_vif_state:
|
||||
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
|
||||
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, extra_securities=extra_secu,
|
||||
mode=mode, band=band,
|
||||
mode=mode, band=band, ieee80211w=ieee80211w,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
@@ -69,23 +74,27 @@ class TestNATModeEnterpriseTTLSSuiteOne(object):
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.fiveg
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa_enterprise_5g(self, get_vif_state,station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa"
|
||||
extra_secu = ["wpa2"]
|
||||
mode = "NAT"
|
||||
band = "twog"
|
||||
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
pairwise = "CCMP"
|
||||
group = "CCMP"
|
||||
ieee80211w =1
|
||||
identity = radius_info['user']
|
||||
if ssid_name not in get_vif_state:
|
||||
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
|
||||
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, extra_securities=extra_secu,
|
||||
mode=mode, band=band,
|
||||
mode=mode, band=band, group=group, pairwise=pairwise, ieee80211w=ieee80211w,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
@@ -103,15 +112,16 @@ class TestNATModeEnterpriseTTLSSuiteOne(object):
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa2_enterprise_2g(self, get_vif_state,station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa2"
|
||||
mode = "NAT"
|
||||
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
@@ -139,15 +149,16 @@ class TestNATModeEnterpriseTTLSSuiteOne(object):
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa2_enterprise_5g(self, get_vif_state, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa2"
|
||||
mode = "NAT"
|
||||
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
@@ -177,22 +188,24 @@ class TestNATModeEnterpriseTTLSSuiteOne(object):
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa3_enterprise_2g(self, get_vif_state,station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa3"
|
||||
mode = "NAT"
|
||||
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
key_mgmt = "WPA-EAP-SHA256"
|
||||
identity = radius_info['user']
|
||||
if ssid_name not in get_vif_state:
|
||||
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
|
||||
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
mode=mode, band=band,
|
||||
mode=mode, band=band, key_mgmt=key_mgmt,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
@@ -212,22 +225,24 @@ class TestNATModeEnterpriseTTLSSuiteOne(object):
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa3_enterprise_5g(self, get_vif_state,station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa3"
|
||||
mode = "NAT"
|
||||
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
key_mgmt = "WPA-EAP-SHA256"
|
||||
identity = radius_info['user']
|
||||
if ssid_name not in get_vif_state:
|
||||
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
|
||||
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
mode=mode, band=band,
|
||||
mode=mode, band=band, key_mgmt = "WPA-EAP-SHA256",
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
@@ -247,7 +262,7 @@ class TestNATModeEnterpriseTTLSSuiteOne(object):
|
||||
|
||||
|
||||
setup_params_enterprise_two = {
|
||||
"mode": "NAT",
|
||||
"mode": mode,
|
||||
"ssid_modes": {
|
||||
"wpa_wpa2_enterprise_mixed": [
|
||||
{"ssid_name": "ssid_wpa_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
@@ -273,13 +288,14 @@ class TestNATModeEnterpriseTTLSSuiteTwo(object):
|
||||
|
||||
@pytest.mark.wpa_wpa2_enterprise_mixed
|
||||
@pytest.mark.twog
|
||||
def test_wpa_wpa2_enterprise_2g(self, get_vif_state,station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa_wpa2_enterprise_mixed_2g(self, get_vif_state,station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise_two["ssid_modes"]["wpa_wpa2_enterprise_mixed"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa"
|
||||
extra_secu = ["wpa2"]
|
||||
mode = "NAT"
|
||||
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
@@ -309,14 +325,15 @@ class TestNATModeEnterpriseTTLSSuiteTwo(object):
|
||||
|
||||
@pytest.mark.wpa_wpa2_enterprise_mixed
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa_wpa2_enterprise_5g(self, get_vif_state,station_names_fiveg, setup_profiles, get_lanforge_data, lf_test,
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa_wpa2_enterprise_mixed_5g(self, get_vif_state,station_names_fiveg, setup_profiles, get_lanforge_data, lf_test,
|
||||
update_report, test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise_two["ssid_modes"]["wpa_wpa2_enterprise_mixed"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa"
|
||||
extra_secu = ["wpa2"]
|
||||
mode = "NAT"
|
||||
band = "twog"
|
||||
|
||||
band = "fievg"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
@@ -345,12 +362,13 @@ class TestNATModeEnterpriseTTLSSuiteTwo(object):
|
||||
|
||||
@pytest.mark.wpa3_enterprise_mixed
|
||||
@pytest.mark.twog
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa3_enterprise_mixed_2g(self, get_vif_state,station_names_twog, setup_profiles, get_lanforge_data, lf_test,
|
||||
update_report, test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise_two["ssid_modes"]["wpa3_enterprise_mixed"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa3"
|
||||
mode = "NAT"
|
||||
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
@@ -380,13 +398,12 @@ class TestNATModeEnterpriseTTLSSuiteTwo(object):
|
||||
|
||||
@pytest.mark.wpa3_enterprise_mixed
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa3_enterprise_mixed_5g(self, get_vif_state,station_names_fiveg, setup_profiles, get_lanforge_data, lf_test,
|
||||
update_report, exit_on_fail,
|
||||
test_cases, radius_info):
|
||||
def test_wpa3_enterprise_mixed_5g(self, get_vif_state, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test,
|
||||
update_report, exit_on_fail, test_cases, radius_info):
|
||||
profile_data = setup_params_enterprise_two["ssid_modes"]["wpa3_enterprise_mixed"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa3"
|
||||
mode = "NAT"
|
||||
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
|
||||
@@ -8,11 +8,13 @@
|
||||
import allure
|
||||
import pytest
|
||||
|
||||
mode = "NAT"
|
||||
|
||||
pytestmark = [pytest.mark.client_connectivity, pytest.mark.nat, pytest.mark.general, pytest.mark.sanity,
|
||||
pytest.mark.usefixtures("setup_test_run")]
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "NAT",
|
||||
"mode": mode,
|
||||
"ssid_modes": {
|
||||
"open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
@@ -45,7 +47,8 @@ class TestNATModeConnectivitySuiteA(object):
|
||||
@pytest.mark.open
|
||||
@pytest.mark.twog
|
||||
@allure.story('open 2.4 GHZ Band')
|
||||
def test_open_ssid_2g(self, get_vif_state,setup_profiles, get_lanforge_data, lf_test, update_report, station_names_twog,
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_open_ssid_2g(self, get_vif_state, setup_profiles, get_lanforge_data, lf_test, update_report, station_names_twog,
|
||||
test_cases):
|
||||
"""Client Connectivity open ssid 2.4G
|
||||
pytest -m "client_connectivity and nat and general and open and twog"
|
||||
@@ -54,7 +57,6 @@ class TestNATModeConnectivitySuiteA(object):
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = "[BLANK]"
|
||||
security = "open"
|
||||
mode = "NAT"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
if ssid_name not in get_vif_state:
|
||||
@@ -79,6 +81,7 @@ class TestNATModeConnectivitySuiteA(object):
|
||||
@pytest.mark.open
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('open 5 GHZ Band')
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_open_ssid_5g(self, get_vif_state,get_lanforge_data, lf_test, test_cases, station_names_fiveg, update_report):
|
||||
"""Client Connectivity open ssid 5G
|
||||
pytest -m "client_connectivity and bridge and general and open and fiveg"
|
||||
@@ -87,7 +90,7 @@ class TestNATModeConnectivitySuiteA(object):
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = "[BLANK]"
|
||||
security = "open"
|
||||
mode = "NAT"
|
||||
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
if ssid_name not in get_vif_state:
|
||||
@@ -109,10 +112,11 @@ class TestNATModeConnectivitySuiteA(object):
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.twog
|
||||
@allure.story('wpa 2.4 GHZ Band')
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa_ssid_2g(self, get_vif_state,get_lanforge_data, update_report,
|
||||
lf_test, test_cases, station_names_twog):
|
||||
"""Client Connectivity wpa ssid 2.4G
|
||||
@@ -122,7 +126,7 @@ class TestNATModeConnectivitySuiteA(object):
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa"
|
||||
mode = "NAT"
|
||||
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
if ssid_name not in get_vif_state:
|
||||
@@ -144,10 +148,11 @@ class TestNATModeConnectivitySuiteA(object):
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('wpa 5 GHZ Band')
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa_ssid_5g(self, get_vif_state,lf_test, update_report, test_cases, station_names_fiveg, get_lanforge_data):
|
||||
"""Client Connectivity wpa ssid 5G
|
||||
pytest -m "client_connectivity and bridge and general and wpa and fiveg"
|
||||
@@ -156,7 +161,7 @@ class TestNATModeConnectivitySuiteA(object):
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa"
|
||||
mode = "NAT"
|
||||
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
if ssid_name not in get_vif_state:
|
||||
@@ -178,10 +183,11 @@ class TestNATModeConnectivitySuiteA(object):
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
@allure.story('wpa2_personal 2.4 GHZ Band')
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa2_personal_ssid_2g(self, get_vif_state,get_lanforge_data, lf_test, update_report, test_cases,
|
||||
station_names_twog):
|
||||
"""Client Connectivity wpa2_personal ssid 2.4G
|
||||
@@ -191,7 +197,7 @@ class TestNATModeConnectivitySuiteA(object):
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
mode = "NAT"
|
||||
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
if ssid_name not in get_vif_state:
|
||||
@@ -213,10 +219,11 @@ class TestNATModeConnectivitySuiteA(object):
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('wpa2_personal 5 GHZ Band')
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa2_personal_ssid_5g(self, get_vif_state,get_lanforge_data, update_report, test_cases, station_names_fiveg,
|
||||
lf_test):
|
||||
"""Client Connectivity wpa2_personal ssid 5G
|
||||
@@ -226,7 +233,7 @@ class TestNATModeConnectivitySuiteA(object):
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
mode = "NAT"
|
||||
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
if ssid_name not in get_vif_state:
|
||||
@@ -250,7 +257,7 @@ class TestNATModeConnectivitySuiteA(object):
|
||||
|
||||
|
||||
setup_params_general_two = {
|
||||
"mode": "BRIDGE",
|
||||
"mode": mode,
|
||||
"ssid_modes": {
|
||||
"wpa3_personal": [
|
||||
{"ssid_name": "ssid_wpa3_p_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
@@ -279,7 +286,7 @@ setup_params_general_two = {
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestBridgeModeConnectivitySuiteB(object):
|
||||
class TestNATModeConnectivitySuiteB(object):
|
||||
""" Client Connectivity SuiteA
|
||||
pytest -m "client_connectivity and bridge and suiteB"
|
||||
"""
|
||||
@@ -287,6 +294,7 @@ class TestBridgeModeConnectivitySuiteB(object):
|
||||
@pytest.mark.wpa3_personal
|
||||
@pytest.mark.twog
|
||||
@allure.story('open 2.4 GHZ Band')
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa3_personal_ssid_2g(self, get_vif_state,station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases):
|
||||
"""Client Connectivity open ssid 2.4G
|
||||
@@ -296,7 +304,7 @@ class TestBridgeModeConnectivitySuiteB(object):
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa3"
|
||||
mode = "NAT"
|
||||
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
if ssid_name not in get_vif_state:
|
||||
@@ -321,6 +329,7 @@ class TestBridgeModeConnectivitySuiteB(object):
|
||||
@pytest.mark.wpa3_personal
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('open 5 GHZ Band')
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa3_personal_ssid_5g(self, get_vif_state,station_names_fiveg, get_lanforge_data, lf_test, test_cases, update_report):
|
||||
"""Client Connectivity open ssid 2.4G
|
||||
pytest -m "client_connectivity and bridge and general and wpa3_personal and fiveg"
|
||||
@@ -329,7 +338,7 @@ class TestBridgeModeConnectivitySuiteB(object):
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa3"
|
||||
mode = "NAT"
|
||||
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
if ssid_name not in get_vif_state:
|
||||
@@ -354,6 +363,7 @@ class TestBridgeModeConnectivitySuiteB(object):
|
||||
@pytest.mark.wpa3_personal_mixed
|
||||
@pytest.mark.twog
|
||||
@allure.story('open 2.4 GHZ Band')
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa3_personal_mixed_ssid_2g(self, get_vif_state,station_names_twog, setup_profiles, get_lanforge_data, lf_test,
|
||||
update_report,
|
||||
test_cases):
|
||||
@@ -364,7 +374,7 @@ class TestBridgeModeConnectivitySuiteB(object):
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa3"
|
||||
mode = "NAT"
|
||||
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
if ssid_name not in get_vif_state:
|
||||
@@ -389,6 +399,7 @@ class TestBridgeModeConnectivitySuiteB(object):
|
||||
@pytest.mark.wpa3_personal_mixed
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('open 5 GHZ Band')
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa3_personal_mixed_ssid_5g(self, get_vif_state,station_names_fiveg, get_lanforge_data, lf_test, test_cases,
|
||||
update_report):
|
||||
"""Client Connectivity open ssid 2.4G
|
||||
@@ -398,7 +409,7 @@ class TestBridgeModeConnectivitySuiteB(object):
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa3"
|
||||
mode = "NAT"
|
||||
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
if ssid_name not in get_vif_state:
|
||||
@@ -423,6 +434,7 @@ class TestBridgeModeConnectivitySuiteB(object):
|
||||
@pytest.mark.wpa_wpa2_personal_mixed
|
||||
@pytest.mark.twog
|
||||
@allure.story('wpa wpa2 personal mixed 2.4 GHZ Band')
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa_wpa2_personal_ssid_2g(self, get_vif_state,station_names_twog, setup_profiles, get_lanforge_data, lf_test,
|
||||
update_report,
|
||||
test_cases):
|
||||
@@ -434,7 +446,7 @@ class TestBridgeModeConnectivitySuiteB(object):
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa"
|
||||
extra_secu = ["wpa2"]
|
||||
mode = "NAT"
|
||||
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
if ssid_name not in get_vif_state:
|
||||
@@ -459,6 +471,7 @@ class TestBridgeModeConnectivitySuiteB(object):
|
||||
@pytest.mark.wpa_wpa2_personal_mixed
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('wpa wpa2 personal mixed 5 GHZ Band')
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa_wpa2_personal_ssid_5g(self, get_vif_state,station_names_fiveg, get_lanforge_data, lf_test, test_cases,
|
||||
update_report):
|
||||
"""Client Connectivity open ssid 2.4G
|
||||
@@ -469,7 +482,7 @@ class TestBridgeModeConnectivitySuiteB(object):
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa"
|
||||
extra_secu = ["wpa2"]
|
||||
mode = "NAT"
|
||||
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
if ssid_name not in get_vif_state:
|
||||
@@ -525,7 +538,7 @@ class TestBridgeModeConnectivitySuiteB(object):
|
||||
# wep_key = "[BLANK]"
|
||||
# security = "open"
|
||||
# extra_secu = []
|
||||
# mode = "NAT"
|
||||
#
|
||||
# band = "twog"
|
||||
# vlan = 1
|
||||
# passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
@@ -553,7 +566,7 @@ class TestBridgeModeConnectivitySuiteB(object):
|
||||
# wep_key = "[BLANK]"
|
||||
# security = "open"
|
||||
# extra_secu = []
|
||||
# mode = "NAT"
|
||||
#
|
||||
# band = "twog"
|
||||
# vlan = 1
|
||||
# passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
import allure
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.client_connectivity, pytest.mark.usefixtures("setup_test_run"), pytest.mark.vlan, pytest.mark.enterprise, pytest.mark.ttls,
|
||||
mode = "VLAN"
|
||||
|
||||
pytestmark = [pytest.mark.client_connectivity, pytest.mark.usefixtures("setup_test_run"), pytest.mark.vlan,
|
||||
pytest.mark.enterprise, pytest.mark.ttls,
|
||||
pytest.mark.sanity]
|
||||
|
||||
setup_params_enterprise = {
|
||||
"mode": "VLAN",
|
||||
"mode": mode,
|
||||
"ssid_modes": {
|
||||
"wpa_enterprise": [
|
||||
{"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
@@ -28,42 +31,42 @@ setup_params_enterprise = {
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestVLANModeEnterpriseTTLSSuiteOne(object):
|
||||
class TestvlanModeEnterpriseTTLSSuiteOne(object):
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.twog
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa_enterprise_2g(self, get_vif_state,station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa"
|
||||
extra_secu = ["wpa2"]
|
||||
mode = "VLAN"
|
||||
|
||||
band = "twog"
|
||||
vlan = 100
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
ieee80211w = 1
|
||||
if ssid_name not in get_vif_state:
|
||||
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
|
||||
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, extra_securities=extra_secu,
|
||||
mode=mode, band=band,
|
||||
mode=mode, band=band, ieee80211w=ieee80211w,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_eap_ttls_vlan"],
|
||||
status_id=1,
|
||||
msg='2G WPA Enterprise Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
msg='2G WPA Enterprise Client Connectivity Passed successfully - vlan mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_eap_ttls_vlan"],
|
||||
status_id=5,
|
||||
msg='2G WPA Enterprise Client Connectivity Failed - VLAN mode' + str(
|
||||
msg='2G WPA Enterprise Client Connectivity Failed - vlan mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
@@ -71,49 +74,54 @@ class TestVLANModeEnterpriseTTLSSuiteOne(object):
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.fiveg
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa_enterprise_5g(self, get_vif_state,station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa"
|
||||
extra_secu = ["wpa2"]
|
||||
mode = "VLAN"
|
||||
band = "twog"
|
||||
|
||||
band = "fiveg"
|
||||
vlan = 100
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
pairwise = "CCMP"
|
||||
group = "CCMP"
|
||||
ieee80211w =1
|
||||
identity = radius_info['user']
|
||||
if ssid_name not in get_vif_state:
|
||||
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
|
||||
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, extra_securities=extra_secu,
|
||||
mode=mode, band=band,
|
||||
mode=mode, band=band, group=group, pairwise=pairwise, ieee80211w=ieee80211w,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa_eap_ttls_vlan"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
msg='5G WPA Enterprise Client Connectivity Passed successfully - vlan mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa_eap_ttls_vlan"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
msg='5G WPA Enterprise Client Connectivity Failed - vlan mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa2_enterprise_2g(self, get_vif_state,station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa2"
|
||||
mode = "VLAN"
|
||||
|
||||
band = "twog"
|
||||
vlan = 100
|
||||
ttls_passwd = radius_info["password"]
|
||||
@@ -130,26 +138,27 @@ class TestVLANModeEnterpriseTTLSSuiteOne(object):
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa2_eap_ttls_vlan"],
|
||||
status_id=1,
|
||||
msg='2G WPA2 Enterprise Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
msg='2G WPA2 Enterprise Client Connectivity Passed successfully - vlan mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa2_eap_ttls_vlan"],
|
||||
status_id=5,
|
||||
msg='2G WPA2 Enterprise Client Connectivity Failed - VLAN mode' + str(
|
||||
msg='2G WPA2 Enterprise Client Connectivity Failed - vlan mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa2_enterprise_5g(self, get_vif_state,station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa2_enterprise_5g(self, get_vif_state, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa2"
|
||||
mode = "VLAN"
|
||||
|
||||
band = "fiveg"
|
||||
vlan = 100
|
||||
ttls_passwd = radius_info["password"]
|
||||
@@ -166,12 +175,12 @@ class TestVLANModeEnterpriseTTLSSuiteOne(object):
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa2_eap_ttls_vlan"],
|
||||
status_id=1,
|
||||
msg='5G WPA2 Enterprise Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
msg='5G WPA2 Enterprise Client Connectivity Passed successfully - vlan mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa2_eap_ttls_vlan"],
|
||||
status_id=5,
|
||||
msg='5G WPA2 Enterprise Client Connectivity Failed - VLAN mode' + str(
|
||||
msg='5G WPA2 Enterprise Client Connectivity Failed - vlan mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
@@ -179,34 +188,36 @@ class TestVLANModeEnterpriseTTLSSuiteOne(object):
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa3_enterprise_2g(self, get_vif_state,station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa3"
|
||||
mode = "VLAN"
|
||||
|
||||
band = "twog"
|
||||
vlan = 100
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
key_mgmt = "WPA-EAP-SHA256"
|
||||
identity = radius_info['user']
|
||||
if ssid_name not in get_vif_state:
|
||||
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
|
||||
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
mode=mode, band=band,
|
||||
mode=mode, band=band, key_mgmt=key_mgmt,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa3_eap_ttls_vlan"],
|
||||
status_id=1,
|
||||
msg='2G WPA3 Enterprise Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
msg='2G WPA3 Enterprise Client Connectivity Passed successfully - vlan mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa3_eap_ttls_vlan"],
|
||||
status_id=5,
|
||||
msg='2G WPA3 Enterprise Client Connectivity Failed - VLAN mode' + str(
|
||||
msg='2G WPA3 Enterprise Client Connectivity Failed - vlan mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
@@ -214,34 +225,36 @@ class TestVLANModeEnterpriseTTLSSuiteOne(object):
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa3_enterprise_5g(self, get_vif_state,station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa3"
|
||||
mode = "VLAN"
|
||||
|
||||
band = "fiveg"
|
||||
vlan = 100
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
key_mgmt = "WPA-EAP-SHA256"
|
||||
identity = radius_info['user']
|
||||
if ssid_name not in get_vif_state:
|
||||
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
|
||||
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
mode=mode, band=band,
|
||||
mode=mode, band=band, key_mgmt = "WPA-EAP-SHA256",
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa3_eap_ttls_vlan"],
|
||||
status_id=1,
|
||||
msg='5G WPA Enterprise Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
msg='5G WPA3 Enterprise Client Connectivity Passed successfully - vlan mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa3_eap_ttls_vlan"],
|
||||
status_id=5,
|
||||
msg='5G WPA3 Enterprise Client Connectivity Failed - VLAN mode' + str(
|
||||
msg='5G WPA3 Enterprise Client Connectivity Failed - vlan mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
@@ -249,7 +262,7 @@ class TestVLANModeEnterpriseTTLSSuiteOne(object):
|
||||
|
||||
|
||||
setup_params_enterprise_two = {
|
||||
"mode": "VLAN",
|
||||
"mode": mode,
|
||||
"ssid_modes": {
|
||||
"wpa_wpa2_enterprise_mixed": [
|
||||
{"ssid_name": "ssid_wpa_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
@@ -271,17 +284,18 @@ setup_params_enterprise_two = {
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestVLANModeEnterpriseTTLSSuiteTwo(object):
|
||||
class TestvlanModeEnterpriseTTLSSuiteTwo(object):
|
||||
|
||||
@pytest.mark.wpa_wpa2_enterprise_mixed
|
||||
@pytest.mark.twog
|
||||
def test_wpa_wpa2_enterprise_2g(self, get_vif_state,station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa_wpa2_enterprise_mixed_2g(self, get_vif_state,station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise_two["ssid_modes"]["wpa_wpa2_enterprise_mixed"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa"
|
||||
extra_secu = ["wpa2"]
|
||||
mode = "VLAN"
|
||||
|
||||
band = "twog"
|
||||
vlan = 100
|
||||
ttls_passwd = radius_info["password"]
|
||||
@@ -298,12 +312,12 @@ class TestVLANModeEnterpriseTTLSSuiteTwo(object):
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa2_mixed_eap_ttls_wpa2_vlan"],
|
||||
status_id=1,
|
||||
msg='2G WPA2 Mixed Enterprise Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
msg='2G WPA2 Mixed Enterprise Client Connectivity Passed successfully - vlan mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa2_mixed_eap_ttls_wpa2_vlan"],
|
||||
status_id=5,
|
||||
msg='2G WPA2 Mixed Enterprise Client Connectivity Failed - VLAN mode' + str(
|
||||
msg='2G WPA2 Mixed Enterprise Client Connectivity Failed - vlan mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
@@ -311,14 +325,15 @@ class TestVLANModeEnterpriseTTLSSuiteTwo(object):
|
||||
|
||||
@pytest.mark.wpa_wpa2_enterprise_mixed
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa_wpa2_enterprise_5g(self, get_vif_state,station_names_fiveg, setup_profiles, get_lanforge_data, lf_test,
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa_wpa2_enterprise_mixed_5g(self, get_vif_state,station_names_fiveg, setup_profiles, get_lanforge_data, lf_test,
|
||||
update_report, test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise_two["ssid_modes"]["wpa_wpa2_enterprise_mixed"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa"
|
||||
extra_secu = ["wpa2"]
|
||||
mode = "VLAN"
|
||||
band = "twog"
|
||||
|
||||
band = "fievg"
|
||||
vlan = 100
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
@@ -334,12 +349,12 @@ class TestVLANModeEnterpriseTTLSSuiteTwo(object):
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa2_mixed_eap_ttls_wpa2_vlan"],
|
||||
status_id=1,
|
||||
msg='5G WPA2 Mixed Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
msg='5G WPA2 Mixed Enterprise Client Connectivity Passed successfully - vlan mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa2_mixed_eap_ttls_wpa2_vlan"],
|
||||
status_id=5,
|
||||
msg='5G WPA2 Mixed Client Connectivity Failed - VLAN mode' + str(
|
||||
msg='5G WPA2 Mixed Client Connectivity Failed - vlan mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
@@ -347,12 +362,13 @@ class TestVLANModeEnterpriseTTLSSuiteTwo(object):
|
||||
|
||||
@pytest.mark.wpa3_enterprise_mixed
|
||||
@pytest.mark.twog
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa3_enterprise_mixed_2g(self, get_vif_state,station_names_twog, setup_profiles, get_lanforge_data, lf_test,
|
||||
update_report, test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise_two["ssid_modes"]["wpa3_enterprise_mixed"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa3"
|
||||
mode = "VLAN"
|
||||
|
||||
band = "twog"
|
||||
vlan = 100
|
||||
ttls_passwd = radius_info["password"]
|
||||
@@ -369,12 +385,12 @@ class TestVLANModeEnterpriseTTLSSuiteTwo(object):
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa3_mixed_eap_ttls_wpa3_vlan"],
|
||||
status_id=1,
|
||||
msg='2G WPA3 Mixed Enterprise Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
msg='2G WPA3 Mixed Enterprise Client Connectivity Passed successfully - vlan mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa3_mixed_eap_ttls_wpa3_vlan"],
|
||||
status_id=5,
|
||||
msg='2G WPA3 Mixed Enterprise Client Connectivity Failed - VLAN mode' + str(
|
||||
msg='2G WPA3 Mixed Enterprise Client Connectivity Failed - vlan mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
@@ -388,7 +404,7 @@ class TestVLANModeEnterpriseTTLSSuiteTwo(object):
|
||||
profile_data = setup_params_enterprise_two["ssid_modes"]["wpa3_enterprise_mixed"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa3"
|
||||
mode = "VLAN"
|
||||
|
||||
band = "fiveg"
|
||||
vlan = 100
|
||||
ttls_passwd = radius_info["password"]
|
||||
@@ -405,12 +421,12 @@ class TestVLANModeEnterpriseTTLSSuiteTwo(object):
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa3_mixed_eap_ttls_wpa3_vlan"],
|
||||
status_id=1,
|
||||
msg='5G WPA3 Mixed Enterprise Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
msg='5G WPA3 Mixed Enterprise Client Connectivity Passed successfully - vlan mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa3_mixed_eap_ttls_wpa3_vlan"],
|
||||
status_id=5,
|
||||
msg='5G WPA3 Mixed Enterprise Client Connectivity Failed - VLAN mode' + str(
|
||||
msg='5G WPA3 Mixed Enterprise Client Connectivity Failed - vlan mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
"""
|
||||
|
||||
Client Connectivity and tcp-udp Traffic Test: vlan Mode
|
||||
pytest -m "client_connectivity and vlan and general"
|
||||
Client Connectivity and tcp-udp Traffic Test: bridge Mode
|
||||
pytest -m "client_connectivity and bridge and general"
|
||||
|
||||
"""
|
||||
|
||||
import allure
|
||||
import pytest
|
||||
|
||||
mode = "VLAN"
|
||||
|
||||
pytestmark = [pytest.mark.client_connectivity, pytest.mark.vlan, pytest.mark.general, pytest.mark.sanity,
|
||||
pytest.mark.usefixtures("setup_test_run")]
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "VLAN",
|
||||
"mode": mode,
|
||||
"ssid_modes": {
|
||||
"open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
@@ -45,7 +47,8 @@ class TestvlanModeConnectivitySuiteA(object):
|
||||
@pytest.mark.open
|
||||
@pytest.mark.twog
|
||||
@allure.story('open 2.4 GHZ Band')
|
||||
def test_open_ssid_2g(self, get_vif_state,setup_profiles, get_lanforge_data, lf_test, update_report, station_names_twog,
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_open_ssid_2g(self, get_vif_state, setup_profiles, get_lanforge_data, lf_test, update_report, station_names_twog,
|
||||
test_cases):
|
||||
"""Client Connectivity open ssid 2.4G
|
||||
pytest -m "client_connectivity and vlan and general and open and twog"
|
||||
@@ -54,7 +57,6 @@ class TestvlanModeConnectivitySuiteA(object):
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = "[BLANK]"
|
||||
security = "open"
|
||||
mode = "VLAN"
|
||||
band = "twog"
|
||||
vlan = 100
|
||||
if ssid_name not in get_vif_state:
|
||||
@@ -79,6 +81,7 @@ class TestvlanModeConnectivitySuiteA(object):
|
||||
@pytest.mark.open
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('open 5 GHZ Band')
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_open_ssid_5g(self, get_vif_state,get_lanforge_data, lf_test, test_cases, station_names_fiveg, update_report):
|
||||
"""Client Connectivity open ssid 5G
|
||||
pytest -m "client_connectivity and vlan and general and open and fiveg"
|
||||
@@ -87,7 +90,7 @@ class TestvlanModeConnectivitySuiteA(object):
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = "[BLANK]"
|
||||
security = "open"
|
||||
mode = "VLAN"
|
||||
|
||||
band = "fiveg"
|
||||
vlan = 100
|
||||
if ssid_name not in get_vif_state:
|
||||
@@ -109,10 +112,11 @@ class TestvlanModeConnectivitySuiteA(object):
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.twog
|
||||
@allure.story('wpa 2.4 GHZ Band')
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa_ssid_2g(self, get_vif_state,get_lanforge_data, update_report,
|
||||
lf_test, test_cases, station_names_twog):
|
||||
"""Client Connectivity wpa ssid 2.4G
|
||||
@@ -122,7 +126,7 @@ class TestvlanModeConnectivitySuiteA(object):
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa"
|
||||
mode = "VLAN"
|
||||
|
||||
band = "twog"
|
||||
vlan = 100
|
||||
if ssid_name not in get_vif_state:
|
||||
@@ -144,10 +148,11 @@ class TestvlanModeConnectivitySuiteA(object):
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('wpa 5 GHZ Band')
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa_ssid_5g(self, get_vif_state,lf_test, update_report, test_cases, station_names_fiveg, get_lanforge_data):
|
||||
"""Client Connectivity wpa ssid 5G
|
||||
pytest -m "client_connectivity and vlan and general and wpa and fiveg"
|
||||
@@ -156,7 +161,7 @@ class TestvlanModeConnectivitySuiteA(object):
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa"
|
||||
mode = "VLAN"
|
||||
|
||||
band = "fiveg"
|
||||
vlan = 100
|
||||
if ssid_name not in get_vif_state:
|
||||
@@ -178,10 +183,11 @@ class TestvlanModeConnectivitySuiteA(object):
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
@allure.story('wpa2_personal 2.4 GHZ Band')
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa2_personal_ssid_2g(self, get_vif_state,get_lanforge_data, lf_test, update_report, test_cases,
|
||||
station_names_twog):
|
||||
"""Client Connectivity wpa2_personal ssid 2.4G
|
||||
@@ -191,7 +197,7 @@ class TestvlanModeConnectivitySuiteA(object):
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
mode = "VLAN"
|
||||
|
||||
band = "twog"
|
||||
vlan = 100
|
||||
if ssid_name not in get_vif_state:
|
||||
@@ -213,10 +219,11 @@ class TestvlanModeConnectivitySuiteA(object):
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.sanity_55
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('wpa2_personal 5 GHZ Band')
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa2_personal_ssid_5g(self, get_vif_state,get_lanforge_data, update_report, test_cases, station_names_fiveg,
|
||||
lf_test):
|
||||
"""Client Connectivity wpa2_personal ssid 5G
|
||||
@@ -226,7 +233,7 @@ class TestvlanModeConnectivitySuiteA(object):
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
mode = "VLAN"
|
||||
|
||||
band = "fiveg"
|
||||
vlan = 100
|
||||
if ssid_name not in get_vif_state:
|
||||
@@ -250,7 +257,7 @@ class TestvlanModeConnectivitySuiteA(object):
|
||||
|
||||
|
||||
setup_params_general_two = {
|
||||
"mode": "VLAN",
|
||||
"mode": mode,
|
||||
"ssid_modes": {
|
||||
"wpa3_personal": [
|
||||
{"ssid_name": "ssid_wpa3_p_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
@@ -279,7 +286,7 @@ setup_params_general_two = {
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestvlanModeConnectivitySuiteTwo(object):
|
||||
class TestvlanModeConnectivitySuiteB(object):
|
||||
""" Client Connectivity SuiteA
|
||||
pytest -m "client_connectivity and vlan and suiteB"
|
||||
"""
|
||||
@@ -287,6 +294,7 @@ class TestvlanModeConnectivitySuiteTwo(object):
|
||||
@pytest.mark.wpa3_personal
|
||||
@pytest.mark.twog
|
||||
@allure.story('open 2.4 GHZ Band')
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa3_personal_ssid_2g(self, get_vif_state,station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases):
|
||||
"""Client Connectivity open ssid 2.4G
|
||||
@@ -296,7 +304,7 @@ class TestvlanModeConnectivitySuiteTwo(object):
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa3"
|
||||
mode = "VLAN"
|
||||
|
||||
band = "twog"
|
||||
vlan = 100
|
||||
if ssid_name not in get_vif_state:
|
||||
@@ -321,6 +329,7 @@ class TestvlanModeConnectivitySuiteTwo(object):
|
||||
@pytest.mark.wpa3_personal
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('open 5 GHZ Band')
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa3_personal_ssid_5g(self, get_vif_state,station_names_fiveg, get_lanforge_data, lf_test, test_cases, update_report):
|
||||
"""Client Connectivity open ssid 2.4G
|
||||
pytest -m "client_connectivity and vlan and general and wpa3_personal and fiveg"
|
||||
@@ -329,7 +338,7 @@ class TestvlanModeConnectivitySuiteTwo(object):
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa3"
|
||||
mode = "VLAN"
|
||||
|
||||
band = "fiveg"
|
||||
vlan = 100
|
||||
if ssid_name not in get_vif_state:
|
||||
@@ -354,6 +363,7 @@ class TestvlanModeConnectivitySuiteTwo(object):
|
||||
@pytest.mark.wpa3_personal_mixed
|
||||
@pytest.mark.twog
|
||||
@allure.story('open 2.4 GHZ Band')
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa3_personal_mixed_ssid_2g(self, get_vif_state,station_names_twog, setup_profiles, get_lanforge_data, lf_test,
|
||||
update_report,
|
||||
test_cases):
|
||||
@@ -364,7 +374,7 @@ class TestvlanModeConnectivitySuiteTwo(object):
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa3"
|
||||
mode = "VLAN"
|
||||
|
||||
band = "twog"
|
||||
vlan = 100
|
||||
if ssid_name not in get_vif_state:
|
||||
@@ -389,6 +399,7 @@ class TestvlanModeConnectivitySuiteTwo(object):
|
||||
@pytest.mark.wpa3_personal_mixed
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('open 5 GHZ Band')
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa3_personal_mixed_ssid_5g(self, get_vif_state,station_names_fiveg, get_lanforge_data, lf_test, test_cases,
|
||||
update_report):
|
||||
"""Client Connectivity open ssid 2.4G
|
||||
@@ -398,7 +409,7 @@ class TestvlanModeConnectivitySuiteTwo(object):
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa3"
|
||||
mode = "VLAN"
|
||||
|
||||
band = "fiveg"
|
||||
vlan = 100
|
||||
if ssid_name not in get_vif_state:
|
||||
@@ -423,6 +434,7 @@ class TestvlanModeConnectivitySuiteTwo(object):
|
||||
@pytest.mark.wpa_wpa2_personal_mixed
|
||||
@pytest.mark.twog
|
||||
@allure.story('wpa wpa2 personal mixed 2.4 GHZ Band')
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa_wpa2_personal_ssid_2g(self, get_vif_state,station_names_twog, setup_profiles, get_lanforge_data, lf_test,
|
||||
update_report,
|
||||
test_cases):
|
||||
@@ -434,7 +446,7 @@ class TestvlanModeConnectivitySuiteTwo(object):
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa"
|
||||
extra_secu = ["wpa2"]
|
||||
mode = "VLAN"
|
||||
|
||||
band = "twog"
|
||||
vlan = 100
|
||||
if ssid_name not in get_vif_state:
|
||||
@@ -459,6 +471,7 @@ class TestvlanModeConnectivitySuiteTwo(object):
|
||||
@pytest.mark.wpa_wpa2_personal_mixed
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('wpa wpa2 personal mixed 5 GHZ Band')
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_wpa_wpa2_personal_ssid_5g(self, get_vif_state,station_names_fiveg, get_lanforge_data, lf_test, test_cases,
|
||||
update_report):
|
||||
"""Client Connectivity open ssid 2.4G
|
||||
@@ -469,7 +482,7 @@ class TestvlanModeConnectivitySuiteTwo(object):
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa"
|
||||
extra_secu = ["wpa2"]
|
||||
mode = "VLAN"
|
||||
|
||||
band = "fiveg"
|
||||
vlan = 100
|
||||
if ssid_name not in get_vif_state:
|
||||
@@ -491,9 +504,10 @@ class TestvlanModeConnectivitySuiteTwo(object):
|
||||
passes))
|
||||
assert result
|
||||
|
||||
|
||||
# WEP Security Feature not available
|
||||
# setup_params_wep = {
|
||||
# "mode": "VLAN",
|
||||
# "mode": "vlan",
|
||||
# "ssid_modes": {
|
||||
# "wep": [ {"ssid_name": "ssid_wep_2g", "appliedRadios": ["is2dot4GHz"], "default_key_id": 1,
|
||||
# "wep_key": 1234567890},
|
||||
@@ -524,7 +538,7 @@ class TestvlanModeConnectivitySuiteTwo(object):
|
||||
# wep_key = "[BLANK]"
|
||||
# security = "open"
|
||||
# extra_secu = []
|
||||
# mode = "VLAN"
|
||||
#
|
||||
# band = "twog"
|
||||
# vlan = 100
|
||||
# passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
@@ -552,7 +566,7 @@ class TestvlanModeConnectivitySuiteTwo(object):
|
||||
# wep_key = "[BLANK]"
|
||||
# security = "open"
|
||||
# extra_secu = []
|
||||
# mode = "VLAN"
|
||||
#
|
||||
# band = "twog"
|
||||
# vlan = 100
|
||||
# passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
|
||||
@@ -13,6 +13,8 @@ from selenium.common.exceptions import NoSuchElementException
|
||||
import sys
|
||||
import allure
|
||||
|
||||
pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.interop_and, pytest.mark.android, pytest.mark.AccessPointConnection]
|
||||
|
||||
if 'perfecto_libs' not in sys.path:
|
||||
sys.path.append(f'../libs/perfecto_libs')
|
||||
|
||||
@@ -30,8 +32,6 @@ setup_params_general = {
|
||||
"radius": False
|
||||
}
|
||||
|
||||
@pytest.mark.AccessPointConnectionAndroid
|
||||
@pytest.mark.interop_and
|
||||
@allure.feature("NAT MODE CLIENT CONNECTIVITY")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
|
||||
@@ -16,6 +16,8 @@ import allure
|
||||
if 'perfecto_libs' not in sys.path:
|
||||
sys.path.append(f'../libs/perfecto_libs')
|
||||
|
||||
pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.android, pytest.mark.interop_and, pytest.mark.ToggleAirplaneMode]
|
||||
|
||||
from android_lib import closeApp, set_APconnMobileDevice_android, Toggle_AirplaneMode_android, ForgetWifiConnection, openApp, setup_perfectoMobile_android
|
||||
|
||||
setup_params_general = {
|
||||
@@ -30,8 +32,6 @@ setup_params_general = {
|
||||
"radius": False
|
||||
}
|
||||
|
||||
@pytest.mark.ToggleAirplaneModeAndroid
|
||||
@pytest.mark.interop_and
|
||||
@allure.feature("NAT MODE CLIENT CONNECTIVITY")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
|
||||
391
tests/e2e/interOp/android/OpenRoamingPassPoint/conftest.py
Normal file
391
tests/e2e/interOp/android/OpenRoamingPassPoint/conftest.py
Normal file
@@ -0,0 +1,391 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
sys.path.append(
|
||||
os.path.dirname(
|
||||
os.path.realpath(__file__)
|
||||
)
|
||||
)
|
||||
if "libs" not in sys.path:
|
||||
sys.path.append(f"../libs")
|
||||
|
||||
import time
|
||||
import pytest
|
||||
import allure
|
||||
from collections import defaultdict
|
||||
from lanforge.lf_tests import RunTest
|
||||
from configuration import PASSPOINT_RADIUS_SERVER_DATA
|
||||
from configuration import PASSPOINT_RADIUS_ACCOUNTING_SERVER_DATA
|
||||
from configuration import PASSPOINT_PROVIDER_INFO
|
||||
from configuration import PASSPOINT_OPERATOR_INFO
|
||||
from configuration import PASSPOINT_VENUE_INFO
|
||||
from configuration import PASSPOINT_PROFILE_INFO
|
||||
from controller.controller import ProfileUtility
|
||||
|
||||
|
||||
@allure.feature("PASSPOINT CONNECTIVITY SETUP")
|
||||
@pytest.fixture(scope="class")
|
||||
def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment_id,
|
||||
instantiate_profile, get_markers, passpoint_provider_info, passpoint_operator_info,
|
||||
passpoint_venue_info, passpoint_profile_info,
|
||||
get_configuration, passpoint_radius_server_info, passpoint_radius_accounting_server_info, get_apnos):
|
||||
instantiate_profile = instantiate_profile(sdk_client=setup_controller)
|
||||
vlan_id, mode = 0, 0
|
||||
instantiate_profile.cleanup_objects()
|
||||
parameter = dict(request.param)
|
||||
test_cases = {}
|
||||
profile_data = {}
|
||||
if parameter["mode"] not in ["BRIDGE", "NAT", "VLAN"]:
|
||||
print("Invalid Mode: ", parameter["mode"])
|
||||
allure.attach(body=parameter["mode"], name="Invalid Mode: ")
|
||||
yield test_cases
|
||||
|
||||
if parameter["mode"] == "NAT":
|
||||
mode = "NAT"
|
||||
vlan_id = 1
|
||||
if parameter["mode"] == "BRIDGE":
|
||||
mode = "BRIDGE"
|
||||
vlan_id = 1
|
||||
if parameter["mode"] == "VLAN":
|
||||
mode = "BRIDGE"
|
||||
vlan_id = setup_vlan
|
||||
|
||||
ap_profile = testbed + "-Equipment-AP-Passpoint"
|
||||
instantiate_profile.delete_profile_by_name(profile_name=ap_profile)
|
||||
profile_data["equipment_ap"] = {"profile_name": ap_profile}
|
||||
|
||||
profile_data["ssid"] = {}
|
||||
# Only passpoint SSID need to be applied with passpoint profiles leaving ssid used for
|
||||
# profile download - passpoint_profile_download
|
||||
profile_data["allowed_ssids"] = []
|
||||
for i in parameter["ssid_modes"]:
|
||||
profile_data["ssid"][i] = []
|
||||
for j in range(len(parameter["ssid_modes"][i])):
|
||||
profile_name = testbed + "-SSID-" + i + "-" + str(j) + "-" + parameter["mode"]
|
||||
data = parameter["ssid_modes"][i][j]
|
||||
data["profile_name"] = profile_name
|
||||
if "mode" not in dict(data).keys():
|
||||
data["mode"] = mode
|
||||
if "vlan" not in dict(data).keys():
|
||||
data["vlan"] = vlan_id
|
||||
instantiate_profile.delete_profile_by_name(profile_name=profile_name)
|
||||
profile_data["ssid"][i].append(data)
|
||||
|
||||
instantiate_profile.delete_profile_by_name(profile_name=testbed + "-Automation-Radius-Profile-" + mode)
|
||||
time.sleep(10)
|
||||
|
||||
# RF Profile Creation
|
||||
rf_profile_data = {
|
||||
"name": testbed + "-RF-Profile-" + parameter["mode"] + "-" + get_configuration["access_point"][0]["mode"]
|
||||
}
|
||||
try:
|
||||
instantiate_profile.delete_profile_by_name(profile_name=rf_profile_data["name"])
|
||||
rf_profile_data = instantiate_profile.set_rf_profile(profile_data=rf_profile_data,
|
||||
mode=get_configuration["access_point"][0]["mode"])
|
||||
allure.attach(body=str(rf_profile_data),
|
||||
name="RF Profile Created : " + get_configuration["access_point"][0]["mode"])
|
||||
except Exception as e:
|
||||
print(e)
|
||||
allure.attach(body=str(e), name="Exception ")
|
||||
|
||||
# Radius Profile Creation
|
||||
passpoint_radius_server_info = passpoint_radius_server_info
|
||||
passpoint_radius_server_info["name"] = testbed + "-Automation-Radius-Profile"
|
||||
instantiate_profile.delete_profile_by_name(profile_name=testbed + "-Automation-Radius-Profile")
|
||||
try:
|
||||
instantiate_profile.create_radius_profile(radius_info=passpoint_radius_server_info,
|
||||
radius_accounting_info=passpoint_radius_accounting_server_info)
|
||||
test_cases["radius_profile"] = True
|
||||
allure.attach(body=str(passpoint_radius_server_info), name="Radius Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["radius_profile"] = False
|
||||
|
||||
# SSID Profile Creation
|
||||
for mode in profile_data["ssid"]:
|
||||
if mode == "open":
|
||||
for j in profile_data["ssid"][mode]:
|
||||
try:
|
||||
if "is2dot4GHz" in list(j["appliedRadios"]):
|
||||
creates_profile = instantiate_profile.create_open_ssid_profile(profile_data=j)
|
||||
test_cases[j["ssid_name"]] = {"sdk": True}
|
||||
allure.attach(body=str(creates_profile), name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases[j["ssid_name"]] = {"sdk": False}
|
||||
allure.attach(body=str(e), name="SSID Profile Creation Failed")
|
||||
if mode == "wpa_eap":
|
||||
for j in profile_data["ssid"][mode]:
|
||||
if mode in get_markers.keys() and get_markers[mode]:
|
||||
try:
|
||||
if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
creates_profile = instantiate_profile.create_wpa_eap_passpoint_ssid_profile(profile_data=j)
|
||||
profile_data["allowed_ssids"].append(creates_profile._id)
|
||||
test_cases[j["ssid_name"]] = {"sdk": True}
|
||||
allure.attach(body=str(creates_profile), name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases[j["ssid_name"]] = {"sdk": False}
|
||||
allure.attach(body=str(e), name="SSID Profile Creation Failed")
|
||||
try:
|
||||
if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
creates_profile = instantiate_profile.create_wpa_eap_passpoint_ssid_profile(profile_data=j)
|
||||
profile_data["allowed_ssids"].append(creates_profile._id)
|
||||
test_cases[j["ssid_name"]] = {"sdk": True}
|
||||
allure.attach(body=str(creates_profile), name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases[j["wpa_eap_5g"]] = {"sdk": False}
|
||||
allure.attach(body=str(e), name="SSID Profile Creation Failed")
|
||||
if mode == "wpa2_eap":
|
||||
for j in profile_data["ssid"][mode]:
|
||||
if mode in get_markers.keys() and get_markers[mode]:
|
||||
try:
|
||||
if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
creates_profile = instantiate_profile.create_wpa2_eap_passpoint_ssid_profile(profile_data=j)
|
||||
profile_data["allowed_ssids"].append(creates_profile._id)
|
||||
test_cases[j["ssid_name"]] = {"sdk": True}
|
||||
allure.attach(body=str(creates_profile), name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases[j["ssid_name"]] = {"sdk": False}
|
||||
allure.attach(body=str(e), name="SSID Profile Creation Failed")
|
||||
try:
|
||||
if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
creates_profile = instantiate_profile.create_wpa2_eap_passpoint_ssid_profile(profile_data=j)
|
||||
profile_data["allowed_ssids"].append(creates_profile._id)
|
||||
test_cases[j["ssid_name"]] = {"sdk": True}
|
||||
allure.attach(body=str(creates_profile), name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases[j["ssid_name"]] = {"sdk": False}
|
||||
allure.attach(body=str(e), name="SSID Profile Creation Failed")
|
||||
if mode == "wpa2_only_eap":
|
||||
for j in profile_data["ssid"][mode]:
|
||||
if mode in get_markers.keys() and get_markers[mode]:
|
||||
try:
|
||||
if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
creates_profile = instantiate_profile.create_wpa2_only_eap_passpoint_ssid_profile(
|
||||
profile_data=j)
|
||||
profile_data["allowed_ssids"].append(creates_profile._id)
|
||||
test_cases[j["ssid_name"]] = {"sdk": True}
|
||||
allure.attach(body=str(creates_profile), name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases[j["ssid_name"]] = {"sdk": False}
|
||||
allure.attach(body=str(e), name="SSID Profile Creation Failed")
|
||||
try:
|
||||
if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
creates_profile = instantiate_profile.create_wpa2_only_eap_passpoint_ssid_profile(
|
||||
profile_data=j)
|
||||
profile_data["allowed_ssids"].append(creates_profile._id)
|
||||
test_cases[j["ssid_name"]] = {"sdk": True}
|
||||
allure.attach(body=str(creates_profile), name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases[j["ssid_name"]] = {"sdk": False}
|
||||
allure.attach(body=str(e), name="SSID Profile Creation Failed")
|
||||
|
||||
# Passpoint OSU ID provider profile creation
|
||||
passpoint_provider_info = passpoint_provider_info
|
||||
test_cases["passpoint_osu_id_provider"] = dict()
|
||||
profile_name = testbed + "-Automation-Passpoint-OSU-ID-Provider-Profile"
|
||||
passpoint_provider_info["profile_name"] = profile_name
|
||||
instantiate_profile.delete_profile_by_name(profile_name=profile_name)
|
||||
try:
|
||||
creates_profile = instantiate_profile.create_passpoint_osu_id_provider_profile(
|
||||
profile_data=passpoint_provider_info)
|
||||
allure.attach(body=str(creates_profile), name="Passpoint OSU ID provider Profile Created")
|
||||
test_cases["passpoint_osu_id_provider"] = {"sdk": True}
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["passpoint_osu_id_provider"] = {"sdk": False}
|
||||
allure.attach(body=str(e), name="Passpoint OSU ID provider Profile Creation Failed")
|
||||
|
||||
# Passpoint operator profile creation
|
||||
test_cases["passpoint_operator_profile"] = dict()
|
||||
passpoint_operator_info = passpoint_operator_info
|
||||
profile_name = testbed + "-Automation-Passpoint-Operator-Profile"
|
||||
passpoint_operator_info["profile_name"] = profile_name
|
||||
instantiate_profile.delete_profile_by_name(profile_name=profile_name)
|
||||
try:
|
||||
creates_profile = instantiate_profile.create_passpoint_operator_profile(profile_data=passpoint_operator_info)
|
||||
allure.attach(body=str(creates_profile), name="Passpoint Operator Profile Created")
|
||||
test_cases["passpoint_operator_profile"] = {"sdk": True}
|
||||
profile_data["passpoint_operator"] = profile_name
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["passpoint_operator_profile"] = {"sdk": False}
|
||||
allure.attach(body=str(e), name="Passpoint Operator Profile Creation Failed")
|
||||
|
||||
# Passpoint Venue profile creation
|
||||
passpoint_venue_info = passpoint_venue_info
|
||||
test_cases["passpoint_venue_profile"] = dict()
|
||||
profile_name = testbed + "-Automation-Passpoint-Venue-Profile"
|
||||
passpoint_venue_info["profile_name"] = profile_name
|
||||
instantiate_profile.delete_profile_by_name(profile_name=profile_name)
|
||||
try:
|
||||
creates_profile = instantiate_profile.create_passpoint_venue_profile(profile_data=passpoint_venue_info)
|
||||
allure.attach(body=str(creates_profile), name="Passpoint Venue Profile Created")
|
||||
test_cases["passpoint_venue_profile"] = {"sdk": True}
|
||||
profile_data["passpoint_venue"] = profile_name
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["passpoint_venue"] = {"sdk": False}
|
||||
allure.attach(body=str(e), name="Passpoint Venue Profile Creation Failed")
|
||||
|
||||
# Passpoint profile creation
|
||||
passpoint_profile_info = passpoint_profile_info
|
||||
profile_name = testbed + "-Automation-Passpoint-Profile"
|
||||
passpoint_profile_info["profile_name"] = profile_name
|
||||
passpoint_profile_info["allowed_ssids"] = profile_data["allowed_ssids"]
|
||||
instantiate_profile.delete_profile_by_name(profile_name=profile_name)
|
||||
try:
|
||||
creates_profile = instantiate_profile.create_passpoint_profile(profile_data=passpoint_profile_info)
|
||||
allure.attach(body=str(creates_profile), name="Passpoint Profile Created")
|
||||
test_cases["passpoint"] = {"sdk": True}
|
||||
profile_data["passpoint"] = profile_name
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["passpoint"] = {"sdk": False}
|
||||
allure.attach(body=str(e), name="Passpoint Profile Creation Failed")
|
||||
|
||||
# Update SSID profile with passpoint config
|
||||
passpoint_profile_info = passpoint_profile_info
|
||||
ssid_to_apply = None
|
||||
for ssid_profile in profile_data["ssid"].keys():
|
||||
for ssid in profile_data["ssid"][ssid_profile]:
|
||||
if ssid["ssid_name"] == "passpoint_profile_download":
|
||||
ssid_to_apply = ssid["ssid_name"]
|
||||
continue
|
||||
if ssid["ssid_name"] in test_cases.keys():
|
||||
allure.attach(body=str(ssid), name="Updating SSID profile")
|
||||
passpoint_profile_info["ssid_profile_name"] = ssid["profile_name"]
|
||||
instantiate_profile.update_ssid_profile(profile_info=passpoint_profile_info)
|
||||
|
||||
# Equipment AP Profile Creation
|
||||
ap_profile_info = dict()
|
||||
ap_profile_info["profile_name"] = profile_data["equipment_ap"]["profile_name"]
|
||||
ap_profile_info["ssid_names"] = [ssid_to_apply]
|
||||
try:
|
||||
instantiate_profile.set_ap_profile_custom(profile_data=ap_profile_info)
|
||||
test_cases["equipment_ap"] = {"sdk": True}
|
||||
allure.attach(body=str(profile_data["equipment_ap"]), name="Equipment AP Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["equipment_ap"] = {"sdk": False}
|
||||
allure.attach(body=str(e), name="Equipment AP Profile Creation Failed")
|
||||
|
||||
|
||||
def teardown_session():
|
||||
print("\nRemoving Profiles")
|
||||
instantiate_profile.delete_profile_by_name(profile_name=profile_data['equipment_ap']['profile_name'])
|
||||
instantiate_profile.delete_profile(instantiate_profile.profile_creation_ids["ssid"])
|
||||
instantiate_profile.delete_profile(instantiate_profile.profile_creation_ids["radius"])
|
||||
instantiate_profile.delete_profile(instantiate_profile.profile_creation_ids["rf"])
|
||||
instantiate_profile.delete_profile(instantiate_profile.profile_creation_ids["passpoint_osu_id_provider"])
|
||||
instantiate_profile.delete_profile(instantiate_profile.profile_creation_ids["passpoint_operator"])
|
||||
instantiate_profile.delete_profile(instantiate_profile.profile_creation_ids["passpoint_venue"])
|
||||
instantiate_profile.delete_profile(instantiate_profile.profile_creation_ids["passpoint"])
|
||||
allure.attach(body=str(profile_data['equipment_ap']['profile_name'] + "\n"),
|
||||
name="Tear Down in Profiles ")
|
||||
time.sleep(20)
|
||||
|
||||
request.addfinalizer(teardown_session)
|
||||
yield test_cases, instantiate_profile, profile_data
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def push_ap_profile(request, setup_profiles, get_equipment_id, get_apnos, get_configuration):
|
||||
parameter = dict(request.param)
|
||||
test_cases, instantiate_profile, profile_data = setup_profiles
|
||||
ssid_names = parameter["ssid_names"]
|
||||
ap_profile_info = dict()
|
||||
ap_profile_info["profile_name"] = profile_data["equipment_ap"]["profile_name"]
|
||||
test_cases = {}
|
||||
ap_profile_info["ssid_names"] = ssid_names
|
||||
try:
|
||||
instantiate_profile.update_ap_profile(profile_data=ap_profile_info)
|
||||
test_cases["equipment_ap"] = {"sdk": True}
|
||||
allure.attach(body=str(ap_profile_info["profile_name"]), name="Equipment AP Profile Updated")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["equipment_ap"] = {"sdk": False}
|
||||
allure.attach(body=str(e), name="Equipment AP Profile Update Failed")
|
||||
|
||||
print("Pushing profiles on AP :: ", ap_profile_info)
|
||||
allure.attach(body=str(ap_profile_info), name="Pushing profiles on AP :: ")
|
||||
# Push the Equipment AP Profile to AP
|
||||
try:
|
||||
for i in get_equipment_id:
|
||||
instantiate_profile.push_profile_old_method(equipment_id=i)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
print("failed to push AP Profile")
|
||||
|
||||
# Check the VIF Config and VIF State of SSIDs
|
||||
time_start = time.time()
|
||||
ap_ssh = get_apnos(get_configuration["access_point"][0], pwd="../libs/apnos/")
|
||||
while time.time() - time_start < 240:
|
||||
if ((time.time() - time_start) / 10) == 15:
|
||||
ap_ssh = get_apnos(get_configuration["access_point"][0], pwd="../libs/apnos/")
|
||||
vif_config = list(ap_ssh.get_vif_config_ssids())
|
||||
vif_config.sort()
|
||||
vif_state = list(ap_ssh.get_vif_state_ssids())
|
||||
vif_state.sort()
|
||||
for ssid in ssid_names:
|
||||
test_cases[ssid] = dict()
|
||||
test_cases[ssid]["vif_config"] = True if ssid in vif_config else False
|
||||
test_cases[ssid]["vif_state"] = True if ssid in vif_state else False
|
||||
ssid_names.sort()
|
||||
if vif_config == ssid_names == vif_state:
|
||||
print("Waiting for Radios to apply config ")
|
||||
time.sleep(200)
|
||||
break
|
||||
time.sleep(10)
|
||||
allure.attach(body=str(vif_config), name="vifC status on AP :: ")
|
||||
allure.attach(body=str(vif_state), name="vifS status on AP :: ")
|
||||
|
||||
yield test_cases
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def passpoint_radius_server_info():
|
||||
allure.attach(body=str(PASSPOINT_RADIUS_SERVER_DATA), name="Passpoint RADIUS server Info: ")
|
||||
yield PASSPOINT_RADIUS_SERVER_DATA
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def passpoint_radius_accounting_server_info():
|
||||
allure.attach(body=str(PASSPOINT_RADIUS_ACCOUNTING_SERVER_DATA), name="Passpoint RADIUS account server Info: ")
|
||||
yield PASSPOINT_RADIUS_ACCOUNTING_SERVER_DATA
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def passpoint_provider_info():
|
||||
allure.attach(body=str(PASSPOINT_PROVIDER_INFO), name="Passpoint Provider Info: ")
|
||||
yield PASSPOINT_PROVIDER_INFO
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def passpoint_operator_info():
|
||||
allure.attach(body=str(PASSPOINT_OPERATOR_INFO), name="Passpoint operator Info: ")
|
||||
yield PASSPOINT_OPERATOR_INFO
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def passpoint_venue_info():
|
||||
allure.attach(body=str(PASSPOINT_VENUE_INFO), name="Passpoint venue Info: ")
|
||||
yield PASSPOINT_VENUE_INFO
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def passpoint_profile_info():
|
||||
allure.attach(body=str(PASSPOINT_PROFILE_INFO), name="Passpoint profile Info: ")
|
||||
yield PASSPOINT_PROFILE_INFO
|
||||
@@ -1,138 +0,0 @@
|
||||
from logging import exception
|
||||
import unittest
|
||||
import warnings
|
||||
from perfecto.test import TestResultFactory
|
||||
import pytest
|
||||
import sys
|
||||
import time
|
||||
from selenium.common.exceptions import NoSuchElementException
|
||||
from selenium.webdriver.common.by import By
|
||||
from appium import webdriver
|
||||
from selenium.common.exceptions import NoSuchElementException
|
||||
|
||||
import sys
|
||||
import allure
|
||||
|
||||
if 'perfecto_libs' not in sys.path:
|
||||
sys.path.append(f'../libs/perfecto_libs')
|
||||
|
||||
from android_lib import closeApp, set_APconnMobileDevice_android, verifyUploadDownloadSpeed_android, Toggle_AirplaneMode_android, ForgetWifiConnection, openApp, setup_perfectoMobile_android
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "NAT",
|
||||
"ssid_modes": {
|
||||
"wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],"security_key": "something"}],
|
||||
"wpa2_personal": [
|
||||
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],"security_key": "something"}]},
|
||||
"rf": {},
|
||||
"radius": False
|
||||
}
|
||||
|
||||
@pytest.mark.OpenRoamingAndroid
|
||||
#@pytest.mark.interop_and
|
||||
@allure.feature("NAT MODE CLIENT CONNECTIVITY")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_general],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestOpenRoaming(object):
|
||||
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa2_personal
|
||||
def test_OpenRoaming_5g_WPA2_Personal(self, request, get_APToMobileDevice_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
ssidPassword = profile_data["security_key"]
|
||||
print ("SSID_NAME: " + ssidName)
|
||||
print ("SSID_PASS: " + ssidPassword)
|
||||
|
||||
report = setup_perfectoMobile_android[1]
|
||||
driver = setup_perfectoMobile_android[0]
|
||||
connData = get_APToMobileDevice_data
|
||||
|
||||
#Set Wifi/AP Mode
|
||||
set_APconnMobileDevice_android(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
|
||||
|
||||
#Install Profile
|
||||
|
||||
#Verify Upload download Speed from device Selection
|
||||
assert verifyUploadDownloadSpeed_android(request, setup_perfectoMobile_android, connData)
|
||||
|
||||
#ForgetWifi
|
||||
ForgetWifiConnection(request, setup_perfectoMobile_android, ssidName, connData)
|
||||
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa2_personal
|
||||
def test_OpenRoaming_2g_WPA2_Personal(self, request, get_APToMobileDevice_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
ssidPassword = profile_data["security_key"]
|
||||
print ("SSID_NAME: " + ssidName)
|
||||
print ("SSID_PASS: " + ssidPassword)
|
||||
|
||||
report = setup_perfectoMobile_android[1]
|
||||
driver = setup_perfectoMobile_android[0]
|
||||
connData = get_APToMobileDevice_data
|
||||
|
||||
#Set Wifi/AP Mode
|
||||
set_APconnMobileDevice_android(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
|
||||
|
||||
#Toggle AirplaneMode
|
||||
assert Toggle_AirplaneMode_android(request, setup_perfectoMobile_android, connData)
|
||||
|
||||
#ForgetWifi
|
||||
ForgetWifiConnection(request, setup_perfectoMobile_android, ssidName, connData)
|
||||
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa
|
||||
def test_OpenRoaming_2g_WPA(self, request, get_APToMobileDevice_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
ssidPassword = profile_data["security_key"]
|
||||
print ("SSID_NAME: " + ssidName)
|
||||
print ("SSID_PASS: " + ssidPassword)
|
||||
|
||||
report = setup_perfectoMobile_android[1]
|
||||
driver = setup_perfectoMobile_android[0]
|
||||
connData = get_APToMobileDevice_data
|
||||
|
||||
#Set Wifi/AP Mode
|
||||
set_APconnMobileDevice_android(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
|
||||
|
||||
#Toggle AirplaneMode
|
||||
assert Toggle_AirplaneMode_android(request, setup_perfectoMobile_android, connData)
|
||||
|
||||
#ForgetWifi
|
||||
ForgetWifiConnection(request, setup_perfectoMobile_android, ssidName, connData)
|
||||
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa
|
||||
def test_OpenRoaming_5g_WPA(self, request, get_APToMobileDevice_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa"][1]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
ssidPassword = profile_data["security_key"]
|
||||
print ("SSID_NAME: " + ssidName)
|
||||
print ("SSID_PASS: " + ssidPassword)
|
||||
|
||||
report = setup_perfectoMobile_android[1]
|
||||
driver = setup_perfectoMobile_android[0]
|
||||
connData = get_APToMobileDevice_data
|
||||
|
||||
#Set Wifi/AP Mode
|
||||
set_APconnMobileDevice_android(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
|
||||
|
||||
#Toggle AirplaneMode
|
||||
assert Toggle_AirplaneMode_android(request, setup_perfectoMobile_android, connData)
|
||||
|
||||
#ForgetWifi
|
||||
ForgetWifiConnection(request, setup_perfectoMobile_android, ssidName, connData)
|
||||
@@ -0,0 +1,345 @@
|
||||
from logging import exception
|
||||
import unittest
|
||||
import warnings
|
||||
from perfecto.test import TestResultFactory
|
||||
import pytest
|
||||
import sys
|
||||
import time
|
||||
from selenium.common.exceptions import NoSuchElementException
|
||||
from selenium.webdriver.common.by import By
|
||||
from appium import webdriver
|
||||
from selenium.common.exceptions import NoSuchElementException
|
||||
|
||||
import sys
|
||||
import allure
|
||||
|
||||
if 'perfecto_libs' not in sys.path:
|
||||
sys.path.append(f'../libs/perfecto_libs')
|
||||
|
||||
pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.android, pytest.mark.interop_and, pytest.mark.openRoaming, pytest.mark.bridge]
|
||||
|
||||
from android_lib import closeApp, set_APconnMobileDevice_android, verify_APconnMobileDevice_Android, deleteOpenRoamingInstalledProfile, downloadInstallOpenRoamingProfile, verifyUploadDownloadSpeed_android, Toggle_AirplaneMode_android, ForgetWifiConnection, openApp, setup_perfectoMobile_android
|
||||
|
||||
"""
|
||||
EAP Passpoint Test: BRIDGE Mode
|
||||
pytest -m "interop_iOS and eap_passpoint and bridge"
|
||||
"""
|
||||
|
||||
setup_params_eap = {
|
||||
"mode": "BRIDGE",
|
||||
"ssid_modes": {
|
||||
"open": [
|
||||
{"ssid_name": "passpoint_profile_download", "appliedRadios": ["is2dot4GHz"]}
|
||||
],
|
||||
"wpa2_eap": [
|
||||
{"ssid_name": "ssid_wpa2_eap_passpoint_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa2_eap_passpoint_5g", "appliedRadios": ["is5GHz"]}
|
||||
],
|
||||
"wpa2_only_eap": [
|
||||
{"ssid_name": "ssid_wpa2_only_eap_passpoint_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa2_only_eap_passpoint_5g", "appliedRadios": ["is5GHz"]}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@allure.feature("BRIDGE MODE EAP PASSPOINT SETUP")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_eap],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestOpenRoamingBridgeMode(object):
|
||||
|
||||
@pytest.mark.wpa2_eap
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.parametrize(
|
||||
'push_ap_profile',
|
||||
[{"ssid_names": ["ssid_wpa2_eap_passpoint_2g", "passpoint_profile_download"]}],
|
||||
indirect=True,
|
||||
scope="function"
|
||||
)
|
||||
@pytest.mark.usefixtures("push_ap_profile")
|
||||
def test_OpenRoaming_2g_WPA2_EAP(self, passpoint_profile_info, push_ap_profile, request, get_APToMobileDevice_data, setup_perfectoMobile_android):
|
||||
"""
|
||||
EAP Passpoint BRIDGE Mode
|
||||
pytest -m "interop_iOS and eap_passpoint and bridge and wpa2_eap and twog"
|
||||
"""
|
||||
result = push_ap_profile['ssid_wpa2_eap_passpoint_2g']['vif_config']
|
||||
if result:
|
||||
allure.attach(name="Config push to AP for ssid_wpa2_eap_passpoint_2g successful ", body="")
|
||||
else:
|
||||
allure.attach(name="Config push to AP for ssid_wpa2_eap_passpoint_2g failed", body="")
|
||||
assert result
|
||||
result = push_ap_profile['ssid_wpa2_eap_passpoint_2g']['vif_state']
|
||||
if result:
|
||||
allure.attach(name="Config apply to AP for ssid_wpa2_eap_passpoint_2g successful ", body="")
|
||||
else:
|
||||
allure.attach(name="Config apply to AP for ssid_wpa2_eap_passpoint_2g failed", body="")
|
||||
assert result
|
||||
|
||||
print("SSID to download profile :: ", setup_params_eap["ssid_modes"]["open"][0]["ssid_name"])
|
||||
print("SSID to validate connectivity :: ", setup_params_eap["ssid_modes"]["wpa2_eap"][0]["ssid_name"])
|
||||
print("Profile download URL :: ", passpoint_profile_info["profile_download_url_ios"])
|
||||
print("Profile name to remove :: ", passpoint_profile_info["profile_name_on_device"])
|
||||
|
||||
#SSID to download profile :: passpoint_profile_download
|
||||
#SSID to validate connectivity :: ssid_wpa2_eap_passpoint_5g
|
||||
#Profile download URL :: https://onboard.almondlabs.net/ios.html
|
||||
#Profile name to remove :: AmeriBand
|
||||
|
||||
report = setup_perfectoMobile_android[1]
|
||||
driver = setup_perfectoMobile_android[0]
|
||||
connData = get_APToMobileDevice_data
|
||||
|
||||
downloadProfileSSID = setup_params_eap["ssid_modes"]["open"][0]["ssid_name"]
|
||||
downloadProfileSSIDPass = ""
|
||||
#profileDownloadURL = passpoint_profile_info["profile_download_url_ios"]
|
||||
profileDownloadURL = "https://onboard.almondlabs.net/ttls/androidconfig.cfg"
|
||||
profileName = passpoint_profile_info["profile_name_on_device"]
|
||||
profileNameSSID = setup_params_eap["ssid_modes"]["wpa2_eap"][1]["ssid_name"]
|
||||
|
||||
|
||||
#Delete Profile Under Settings
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_android, connData)
|
||||
|
||||
#ForgetWifi
|
||||
#ForgetWifiConnection(request, setup_perfectoMobile_android, profileNameSSID, connData)
|
||||
|
||||
#Set Wifi/AP Mode
|
||||
set_APconnMobileDevice_android(request, downloadProfileSSID, downloadProfileSSIDPass, setup_perfectoMobile_android, connData)
|
||||
|
||||
#Install Profile
|
||||
downloadInstallOpenRoamingProfile(request, profileDownloadURL, setup_perfectoMobile_android, connData)
|
||||
|
||||
#ForgetWifi Original
|
||||
ForgetWifiConnection(request, setup_perfectoMobile_android, downloadProfileSSID, connData)
|
||||
|
||||
try:
|
||||
verify_APconnMobileDevice_Android(request, profileNameSSID, setup_perfectoMobile_android, connData)
|
||||
|
||||
#Verify Upload download Speed from device Selection
|
||||
verifyUploadDownloadSpeed_android(request, setup_perfectoMobile_android, connData)
|
||||
|
||||
except Exception as e:
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_android, connData)
|
||||
assert False
|
||||
|
||||
#Delete Profile Under Settings
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_android, connData)
|
||||
|
||||
|
||||
@pytest.mark.wpa2_eap
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.parametrize(
|
||||
'push_ap_profile',
|
||||
[{"ssid_names": ["ssid_wpa2_eap_passpoint_5g", "passpoint_profile_download"]}],
|
||||
indirect=True,
|
||||
scope="function"
|
||||
)
|
||||
@pytest.mark.usefixtures("push_ap_profile")
|
||||
def test_OpenRoaming_5g_WPA2_EAP(self, passpoint_profile_info, push_ap_profile, request, get_APToMobileDevice_data, setup_perfectoMobile_android):
|
||||
"""
|
||||
EAP Passpoint BRIDGE Mode
|
||||
pytest -m "interop_iOS and eap_passpoint and bridge and wpa2_eap and fiveg"
|
||||
"""
|
||||
result = push_ap_profile['ssid_wpa2_eap_passpoint_5g']['vif_config']
|
||||
if result:
|
||||
allure.attach(name="Config push to AP for ssid_wpa2_eap_passpoint_5g successful ", body="")
|
||||
else:
|
||||
allure.attach(name="Config push to AP for ssid_wpa2_eap_passpoint_5g failed", body="")
|
||||
assert result
|
||||
result = push_ap_profile['ssid_wpa2_eap_passpoint_5g']['vif_state']
|
||||
if result:
|
||||
allure.attach(name="Config apply to AP for ssid_wpa2_eap_passpoint_5g successful ", body="")
|
||||
else:
|
||||
allure.attach(name="Config apply to AP for ssid_wpa2_eap_passpoint_5g failed", body="")
|
||||
assert result
|
||||
|
||||
print("SSID to download profile :: ", setup_params_eap["ssid_modes"]["open"][0]["ssid_name"])
|
||||
print("SSID to validate connectivity :: ", setup_params_eap["ssid_modes"]["wpa2_eap"][1]["ssid_name"])
|
||||
print("Profile download URL :: ", passpoint_profile_info["profile_download_url_ios"])
|
||||
print("Profile name to remove :: ", passpoint_profile_info["profile_name_on_device"])
|
||||
#SSID to download profile :: passpoint_profile_download
|
||||
#SSID to validate connectivity :: ssid_wpa2_eap_passpoint_5g
|
||||
#Profile download URL :: https://onboard.almondlabs.net/ios.html
|
||||
#Profile name to remove :: AmeriBand
|
||||
|
||||
report = setup_perfectoMobile_android[1]
|
||||
driver = setup_perfectoMobile_android[0]
|
||||
connData = get_APToMobileDevice_data
|
||||
|
||||
downloadProfileSSID = setup_params_eap["ssid_modes"]["open"][0]["ssid_name"]
|
||||
downloadProfileSSIDPass = ""
|
||||
#profileDownloadURL = passpoint_profile_info["profile_download_url_ios"]
|
||||
profileDownloadURL = "https://onboard.almondlabs.net/ttls/androidconfig.cfg"
|
||||
profileName = passpoint_profile_info["profile_name_on_device"]
|
||||
profileNameSSID = setup_params_eap["ssid_modes"]["wpa2_eap"][1]["ssid_name"]
|
||||
|
||||
#Delete Profile Under Settings
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_android, connData)
|
||||
|
||||
#Set Wifi/AP Mode
|
||||
set_APconnMobileDevice_android(request, downloadProfileSSID, downloadProfileSSIDPass, setup_perfectoMobile_android, connData)
|
||||
|
||||
#Install Profile
|
||||
downloadInstallOpenRoamingProfile(request, profileDownloadURL, setup_perfectoMobile_android, connData)
|
||||
|
||||
#ForgetWifi Original
|
||||
ForgetWifiConnection(request, setup_perfectoMobile_android, downloadProfileSSID, connData)
|
||||
|
||||
try:
|
||||
verify_APconnMobileDevice_Android(request, profileName, setup_perfectoMobile_android, connData)
|
||||
|
||||
#Verify Upload download Speed from device Selection
|
||||
verifyUploadDownloadSpeed_android(request, setup_perfectoMobile_android, connData)
|
||||
|
||||
except Exception as e:
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_android, connData)
|
||||
assert False
|
||||
|
||||
#Delete Profile Under Settings
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_android, connData)
|
||||
|
||||
@pytest.mark.wpa2_only_eap
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.parametrize(
|
||||
'push_ap_profile',
|
||||
[{"ssid_names": ["ssid_wpa2_only_eap_passpoint_2g", "passpoint_profile_download"]}],
|
||||
indirect=True,
|
||||
scope="function"
|
||||
)
|
||||
@pytest.mark.usefixtures("push_ap_profile")
|
||||
def test_wpa2_only_eap_2g(self, passpoint_profile_info, push_ap_profile, request, get_APToMobileDevice_data, setup_perfectoMobile_android):
|
||||
"""
|
||||
EAP Passpoint BRIDGE Mode
|
||||
pytest -m "interop_iOS and eap_passpoint and bridge and wpa2_only_eap and twog"
|
||||
"""
|
||||
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_2g']['vif_config']
|
||||
if result:
|
||||
allure.attach(name="Config push to AP for ssid_wpa2_only_eap_passpoint_2g successful ", body="")
|
||||
else:
|
||||
allure.attach(name="Config push to AP for ssid_wpa2_only_eap_passpoint_2g failed", body="")
|
||||
assert result
|
||||
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_2g']['vif_state']
|
||||
if result:
|
||||
allure.attach(name="Config apply to AP for ssid_wpa2_only_eap_passpoint_2g successful ", body="")
|
||||
else:
|
||||
allure.attach(name="Config apply to AP for ssid_wpa2_only_eap_passpoint_2g failed", body="")
|
||||
assert result
|
||||
|
||||
print("SSID to download profile :: ", setup_params_eap["ssid_modes"]["open"][0]["ssid_name"])
|
||||
print("SSID to validate connectivity :: ", setup_params_eap["ssid_modes"]["wpa2_only_eap"][0]["ssid_name"])
|
||||
print("Profile download URL :: ", passpoint_profile_info["profile_download_url_ios"])
|
||||
print("Profile name to remove :: ", passpoint_profile_info["profile_name_on_device"])
|
||||
|
||||
report = setup_perfectoMobile_android[1]
|
||||
driver = setup_perfectoMobile_android[0]
|
||||
connData = get_APToMobileDevice_data
|
||||
|
||||
downloadProfileSSID = setup_params_eap["ssid_modes"]["open"][0]["ssid_name"]
|
||||
downloadProfileSSIDPass = ""
|
||||
#profileDownloadURL = passpoint_profile_info["profile_download_url_ios"]
|
||||
profileDownloadURL = "https://onboard.almondlabs.net/ttls/androidconfig.cfg"
|
||||
profileName = passpoint_profile_info["profile_name_on_device"]
|
||||
profileNameSSID = setup_params_eap["ssid_modes"]["wpa2_eap"][1]["ssid_name"]
|
||||
|
||||
#Delete Profile Under Settings
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_android, connData)
|
||||
|
||||
#ForgetWifi
|
||||
#ForgetWifiConnection(request, setup_perfectoMobile_android, profileNameSSID, connData)
|
||||
|
||||
#Set Wifi/AP Mode
|
||||
set_APconnMobileDevice_android(request, downloadProfileSSID, downloadProfileSSIDPass, setup_perfectoMobile_android, connData)
|
||||
|
||||
#Install Profile
|
||||
downloadInstallOpenRoamingProfile(request, profileDownloadURL, setup_perfectoMobile_android, connData)
|
||||
|
||||
#ForgetWifi Original
|
||||
ForgetWifiConnection(request, setup_perfectoMobile_android, downloadProfileSSID, connData)
|
||||
|
||||
try:
|
||||
verify_APconnMobileDevice_Android(request, profileNameSSID, setup_perfectoMobile_android, connData)
|
||||
|
||||
#Verify Upload download Speed from device Selection
|
||||
verifyUploadDownloadSpeed_android(request, setup_perfectoMobile_android, connData)
|
||||
|
||||
except Exception as e:
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_android, connData)
|
||||
assert False
|
||||
|
||||
#Delete Profile Under Settings
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_android, connData)
|
||||
|
||||
@pytest.mark.wpa2_only_eap
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.parametrize(
|
||||
'push_ap_profile',
|
||||
[{"ssid_names": ["ssid_wpa2_only_eap_passpoint_5g", "passpoint_profile_download"]}],
|
||||
indirect=True,
|
||||
scope="function"
|
||||
)
|
||||
@pytest.mark.usefixtures("push_ap_profile")
|
||||
def test_wpa2_only_eap_5g(self, passpoint_profile_info, push_ap_profile, request, get_APToMobileDevice_data, setup_perfectoMobile_android):
|
||||
"""
|
||||
EAP Passpoint BRIDGE Mode
|
||||
pytest -m "interop_iOS and eap_passpoint and bridge and wpa2_only_eap and fiveg"
|
||||
"""
|
||||
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_5g']['vif_config']
|
||||
if result:
|
||||
allure.attach(name="Config push to AP for ssid_wpa2_only_eap_passpoint_5g successful ", body="")
|
||||
else:
|
||||
allure.attach(name="Config push to AP for ssid_wpa2_only_eap_passpoint_5g failed", body="")
|
||||
assert result
|
||||
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_5g']['vif_state']
|
||||
if result:
|
||||
allure.attach(name="Config apply to AP for ssid_wpa2_only_eap_passpoint_5g successful ", body="")
|
||||
else:
|
||||
allure.attach(name="Config apply to AP for ssid_wpa2_only_eap_passpoint_5g failed", body="")
|
||||
assert result
|
||||
|
||||
print("SSID to download profile :: ", setup_params_eap["ssid_modes"]["open"][0]["ssid_name"])
|
||||
print("SSID to validate connectivity :: ", setup_params_eap["ssid_modes"]["wpa2_only_eap"][1]["ssid_name"])
|
||||
print("Profile download URL :: ", passpoint_profile_info["profile_download_url_ios"])
|
||||
print("Profile name to remove :: ", passpoint_profile_info["profile_name_on_device"])
|
||||
|
||||
report = setup_perfectoMobile_android[1]
|
||||
driver = setup_perfectoMobile_android[0]
|
||||
connData = get_APToMobileDevice_data
|
||||
|
||||
downloadProfileSSID = setup_params_eap["ssid_modes"]["open"][0]["ssid_name"]
|
||||
downloadProfileSSIDPass = ""
|
||||
#profileDownloadURL = passpoint_profile_info["profile_download_url_ios"]
|
||||
profileDownloadURL = "https://onboard.almondlabs.net/ttls/androidconfig.cfg"
|
||||
profileName = passpoint_profile_info["profile_name_on_device"]
|
||||
profileNameSSID = setup_params_eap["ssid_modes"]["wpa2_eap"][1]["ssid_name"]
|
||||
|
||||
#Delete Profile Under Settings
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_android, connData)
|
||||
|
||||
#ForgetWifi
|
||||
#ForgetWifiConnection(request, setup_perfectoMobile_android, profileNameSSID, connData)
|
||||
|
||||
#Set Wifi/AP Mode
|
||||
set_APconnMobileDevice_android(request, downloadProfileSSID, downloadProfileSSIDPass, setup_perfectoMobile_android, connData)
|
||||
|
||||
#Install Profile
|
||||
downloadInstallOpenRoamingProfile(request, profileDownloadURL, setup_perfectoMobile_android, connData)
|
||||
|
||||
#ForgetWifi Original
|
||||
ForgetWifiConnection(request, setup_perfectoMobile_android, downloadProfileSSID, connData)
|
||||
|
||||
try:
|
||||
verify_APconnMobileDevice_Android(request, profileNameSSID, setup_perfectoMobile_android, connData)
|
||||
|
||||
#Verify Upload download Speed from device Selection
|
||||
verifyUploadDownloadSpeed_android(request, setup_perfectoMobile_android, connData)
|
||||
|
||||
except Exception as e:
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_android, connData)
|
||||
assert False
|
||||
|
||||
#Delete Profile Under Settings
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_android, connData)
|
||||
@@ -16,6 +16,8 @@ import allure
|
||||
if 'perfecto_libs' not in sys.path:
|
||||
sys.path.append(f'../libs/perfecto_libs')
|
||||
|
||||
pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.android, pytest.mark.interop_and, pytest.mark.PassPointConnection]
|
||||
|
||||
from android_lib import closeApp, set_APconnMobileDevice_android, verifyUploadDownloadSpeed_android, Toggle_WifiMode_android, Toggle_AirplaneMode_android, ForgetWifiConnection, openApp, setup_perfectoMobile_android
|
||||
|
||||
setup_params_general = {
|
||||
@@ -30,9 +32,6 @@ setup_params_general = {
|
||||
"radius": False
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.PassPointConnectionAndroid
|
||||
@pytest.mark.interop_and
|
||||
@allure.feature("NAT MODE CLIENT CONNECTIVITY")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
|
||||
@@ -16,6 +16,8 @@ import allure
|
||||
if 'perfecto_libs' not in sys.path:
|
||||
sys.path.append(f'../libs/perfecto_libs')
|
||||
|
||||
pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.interop_and, pytest.mark.android, pytest.mark.ToggleWifiMode]
|
||||
|
||||
from android_lib import closeApp, set_APconnMobileDevice_android, Toggle_WifiMode_android, Toggle_AirplaneMode_android, ForgetWifiConnection, openApp, setup_perfectoMobile_android
|
||||
|
||||
setup_params_general = {
|
||||
@@ -30,8 +32,6 @@ setup_params_general = {
|
||||
"radius": False
|
||||
}
|
||||
|
||||
@pytest.mark.ToggleWifiModeAndroid
|
||||
@pytest.mark.interop_and
|
||||
@allure.feature("NAT MODE CLIENT CONNECTIVITY")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
|
||||
@@ -16,6 +16,8 @@ import allure
|
||||
if 'perfecto_libs' not in sys.path:
|
||||
sys.path.append(f'../libs/perfecto_libs')
|
||||
|
||||
pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.android, pytest.mark.interop_and, pytest.mark.ClientConnectivity]
|
||||
|
||||
from android_lib import closeApp, set_APconnMobileDevice_android, verifyUploadDownloadSpeed_android, Toggle_AirplaneMode_android, ForgetWifiConnection, openApp, setup_perfectoMobile_android
|
||||
|
||||
setup_params_general = {
|
||||
@@ -30,8 +32,6 @@ setup_params_general = {
|
||||
"radius": False
|
||||
}
|
||||
|
||||
@pytest.mark.ClientConnectivityAndroid
|
||||
@pytest.mark.interop_and
|
||||
@allure.feature("NAT MODE CLIENT CONNECTIVITY")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
|
||||
@@ -210,10 +210,8 @@ def get_APToMobileDevice_data(request):
|
||||
"bundleId-iOS-Safari": request.config.getini("bundleId-iOS-Safari"),
|
||||
"downloadMbps": "//*[@id='knowledge-verticals-internetspeedtest__download']/P[@class='spiqle']",
|
||||
"UploadMbps": "//*[@id='knowledge-verticals-internetspeedtest__upload']/P[@class='spiqle']",
|
||||
"openRoaming-iOS-URL": request.config.getini("openRoaming-iOS-URL"),
|
||||
#Android
|
||||
"platformName-android": request.config.getini("platformName-android"),
|
||||
"openRoaming-and-URL": request.config.getini("openRoaming-and-URL"),
|
||||
"appPackage-android": request.config.getini("appPackage-android")
|
||||
}
|
||||
yield passPoint_data
|
||||
@@ -756,4 +754,12 @@ def failure_tracking_fixture(request):
|
||||
print("tests_failed_during_module: ")
|
||||
print(tests_failed_during_module)
|
||||
yield tests_failed_during_module
|
||||
|
||||
|
||||
|
||||
@pytest.fixture(scope="class")
|
||||
def get_vif_state(get_apnos, get_configuration):
|
||||
ap_ssh = get_apnos(get_configuration['access_point'][0], pwd="../libs/apnos/")
|
||||
vif_state = list(ap_ssh.get_vif_state_ssids())
|
||||
vif_state.sort()
|
||||
allure.attach(name="vif_state", body=str(vif_state))
|
||||
yield vif_state
|
||||
|
||||
@@ -19,6 +19,8 @@ if 'perfecto_libs' not in sys.path:
|
||||
|
||||
from iOS_lib import closeApp, openApp, get_WifiIPAddress_iOS, ForgetWifiConnection, ping_deftapps_iOS, Toggle_AirplaneMode_iOS, set_APconnMobileDevice_iOS, verify_APconnMobileDevice_iOS, Toggle_WifiMode_iOS, tearDown
|
||||
|
||||
pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.ios, pytest.mark.interop_ios, pytest.mark.AccessPassPointConnectivety]
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "NAT",
|
||||
"ssid_modes": {
|
||||
@@ -31,17 +33,15 @@ setup_params_general = {
|
||||
"radius": False
|
||||
}
|
||||
|
||||
@pytest.mark.AccessPassPointConnectivety
|
||||
@pytest.mark.interop_iOS
|
||||
@allure.feature("NAT MODE CLIENT CONNECTIVITY")
|
||||
#@pytest.mark.parametrize(
|
||||
# 'setup_profiles',
|
||||
# [setup_params_general],
|
||||
# indirect=True,
|
||||
# scope="class"
|
||||
#)
|
||||
#@pytest.mark.usefixtures("setup_profiles")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_general],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestAccessPointConnectivety(object):
|
||||
|
||||
@pytest.mark.fiveg
|
||||
@@ -68,7 +68,7 @@ class TestAccessPointConnectivety(object):
|
||||
#Open Ping Application
|
||||
openApp(connData["bundleId-iOS-Ping"], setup_perfectoMobile_iOS)
|
||||
|
||||
ping_deftapps_iOS(request, setup_perfectoMobile_iOS, wifi_ip)
|
||||
ping_deftapps_iOS(setup_perfectoMobile_iOS, wifi_ip)
|
||||
|
||||
#ForgetWifi
|
||||
ForgetWifiConnection(request, setup_perfectoMobile_iOS, ssidName, connData)
|
||||
@@ -96,7 +96,7 @@ class TestAccessPointConnectivety(object):
|
||||
#Open Ping Application
|
||||
openApp(connData["bundleId-iOS-Ping"], setup_perfectoMobile_iOS)
|
||||
|
||||
ping_deftapps_iOS(request, setup_perfectoMobile_iOS, wifi_ip)
|
||||
ping_deftapps_iOS(setup_perfectoMobile_iOS, wifi_ip)
|
||||
|
||||
#ForgetWifi
|
||||
ForgetWifiConnection(request, setup_perfectoMobile_iOS, ssidName, connData)
|
||||
@@ -124,7 +124,7 @@ class TestAccessPointConnectivety(object):
|
||||
#Open Ping Application
|
||||
openApp(connData["bundleId-iOS-Ping"], setup_perfectoMobile_iOS)
|
||||
|
||||
ping_deftapps_iOS(request, setup_perfectoMobile_iOS, wifi_ip)
|
||||
ping_deftapps_iOS(setup_perfectoMobile_iOS, wifi_ip)
|
||||
|
||||
#ForgetWifi
|
||||
ForgetWifiConnection(request, setup_perfectoMobile_iOS, ssidName, connData)
|
||||
@@ -152,7 +152,7 @@ class TestAccessPointConnectivety(object):
|
||||
#Open Ping Application
|
||||
openApp(connData["bundleId-iOS-Ping"], setup_perfectoMobile_iOS)
|
||||
|
||||
ping_deftapps_iOS(request, setup_perfectoMobile_iOS, wifi_ip)
|
||||
ping_deftapps_iOS(setup_perfectoMobile_iOS, wifi_ip)
|
||||
|
||||
#ForgetWifi
|
||||
ForgetWifiConnection(request, setup_perfectoMobile_iOS, ssidName, connData)
|
||||
@@ -19,6 +19,8 @@ if 'perfecto_libs' not in sys.path:
|
||||
from iOS_lib import closeApp, openApp, Toggle_AirplaneMode_iOS, ForgetWifiConnection, set_APconnMobileDevice_iOS, \
|
||||
verify_APconnMobileDevice_iOS, Toggle_WifiMode_iOS, tearDown
|
||||
|
||||
pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.ios, pytest.mark.interop_ios, pytest.mark.ToggleAirplaneMode]
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "NAT",
|
||||
"ssid_modes": {
|
||||
@@ -31,8 +33,6 @@ setup_params_general = {
|
||||
"radius": False
|
||||
}
|
||||
|
||||
@pytest.mark.ToggleAirplaneMode
|
||||
@pytest.mark.interop_iOS
|
||||
@allure.feature("NAT MODE CLIENT CONNECTIVITY")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
|
||||
391
tests/e2e/interOp/iOS/OpenRoamingPassPoint/conftest.py
Normal file
391
tests/e2e/interOp/iOS/OpenRoamingPassPoint/conftest.py
Normal file
@@ -0,0 +1,391 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
sys.path.append(
|
||||
os.path.dirname(
|
||||
os.path.realpath(__file__)
|
||||
)
|
||||
)
|
||||
if "libs" not in sys.path:
|
||||
sys.path.append(f"../libs")
|
||||
|
||||
import time
|
||||
import pytest
|
||||
import allure
|
||||
from collections import defaultdict
|
||||
from lanforge.lf_tests import RunTest
|
||||
from configuration import PASSPOINT_RADIUS_SERVER_DATA
|
||||
from configuration import PASSPOINT_RADIUS_ACCOUNTING_SERVER_DATA
|
||||
from configuration import PASSPOINT_PROVIDER_INFO
|
||||
from configuration import PASSPOINT_OPERATOR_INFO
|
||||
from configuration import PASSPOINT_VENUE_INFO
|
||||
from configuration import PASSPOINT_PROFILE_INFO
|
||||
from controller.controller import ProfileUtility
|
||||
|
||||
|
||||
@allure.feature("PASSPOINT CONNECTIVITY SETUP")
|
||||
@pytest.fixture(scope="class")
|
||||
def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment_id,
|
||||
instantiate_profile, get_markers, passpoint_provider_info, passpoint_operator_info,
|
||||
passpoint_venue_info, passpoint_profile_info,
|
||||
get_configuration, passpoint_radius_server_info, passpoint_radius_accounting_server_info, get_apnos):
|
||||
instantiate_profile = instantiate_profile(sdk_client=setup_controller)
|
||||
vlan_id, mode = 0, 0
|
||||
instantiate_profile.cleanup_objects()
|
||||
parameter = dict(request.param)
|
||||
test_cases = {}
|
||||
profile_data = {}
|
||||
if parameter["mode"] not in ["BRIDGE", "NAT", "VLAN"]:
|
||||
print("Invalid Mode: ", parameter["mode"])
|
||||
allure.attach(body=parameter["mode"], name="Invalid Mode: ")
|
||||
yield test_cases
|
||||
|
||||
if parameter["mode"] == "NAT":
|
||||
mode = "NAT"
|
||||
vlan_id = 1
|
||||
if parameter["mode"] == "BRIDGE":
|
||||
mode = "BRIDGE"
|
||||
vlan_id = 1
|
||||
if parameter["mode"] == "VLAN":
|
||||
mode = "BRIDGE"
|
||||
vlan_id = setup_vlan
|
||||
|
||||
ap_profile = testbed + "-Equipment-AP-Passpoint"
|
||||
instantiate_profile.delete_profile_by_name(profile_name=ap_profile)
|
||||
profile_data["equipment_ap"] = {"profile_name": ap_profile}
|
||||
|
||||
profile_data["ssid"] = {}
|
||||
# Only passpoint SSID need to be applied with passpoint profiles leaving ssid used for
|
||||
# profile download - passpoint_profile_download
|
||||
profile_data["allowed_ssids"] = []
|
||||
for i in parameter["ssid_modes"]:
|
||||
profile_data["ssid"][i] = []
|
||||
for j in range(len(parameter["ssid_modes"][i])):
|
||||
profile_name = testbed + "-SSID-" + i + "-" + str(j) + "-" + parameter["mode"]
|
||||
data = parameter["ssid_modes"][i][j]
|
||||
data["profile_name"] = profile_name
|
||||
if "mode" not in dict(data).keys():
|
||||
data["mode"] = mode
|
||||
if "vlan" not in dict(data).keys():
|
||||
data["vlan"] = vlan_id
|
||||
instantiate_profile.delete_profile_by_name(profile_name=profile_name)
|
||||
profile_data["ssid"][i].append(data)
|
||||
|
||||
instantiate_profile.delete_profile_by_name(profile_name=testbed + "-Automation-Radius-Profile-" + mode)
|
||||
time.sleep(10)
|
||||
|
||||
# RF Profile Creation
|
||||
rf_profile_data = {
|
||||
"name": testbed + "-RF-Profile-" + parameter["mode"] + "-" + get_configuration["access_point"][0]["mode"]
|
||||
}
|
||||
try:
|
||||
instantiate_profile.delete_profile_by_name(profile_name=rf_profile_data["name"])
|
||||
rf_profile_data = instantiate_profile.set_rf_profile(profile_data=rf_profile_data,
|
||||
mode=get_configuration["access_point"][0]["mode"])
|
||||
allure.attach(body=str(rf_profile_data),
|
||||
name="RF Profile Created : " + get_configuration["access_point"][0]["mode"])
|
||||
except Exception as e:
|
||||
print(e)
|
||||
allure.attach(body=str(e), name="Exception ")
|
||||
|
||||
# Radius Profile Creation
|
||||
passpoint_radius_server_info = passpoint_radius_server_info
|
||||
passpoint_radius_server_info["name"] = testbed + "-Automation-Radius-Profile"
|
||||
instantiate_profile.delete_profile_by_name(profile_name=testbed + "-Automation-Radius-Profile")
|
||||
try:
|
||||
instantiate_profile.create_radius_profile(radius_info=passpoint_radius_server_info,
|
||||
radius_accounting_info=passpoint_radius_accounting_server_info)
|
||||
test_cases["radius_profile"] = True
|
||||
allure.attach(body=str(passpoint_radius_server_info), name="Radius Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["radius_profile"] = False
|
||||
|
||||
# SSID Profile Creation
|
||||
for mode in profile_data["ssid"]:
|
||||
if mode == "open":
|
||||
for j in profile_data["ssid"][mode]:
|
||||
try:
|
||||
if "is2dot4GHz" in list(j["appliedRadios"]):
|
||||
creates_profile = instantiate_profile.create_open_ssid_profile(profile_data=j)
|
||||
test_cases[j["ssid_name"]] = {"sdk": True}
|
||||
allure.attach(body=str(creates_profile), name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases[j["ssid_name"]] = {"sdk": False}
|
||||
allure.attach(body=str(e), name="SSID Profile Creation Failed")
|
||||
if mode == "wpa_eap":
|
||||
for j in profile_data["ssid"][mode]:
|
||||
if mode in get_markers.keys() and get_markers[mode]:
|
||||
try:
|
||||
if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
creates_profile = instantiate_profile.create_wpa_eap_passpoint_ssid_profile(profile_data=j)
|
||||
profile_data["allowed_ssids"].append(creates_profile._id)
|
||||
test_cases[j["ssid_name"]] = {"sdk": True}
|
||||
allure.attach(body=str(creates_profile), name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases[j["ssid_name"]] = {"sdk": False}
|
||||
allure.attach(body=str(e), name="SSID Profile Creation Failed")
|
||||
try:
|
||||
if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
creates_profile = instantiate_profile.create_wpa_eap_passpoint_ssid_profile(profile_data=j)
|
||||
profile_data["allowed_ssids"].append(creates_profile._id)
|
||||
test_cases[j["ssid_name"]] = {"sdk": True}
|
||||
allure.attach(body=str(creates_profile), name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases[j["wpa_eap_5g"]] = {"sdk": False}
|
||||
allure.attach(body=str(e), name="SSID Profile Creation Failed")
|
||||
if mode == "wpa2_eap":
|
||||
for j in profile_data["ssid"][mode]:
|
||||
if mode in get_markers.keys() and get_markers[mode]:
|
||||
try:
|
||||
if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
creates_profile = instantiate_profile.create_wpa2_eap_passpoint_ssid_profile(profile_data=j)
|
||||
profile_data["allowed_ssids"].append(creates_profile._id)
|
||||
test_cases[j["ssid_name"]] = {"sdk": True}
|
||||
allure.attach(body=str(creates_profile), name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases[j["ssid_name"]] = {"sdk": False}
|
||||
allure.attach(body=str(e), name="SSID Profile Creation Failed")
|
||||
try:
|
||||
if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
creates_profile = instantiate_profile.create_wpa2_eap_passpoint_ssid_profile(profile_data=j)
|
||||
profile_data["allowed_ssids"].append(creates_profile._id)
|
||||
test_cases[j["ssid_name"]] = {"sdk": True}
|
||||
allure.attach(body=str(creates_profile), name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases[j["ssid_name"]] = {"sdk": False}
|
||||
allure.attach(body=str(e), name="SSID Profile Creation Failed")
|
||||
if mode == "wpa2_only_eap":
|
||||
for j in profile_data["ssid"][mode]:
|
||||
if mode in get_markers.keys() and get_markers[mode]:
|
||||
try:
|
||||
if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
creates_profile = instantiate_profile.create_wpa2_only_eap_passpoint_ssid_profile(
|
||||
profile_data=j)
|
||||
profile_data["allowed_ssids"].append(creates_profile._id)
|
||||
test_cases[j["ssid_name"]] = {"sdk": True}
|
||||
allure.attach(body=str(creates_profile), name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases[j["ssid_name"]] = {"sdk": False}
|
||||
allure.attach(body=str(e), name="SSID Profile Creation Failed")
|
||||
try:
|
||||
if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
creates_profile = instantiate_profile.create_wpa2_only_eap_passpoint_ssid_profile(
|
||||
profile_data=j)
|
||||
profile_data["allowed_ssids"].append(creates_profile._id)
|
||||
test_cases[j["ssid_name"]] = {"sdk": True}
|
||||
allure.attach(body=str(creates_profile), name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases[j["ssid_name"]] = {"sdk": False}
|
||||
allure.attach(body=str(e), name="SSID Profile Creation Failed")
|
||||
|
||||
# Passpoint OSU ID provider profile creation
|
||||
passpoint_provider_info = passpoint_provider_info
|
||||
test_cases["passpoint_osu_id_provider"] = dict()
|
||||
profile_name = testbed + "-Automation-Passpoint-OSU-ID-Provider-Profile"
|
||||
passpoint_provider_info["profile_name"] = profile_name
|
||||
instantiate_profile.delete_profile_by_name(profile_name=profile_name)
|
||||
try:
|
||||
creates_profile = instantiate_profile.create_passpoint_osu_id_provider_profile(
|
||||
profile_data=passpoint_provider_info)
|
||||
allure.attach(body=str(creates_profile), name="Passpoint OSU ID provider Profile Created")
|
||||
test_cases["passpoint_osu_id_provider"] = {"sdk": True}
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["passpoint_osu_id_provider"] = {"sdk": False}
|
||||
allure.attach(body=str(e), name="Passpoint OSU ID provider Profile Creation Failed")
|
||||
|
||||
# Passpoint operator profile creation
|
||||
test_cases["passpoint_operator_profile"] = dict()
|
||||
passpoint_operator_info = passpoint_operator_info
|
||||
profile_name = testbed + "-Automation-Passpoint-Operator-Profile"
|
||||
passpoint_operator_info["profile_name"] = profile_name
|
||||
instantiate_profile.delete_profile_by_name(profile_name=profile_name)
|
||||
try:
|
||||
creates_profile = instantiate_profile.create_passpoint_operator_profile(profile_data=passpoint_operator_info)
|
||||
allure.attach(body=str(creates_profile), name="Passpoint Operator Profile Created")
|
||||
test_cases["passpoint_operator_profile"] = {"sdk": True}
|
||||
profile_data["passpoint_operator"] = profile_name
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["passpoint_operator_profile"] = {"sdk": False}
|
||||
allure.attach(body=str(e), name="Passpoint Operator Profile Creation Failed")
|
||||
|
||||
# Passpoint Venue profile creation
|
||||
passpoint_venue_info = passpoint_venue_info
|
||||
test_cases["passpoint_venue_profile"] = dict()
|
||||
profile_name = testbed + "-Automation-Passpoint-Venue-Profile"
|
||||
passpoint_venue_info["profile_name"] = profile_name
|
||||
instantiate_profile.delete_profile_by_name(profile_name=profile_name)
|
||||
try:
|
||||
creates_profile = instantiate_profile.create_passpoint_venue_profile(profile_data=passpoint_venue_info)
|
||||
allure.attach(body=str(creates_profile), name="Passpoint Venue Profile Created")
|
||||
test_cases["passpoint_venue_profile"] = {"sdk": True}
|
||||
profile_data["passpoint_venue"] = profile_name
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["passpoint_venue"] = {"sdk": False}
|
||||
allure.attach(body=str(e), name="Passpoint Venue Profile Creation Failed")
|
||||
|
||||
# Passpoint profile creation
|
||||
passpoint_profile_info = passpoint_profile_info
|
||||
profile_name = testbed + "-Automation-Passpoint-Profile"
|
||||
passpoint_profile_info["profile_name"] = profile_name
|
||||
passpoint_profile_info["allowed_ssids"] = profile_data["allowed_ssids"]
|
||||
instantiate_profile.delete_profile_by_name(profile_name=profile_name)
|
||||
try:
|
||||
creates_profile = instantiate_profile.create_passpoint_profile(profile_data=passpoint_profile_info)
|
||||
allure.attach(body=str(creates_profile), name="Passpoint Profile Created")
|
||||
test_cases["passpoint"] = {"sdk": True}
|
||||
profile_data["passpoint"] = profile_name
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["passpoint"] = {"sdk": False}
|
||||
allure.attach(body=str(e), name="Passpoint Profile Creation Failed")
|
||||
|
||||
# Update SSID profile with passpoint config
|
||||
passpoint_profile_info = passpoint_profile_info
|
||||
ssid_to_apply = None
|
||||
for ssid_profile in profile_data["ssid"].keys():
|
||||
for ssid in profile_data["ssid"][ssid_profile]:
|
||||
if ssid["ssid_name"] == "passpoint_profile_download":
|
||||
ssid_to_apply = ssid["ssid_name"]
|
||||
continue
|
||||
if ssid["ssid_name"] in test_cases.keys():
|
||||
allure.attach(body=str(ssid), name="Updating SSID profile")
|
||||
passpoint_profile_info["ssid_profile_name"] = ssid["profile_name"]
|
||||
instantiate_profile.update_ssid_profile(profile_info=passpoint_profile_info)
|
||||
|
||||
# Equipment AP Profile Creation
|
||||
ap_profile_info = dict()
|
||||
ap_profile_info["profile_name"] = profile_data["equipment_ap"]["profile_name"]
|
||||
ap_profile_info["ssid_names"] = [ssid_to_apply]
|
||||
try:
|
||||
instantiate_profile.set_ap_profile_custom(profile_data=ap_profile_info)
|
||||
test_cases["equipment_ap"] = {"sdk": True}
|
||||
allure.attach(body=str(profile_data["equipment_ap"]), name="Equipment AP Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["equipment_ap"] = {"sdk": False}
|
||||
allure.attach(body=str(e), name="Equipment AP Profile Creation Failed")
|
||||
|
||||
|
||||
def teardown_session():
|
||||
print("\nRemoving Profiles")
|
||||
instantiate_profile.delete_profile_by_name(profile_name=profile_data['equipment_ap']['profile_name'])
|
||||
instantiate_profile.delete_profile(instantiate_profile.profile_creation_ids["ssid"])
|
||||
instantiate_profile.delete_profile(instantiate_profile.profile_creation_ids["radius"])
|
||||
instantiate_profile.delete_profile(instantiate_profile.profile_creation_ids["rf"])
|
||||
instantiate_profile.delete_profile(instantiate_profile.profile_creation_ids["passpoint_osu_id_provider"])
|
||||
instantiate_profile.delete_profile(instantiate_profile.profile_creation_ids["passpoint_operator"])
|
||||
instantiate_profile.delete_profile(instantiate_profile.profile_creation_ids["passpoint_venue"])
|
||||
instantiate_profile.delete_profile(instantiate_profile.profile_creation_ids["passpoint"])
|
||||
allure.attach(body=str(profile_data['equipment_ap']['profile_name'] + "\n"),
|
||||
name="Tear Down in Profiles ")
|
||||
time.sleep(20)
|
||||
|
||||
request.addfinalizer(teardown_session)
|
||||
yield test_cases, instantiate_profile, profile_data
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def push_ap_profile(request, setup_profiles, get_equipment_id, get_apnos, get_configuration):
|
||||
parameter = dict(request.param)
|
||||
test_cases, instantiate_profile, profile_data = setup_profiles
|
||||
ssid_names = parameter["ssid_names"]
|
||||
ap_profile_info = dict()
|
||||
ap_profile_info["profile_name"] = profile_data["equipment_ap"]["profile_name"]
|
||||
test_cases = {}
|
||||
ap_profile_info["ssid_names"] = ssid_names
|
||||
try:
|
||||
instantiate_profile.update_ap_profile(profile_data=ap_profile_info)
|
||||
test_cases["equipment_ap"] = {"sdk": True}
|
||||
allure.attach(body=str(ap_profile_info["profile_name"]), name="Equipment AP Profile Updated")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["equipment_ap"] = {"sdk": False}
|
||||
allure.attach(body=str(e), name="Equipment AP Profile Update Failed")
|
||||
|
||||
print("Pushing profiles on AP :: ", ap_profile_info)
|
||||
allure.attach(body=str(ap_profile_info), name="Pushing profiles on AP :: ")
|
||||
# Push the Equipment AP Profile to AP
|
||||
try:
|
||||
for i in get_equipment_id:
|
||||
instantiate_profile.push_profile_old_method(equipment_id=i)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
print("failed to push AP Profile")
|
||||
|
||||
# Check the VIF Config and VIF State of SSIDs
|
||||
time_start = time.time()
|
||||
ap_ssh = get_apnos(get_configuration["access_point"][0], pwd="../libs/apnos/")
|
||||
while time.time() - time_start < 240:
|
||||
if ((time.time() - time_start) / 10) == 15:
|
||||
ap_ssh = get_apnos(get_configuration["access_point"][0], pwd="../libs/apnos/")
|
||||
vif_config = list(ap_ssh.get_vif_config_ssids())
|
||||
vif_config.sort()
|
||||
vif_state = list(ap_ssh.get_vif_state_ssids())
|
||||
vif_state.sort()
|
||||
for ssid in ssid_names:
|
||||
test_cases[ssid] = dict()
|
||||
test_cases[ssid]["vif_config"] = True if ssid in vif_config else False
|
||||
test_cases[ssid]["vif_state"] = True if ssid in vif_state else False
|
||||
ssid_names.sort()
|
||||
if vif_config == ssid_names == vif_state:
|
||||
print("Waiting for Radios to apply config ")
|
||||
time.sleep(200)
|
||||
break
|
||||
time.sleep(10)
|
||||
allure.attach(body=str(vif_config), name="vifC status on AP :: ")
|
||||
allure.attach(body=str(vif_state), name="vifS status on AP :: ")
|
||||
|
||||
yield test_cases
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def passpoint_radius_server_info():
|
||||
allure.attach(body=str(PASSPOINT_RADIUS_SERVER_DATA), name="Passpoint RADIUS server Info: ")
|
||||
yield PASSPOINT_RADIUS_SERVER_DATA
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def passpoint_radius_accounting_server_info():
|
||||
allure.attach(body=str(PASSPOINT_RADIUS_ACCOUNTING_SERVER_DATA), name="Passpoint RADIUS account server Info: ")
|
||||
yield PASSPOINT_RADIUS_ACCOUNTING_SERVER_DATA
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def passpoint_provider_info():
|
||||
allure.attach(body=str(PASSPOINT_PROVIDER_INFO), name="Passpoint Provider Info: ")
|
||||
yield PASSPOINT_PROVIDER_INFO
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def passpoint_operator_info():
|
||||
allure.attach(body=str(PASSPOINT_OPERATOR_INFO), name="Passpoint operator Info: ")
|
||||
yield PASSPOINT_OPERATOR_INFO
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def passpoint_venue_info():
|
||||
allure.attach(body=str(PASSPOINT_VENUE_INFO), name="Passpoint venue Info: ")
|
||||
yield PASSPOINT_VENUE_INFO
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def passpoint_profile_info():
|
||||
allure.attach(body=str(PASSPOINT_PROFILE_INFO), name="Passpoint profile Info: ")
|
||||
yield PASSPOINT_PROFILE_INFO
|
||||
@@ -1,167 +0,0 @@
|
||||
from logging import exception
|
||||
import unittest
|
||||
import warnings
|
||||
from perfecto.test import TestResultFactory
|
||||
import pytest
|
||||
import sys
|
||||
import time
|
||||
from selenium.common.exceptions import NoSuchElementException
|
||||
from selenium.webdriver.common.by import By
|
||||
from appium import webdriver
|
||||
from selenium.common.exceptions import NoSuchElementException
|
||||
|
||||
import sys
|
||||
import allure
|
||||
|
||||
if 'perfecto_libs' not in sys.path:
|
||||
sys.path.append(f'../libs/perfecto_libs')
|
||||
|
||||
from iOS_lib import closeApp, openApp, ForgetAllWifiConnection, deleteOpenRoamingInstalledProfile, verifyUploadDownloadSpeediOS, downloadInstallOpenRoamingProfile, ForgetWifiConnection, Toggle_AirplaneMode_iOS, set_APconnMobileDevice_iOS, verify_APconnMobileDevice_iOS, Toggle_WifiMode_iOS, tearDown
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "NAT",
|
||||
"ssid_modes": {
|
||||
"wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],"security_key": "something"}],
|
||||
"wpa2_personal": [
|
||||
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],"security_key": "something"}]},
|
||||
"rf": {},
|
||||
"radius": False
|
||||
}
|
||||
|
||||
@pytest.mark.OpenRoaming
|
||||
#@pytest.mark.interop_iOS
|
||||
@allure.feature("NAT MODE CLIENT CONNECTIVITY")
|
||||
|
||||
#@pytest.mark.parametrize(
|
||||
# 'setup_profiles',
|
||||
# [setup_params_general],
|
||||
# indirect=True,
|
||||
# scope="class"
|
||||
#)
|
||||
#@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestOpenRoaming(object):
|
||||
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa2_personal
|
||||
def test_OpenRoaming_5g_WPA2_Personal(self, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
|
||||
|
||||
#profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
|
||||
#ssidName = profile_data["ssid_name"]
|
||||
#ssidPassword = profile_data["security_key"]
|
||||
|
||||
ssidName = "ssid-passpoint-osu"
|
||||
ssidPassword = "something"
|
||||
print ("SSID_NAME: " + ssidName)
|
||||
print ("SSID_PASS: " + ssidPassword)
|
||||
|
||||
report = setup_perfectoMobile_iOS[1]
|
||||
driver = setup_perfectoMobile_iOS[0]
|
||||
connData = get_APToMobileDevice_data
|
||||
|
||||
ssidName = "ssid-passpoint-osu"
|
||||
ssidPassword = "something"
|
||||
|
||||
ForgetAllWifiConnection(request, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Delete Profile Under Settings
|
||||
#deleteOpenRoamingInstalledProfile(request, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
|
||||
#Set Wifi/AP Mode
|
||||
set_APconnMobileDevice_iOS(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Install Profile
|
||||
downloadInstallOpenRoamingProfile(request, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#ForgetWifi Original
|
||||
ForgetWifiConnection(request, setup_perfectoMobile_iOS, ssidName, connData)
|
||||
|
||||
#print ("OpenRoaming Profile Connected WifiName: " + OpenRoamingWifiName)
|
||||
|
||||
#assert verify_APconnMobileDevice_iOS(request, ssidName, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Verify Upload download Speed from device Selection
|
||||
#verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Delete Profile Under Settings
|
||||
#deleteOpenRoamingInstalledProfile(request, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
|
||||
|
||||
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa2_personal
|
||||
def test_OpenRoaming_2g_WPA2_Personal(self, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
ssidPassword = profile_data["security_key"]
|
||||
print ("SSID_NAME: " + ssidName)
|
||||
print ("SSID_PASS: " + ssidPassword)
|
||||
|
||||
report = setup_perfectoMobile_iOS[1]
|
||||
driver = setup_perfectoMobile_iOS[0]
|
||||
connData = get_APToMobileDevice_data
|
||||
|
||||
#Set Wifi/AP Mode
|
||||
set_APconnMobileDevice_iOS(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Install Profile
|
||||
downloadInstallOpenRoamingProfile(request, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Verify Upload download Speed from device Selection
|
||||
verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#ForgetWifi
|
||||
ForgetWifiConnection(request, setup_perfectoMobile_iOS, ssidName, connData)
|
||||
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa
|
||||
def test_OpenRoaming_2g_WPA(self, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
ssidPassword = profile_data["security_key"]
|
||||
print ("SSID_NAME: " + ssidName)
|
||||
print ("SSID_PASS: " + ssidPassword)
|
||||
|
||||
report = setup_perfectoMobile_iOS[1]
|
||||
driver = setup_perfectoMobile_iOS[0]
|
||||
connData = get_APToMobileDevice_data
|
||||
|
||||
#Set Wifi/AP Mode
|
||||
set_APconnMobileDevice_iOS(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Verify Upload download Speed from device Selection
|
||||
verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#ForgetWifi
|
||||
ForgetWifiConnection(request, setup_perfectoMobile_iOS, ssidName, connData)
|
||||
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa
|
||||
def test_OpenRoaming_5g_WPA(self, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa"][1]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
ssidPassword = profile_data["security_key"]
|
||||
print ("SSID_NAME: " + ssidName)
|
||||
print ("SSID_PASS: " + ssidPassword)
|
||||
|
||||
report = setup_perfectoMobile_iOS[1]
|
||||
driver = setup_perfectoMobile_iOS[0]
|
||||
connData = get_APToMobileDevice_data
|
||||
|
||||
#Set Wifi/AP Mode
|
||||
set_APconnMobileDevice_iOS(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Verify Upload download Speed from device Selection
|
||||
verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#ForgetWifi
|
||||
ForgetWifiConnection(request, setup_perfectoMobile_iOS, ssidName, connData)
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,317 @@
|
||||
"""
|
||||
EAP Passpoint BRIDGE Mode
|
||||
Run wpa2_eap & Run wpa2_only_eap:
|
||||
pytest -m "OpenRoaming and interop_ios and fiveg and wpa2_eap and bridge" -s -vvv --testbed interop --skip-upgrade
|
||||
pytest -m "OpenRoaming and interop_ios and twog and wpa2_eap and bridge" -s -vvv --testbed interop --skip-upgrade
|
||||
pytest -m "OpenRoaming and interop_ios and fiveg and wpa2_only_eap and bridge" -s -vvv --testbed interop --skip-upgrade
|
||||
pytest -m "OpenRoaming and interop_ios and twog and wpa2_only_eap and bridge" -s -vvv --testbed interop --skip-upgrade
|
||||
Run all:
|
||||
pytest -m "openRoaming and interop_ios and bridge" -s -vvv --testbed interop --skip-upgrade --skip-testrail --collect-only
|
||||
"""
|
||||
|
||||
from logging import exception
|
||||
import unittest
|
||||
import warnings
|
||||
from perfecto.test import TestResultFactory
|
||||
import pytest
|
||||
import sys
|
||||
import time
|
||||
from selenium.common.exceptions import NoSuchElementException
|
||||
from selenium.webdriver.common.by import By
|
||||
from appium import webdriver
|
||||
from selenium.common.exceptions import NoSuchElementException
|
||||
|
||||
import sys
|
||||
import allure
|
||||
|
||||
if 'perfecto_libs' not in sys.path:
|
||||
sys.path.append(f'../libs/perfecto_libs')
|
||||
|
||||
pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.interop_ios, pytest.mark.ios, pytest.mark.openRoaming, pytest.mark.bridge]
|
||||
|
||||
from iOS_lib import closeApp, openApp, ForgetProfileWifiConnection, deleteOpenRoamingInstalledProfile, verifyUploadDownloadSpeediOS, downloadInstallOpenRoamingProfile, ForgetWifiConnection, Toggle_AirplaneMode_iOS, set_APconnMobileDevice_iOS, verify_APconnMobileDevice_iOS, Toggle_WifiMode_iOS, tearDown
|
||||
|
||||
setup_params_eap = {
|
||||
"mode": "BRIDGE",
|
||||
"ssid_modes": {
|
||||
"open": [
|
||||
{"ssid_name": "passpoint_profile_download", "appliedRadios": ["is2dot4GHz"]}
|
||||
],
|
||||
"wpa2_eap": [
|
||||
{"ssid_name": "ssid_wpa2_eap_passpoint_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa2_eap_passpoint_5g", "appliedRadios": ["is5GHz"]}
|
||||
],
|
||||
"wpa2_only_eap": [
|
||||
{"ssid_name": "ssid_wpa2_only_eap_passpoint_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa2_only_eap_passpoint_5g", "appliedRadios": ["is5GHz"]}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@allure.feature("BRIDGE MODE EAP PASSPOINT SETUP")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_eap],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestOpenRoamingBridge(object):
|
||||
|
||||
@pytest.mark.wpa2_eap
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.parametrize(
|
||||
'push_ap_profile',
|
||||
[{"ssid_names": ["ssid_wpa2_eap_passpoint_2g", "passpoint_profile_download"]}],
|
||||
indirect=True,
|
||||
scope="function"
|
||||
)
|
||||
@pytest.mark.usefixtures("push_ap_profile")
|
||||
def test_OpenRoaming_2g_WPA2_EAP_BRIDGE(self, passpoint_profile_info, push_ap_profile, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
|
||||
|
||||
result = push_ap_profile['ssid_wpa2_eap_passpoint_2g']['vif_config']
|
||||
if result:
|
||||
allure.attach(name="Config push to AP for ssid_wpa2_eap_passpoint_2g successful ", body="")
|
||||
else:
|
||||
allure.attach(name="Config push to AP for ssid_wpa2_eap_passpoint_2g failed", body="")
|
||||
assert result
|
||||
result = push_ap_profile['ssid_wpa2_eap_passpoint_2g']['vif_state']
|
||||
if result:
|
||||
allure.attach(name="Config apply to AP for ssid_wpa2_eap_passpoint_2g successful ", body="")
|
||||
else:
|
||||
allure.attach(name="Config apply to AP for ssid_wpa2_eap_passpoint_2g failed", body="")
|
||||
assert result
|
||||
|
||||
print("SSID to download profile :: ", setup_params_eap["ssid_modes"]["open"][0]["ssid_name"])
|
||||
print("SSID to validate connectivity :: ", setup_params_eap["ssid_modes"]["wpa2_eap"][0]["ssid_name"])
|
||||
print("Profile download URL :: ", passpoint_profile_info["profile_download_url_ios"])
|
||||
print("Profile name to remove :: ", passpoint_profile_info["profile_name_on_device"])
|
||||
|
||||
report = setup_perfectoMobile_iOS[1]
|
||||
driver = setup_perfectoMobile_iOS[0]
|
||||
connData = get_APToMobileDevice_data
|
||||
|
||||
downloadProfileSSID = setup_params_eap["ssid_modes"]["open"][0]["ssid_name"]
|
||||
downloadProfileSSIDPass = ""
|
||||
#profileDownloadURL = passpoint_profile_info["profile_download_url_ios"]
|
||||
profileDownloadURL = "https://onboard.almondlabs.net/ttls/AmeriBand-Profile.mobileconfig"
|
||||
profileName = passpoint_profile_info["profile_name_on_device"]
|
||||
profileNameSSID = setup_params_eap["ssid_modes"]["wpa2_eap"][1]["ssid_name"]
|
||||
|
||||
#Delete Profile Under Settings
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Set Wifi/AP Mode
|
||||
set_APconnMobileDevice_iOS(request, downloadProfileSSID, downloadProfileSSIDPass, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Install Profile
|
||||
downloadInstallOpenRoamingProfile(request, profileDownloadURL, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#ForgetWifi Original
|
||||
ForgetWifiConnection(request, setup_perfectoMobile_iOS, downloadProfileSSID, connData)
|
||||
|
||||
try:
|
||||
assert verify_APconnMobileDevice_iOS(request, profileNameSSID, setup_perfectoMobile_iOS, connData)
|
||||
#Verify Upload download Speed from device Selection
|
||||
verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
|
||||
except Exception as e:
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
|
||||
assert False
|
||||
|
||||
#Delete Profile Under Settings
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
@pytest.mark.wpa2_eap
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.parametrize(
|
||||
'push_ap_profile',
|
||||
[{"ssid_names": ["ssid_wpa2_eap_passpoint_5g", "passpoint_profile_download"]}],
|
||||
indirect=True,
|
||||
scope="function"
|
||||
)
|
||||
@pytest.mark.usefixtures("push_ap_profile")
|
||||
def test_OpenRoaming_5g_WPA2_EAP_BRIDGE(self, passpoint_profile_info, push_ap_profile, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
|
||||
|
||||
result = push_ap_profile['ssid_wpa2_eap_passpoint_5g']['vif_config']
|
||||
if result:
|
||||
allure.attach(name="Config push to AP for ssid_wpa2_eap_passpoint_5g successful ", body="")
|
||||
else:
|
||||
allure.attach(name="Config push to AP for ssid_wpa2_eap_passpoint_5g failed", body="")
|
||||
assert result
|
||||
result = push_ap_profile['ssid_wpa2_eap_passpoint_5g']['vif_state']
|
||||
if result:
|
||||
allure.attach(name="Config apply to AP for ssid_wpa2_eap_passpoint_5g successful ", body="")
|
||||
else:
|
||||
allure.attach(name="Config apply to AP for ssid_wpa2_eap_passpoint_5g failed", body="")
|
||||
assert result
|
||||
|
||||
print("SSID to download profile :: ", setup_params_eap["ssid_modes"]["open"][0]["ssid_name"])
|
||||
print("SSID to validate connectivity :: ", setup_params_eap["ssid_modes"]["wpa2_eap"][1]["ssid_name"])
|
||||
print("Profile download URL :: ", passpoint_profile_info["profile_download_url_ios"])
|
||||
print("Profile name to remove :: ", passpoint_profile_info["profile_name_on_device"])
|
||||
|
||||
report = setup_perfectoMobile_iOS[1]
|
||||
driver = setup_perfectoMobile_iOS[0]
|
||||
connData = get_APToMobileDevice_data
|
||||
|
||||
downloadProfileSSID = setup_params_eap["ssid_modes"]["open"][0]["ssid_name"]
|
||||
downloadProfileSSIDPass = ""
|
||||
#profileDownloadURL = passpoint_profile_info["profile_download_url_ios"]
|
||||
profileDownloadURL = "https://onboard.almondlabs.net/ttls/AmeriBand-Profile.mobileconfig"
|
||||
profileName = passpoint_profile_info["profile_name_on_device"]
|
||||
profileNameSSID = setup_params_eap["ssid_modes"]["wpa2_eap"][1]["ssid_name"]
|
||||
|
||||
#Setting Perfecto ReportClient....
|
||||
#SSID to download profile :: passpoint_profile_download
|
||||
#SSID to validate connectivity :: ssid_wpa2_eap_passpoint_5g
|
||||
#Profile download URL :: https://onboard.almondlabs.net/ios.html
|
||||
#Profile name to remove :: AmeriBand
|
||||
|
||||
#Delete Profile Under Settings
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Set Wifi/AP Mode
|
||||
set_APconnMobileDevice_iOS(request, downloadProfileSSID, downloadProfileSSIDPass, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Install Profile
|
||||
downloadInstallOpenRoamingProfile(request, profileDownloadURL, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#ForgetWifi Original
|
||||
ForgetWifiConnection(request, setup_perfectoMobile_iOS, downloadProfileSSID, connData)
|
||||
|
||||
try:
|
||||
assert verify_APconnMobileDevice_iOS(request, profileNameSSID, setup_perfectoMobile_iOS, connData)
|
||||
#Verify Upload download Speed from device Selection
|
||||
verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
|
||||
except Exception as e:
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
|
||||
assert False
|
||||
|
||||
#Delete Profile Under Settings
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
@pytest.mark.wpa2_only_eap
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.parametrize(
|
||||
'push_ap_profile',
|
||||
[{"ssid_names": ["ssid_wpa2_only_eap_passpoint_2g", "passpoint_profile_download"]}],
|
||||
indirect=True,
|
||||
scope="function"
|
||||
)
|
||||
@pytest.mark.usefixtures("push_ap_profile")
|
||||
def test_wpa2_only_eap_2g_BRIDGE(self, passpoint_profile_info, push_ap_profile, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
|
||||
|
||||
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_2g']['vif_config']
|
||||
if result:
|
||||
allure.attach(name="Config push to AP for ssid_wpa2_only_eap_passpoint_2g successful ", body="")
|
||||
else:
|
||||
allure.attach(name="Config push to AP for ssid_wpa2_only_eap_passpoint_2g failed", body="")
|
||||
assert result
|
||||
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_2g']['vif_state']
|
||||
if result:
|
||||
allure.attach(name="Config apply to AP for ssid_wpa2_only_eap_passpoint_2g successful ", body="")
|
||||
else:
|
||||
allure.attach(name="Config apply to AP for ssid_wpa2_only_eap_passpoint_2g failed", body="")
|
||||
assert result
|
||||
|
||||
print("SSID to download profile :: ", setup_params_eap["ssid_modes"]["open"][0]["ssid_name"])
|
||||
print("SSID to validate connectivity :: ", setup_params_eap["ssid_modes"]["wpa2_only_eap"][0]["ssid_name"])
|
||||
print("Profile download URL :: ", passpoint_profile_info["profile_download_url_ios"])
|
||||
print("Profile name to remove :: ", passpoint_profile_info["profile_name_on_device"])
|
||||
|
||||
report = setup_perfectoMobile_iOS[1]
|
||||
driver = setup_perfectoMobile_iOS[0]
|
||||
connData = get_APToMobileDevice_data
|
||||
|
||||
downloadProfileSSID = setup_params_eap["ssid_modes"]["open"][0]["ssid_name"]
|
||||
downloadProfileSSIDPass = ""
|
||||
#profileDownloadURL = passpoint_profile_info["profile_download_url_ios"]
|
||||
profileDownloadURL = "https://onboard.almondlabs.net/ttls/AmeriBand-Profile.mobileconfig"
|
||||
profileName = passpoint_profile_info["profile_name_on_device"]
|
||||
profileNameSSID = setup_params_eap["ssid_modes"]["wpa2_eap"][1]["ssid_name"]
|
||||
|
||||
#Delete Profile Under Settings
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Set Wifi/AP Mode
|
||||
set_APconnMobileDevice_iOS(request, downloadProfileSSID, downloadProfileSSIDPass, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Install Profile
|
||||
downloadInstallOpenRoamingProfile(request, profileDownloadURL, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#ForgetWifi Original
|
||||
ForgetWifiConnection(request, setup_perfectoMobile_iOS, downloadProfileSSID, connData)
|
||||
|
||||
try:
|
||||
assert verify_APconnMobileDevice_iOS(request, profileNameSSID, setup_perfectoMobile_iOS, connData)
|
||||
#Verify Upload download Speed from device Selection
|
||||
verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
|
||||
except Exception as e:
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
|
||||
assert False
|
||||
|
||||
#Delete Profile Under Settings
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
@pytest.mark.wpa2_only_eap
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.parametrize(
|
||||
'push_ap_profile',
|
||||
[{"ssid_names": ["ssid_wpa2_only_eap_passpoint_5g", "passpoint_profile_download"]}],
|
||||
indirect=True,
|
||||
scope="function"
|
||||
)
|
||||
@pytest.mark.usefixtures("push_ap_profile")
|
||||
def test_wpa2_only_eap_5g_BRIDGE(self, passpoint_profile_info, push_ap_profile, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
|
||||
|
||||
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_5g']['vif_config']
|
||||
if result:
|
||||
allure.attach(name="Config push to AP for ssid_wpa2_only_eap_passpoint_5g successful ", body="")
|
||||
else:
|
||||
allure.attach(name="Config push to AP for ssid_wpa2_only_eap_passpoint_5g failed", body="")
|
||||
assert result
|
||||
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_5g']['vif_state']
|
||||
if result:
|
||||
allure.attach(name="Config apply to AP for ssid_wpa2_only_eap_passpoint_5g successful ", body="")
|
||||
else:
|
||||
allure.attach(name="Config apply to AP for ssid_wpa2_only_eap_passpoint_5g failed", body="")
|
||||
assert result
|
||||
|
||||
print("SSID to download profile :: ", setup_params_eap["ssid_modes"]["open"][0]["ssid_name"])
|
||||
print("SSID to validate connectivity :: ", setup_params_eap["ssid_modes"]["wpa2_only_eap"][1]["ssid_name"])
|
||||
print("Profile download URL :: ", passpoint_profile_info["profile_download_url_ios"])
|
||||
print("Profile name to remove :: ", passpoint_profile_info["profile_name_on_device"])
|
||||
|
||||
report = setup_perfectoMobile_iOS[1]
|
||||
driver = setup_perfectoMobile_iOS[0]
|
||||
connData = get_APToMobileDevice_data
|
||||
|
||||
downloadProfileSSID = setup_params_eap["ssid_modes"]["open"][0]["ssid_name"]
|
||||
downloadProfileSSIDPass = ""
|
||||
#profileDownloadURL = passpoint_profile_info["profile_download_url_ios"]
|
||||
profileDownloadURL = "https://onboard.almondlabs.net/ttls/AmeriBand-Profile.mobileconfig"
|
||||
profileName = passpoint_profile_info["profile_name_on_device"]
|
||||
profileNameSSID = setup_params_eap["ssid_modes"]["wpa2_eap"][1]["ssid_name"]
|
||||
|
||||
#Delete Profile Under Settings
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Set Wifi/AP Mode
|
||||
set_APconnMobileDevice_iOS(request, downloadProfileSSID, downloadProfileSSIDPass, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Install Profile
|
||||
downloadInstallOpenRoamingProfile(request, profileDownloadURL, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#ForgetWifi Original
|
||||
ForgetWifiConnection(request, setup_perfectoMobile_iOS, downloadProfileSSID, connData)
|
||||
|
||||
try:
|
||||
assert verify_APconnMobileDevice_iOS(request, profileNameSSID, setup_perfectoMobile_iOS, connData)
|
||||
#Verify Upload download Speed from device Selection
|
||||
verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
|
||||
except Exception as e:
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
|
||||
assert False
|
||||
|
||||
#Delete Profile Under Settings
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
|
||||
@@ -0,0 +1,347 @@
|
||||
"""
|
||||
EAP Passpoint NAT Mode
|
||||
Run wpa2_eap:
|
||||
pytest -m "OpenRoaming and interop_ios and fiveg and wpa2_eap and nat" -s -vvv --testbed interop --skip-upgrade
|
||||
pytest -m "OpenRoaming and interop_ios and twog and wpa2_eap and nat" -s -vvv --testbed interop --skip-upgrade
|
||||
Run wpa2_only_eap:
|
||||
pytest -m "OpenRoaming and interop_ios and fiveg and wpa2_only_eap and nat" -s -vvv --testbed interop --skip-upgrade
|
||||
pytest -m "OpenRoaming and interop_ios and twog and wpa2_only_eap and nat" -s -vvv --testbed interop --skip-upgrade
|
||||
Run all:
|
||||
pytest -m "OpenRoaming and interop_ios and nat" -s -vvv --testbed interop --skip-upgrade
|
||||
"""
|
||||
|
||||
from logging import exception
|
||||
import unittest
|
||||
import warnings
|
||||
from perfecto.test import TestResultFactory
|
||||
import pytest
|
||||
import sys
|
||||
import time
|
||||
from selenium.common.exceptions import NoSuchElementException
|
||||
from selenium.webdriver.common.by import By
|
||||
from appium import webdriver
|
||||
from selenium.common.exceptions import NoSuchElementException
|
||||
|
||||
import sys
|
||||
import allure
|
||||
|
||||
if 'perfecto_libs' not in sys.path:
|
||||
sys.path.append(f'../libs/perfecto_libs')
|
||||
|
||||
pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.interop_ios, pytest.mark.ios, pytest.mark.openRoaming, pytest.mark.nat]
|
||||
|
||||
from iOS_lib import closeApp, openApp, ForgetProfileWifiConnection, deleteOpenRoamingInstalledProfile, verifyUploadDownloadSpeediOS, downloadInstallOpenRoamingProfile, ForgetWifiConnection, Toggle_AirplaneMode_iOS, set_APconnMobileDevice_iOS, verify_APconnMobileDevice_iOS, Toggle_WifiMode_iOS, tearDown
|
||||
|
||||
setup_params_eap = {
|
||||
"mode": "NAT",
|
||||
"ssid_modes": {
|
||||
"open": [
|
||||
{"ssid_name": "passpoint_profile_download", "appliedRadios": ["is2dot4GHz"]}
|
||||
],
|
||||
"wpa2_eap": [
|
||||
{"ssid_name": "ssid_wpa2_eap_passpoint_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa2_eap_passpoint_5g", "appliedRadios": ["is5GHz"]}
|
||||
],
|
||||
"wpa2_only_eap": [
|
||||
{"ssid_name": "ssid_wpa2_only_eap_passpoint_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa2_only_eap_passpoint_5g", "appliedRadios": ["is5GHz"]}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@allure.feature("NAT MODE EAP PASSPOINT SETUP")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_eap],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestOpenRoamingNAT(object):
|
||||
|
||||
@pytest.mark.wpa2_eap
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.parametrize(
|
||||
'push_ap_profile',
|
||||
[{"ssid_names": ["ssid_wpa2_eap_passpoint_2g", "passpoint_profile_download"]}],
|
||||
indirect=True,
|
||||
scope="function"
|
||||
)
|
||||
@pytest.mark.usefixtures("push_ap_profile")
|
||||
def test_OpenRoaming_2g_WPA2_EAP_NAT(self, passpoint_profile_info, push_ap_profile, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
|
||||
|
||||
result = push_ap_profile['ssid_wpa2_eap_passpoint_2g']['vif_config']
|
||||
if result:
|
||||
allure.attach(name="Config push to AP for ssid_wpa2_eap_passpoint_2g successful ", body="")
|
||||
else:
|
||||
allure.attach(name="Config push to AP for ssid_wpa2_eap_passpoint_2g failed", body="")
|
||||
assert result
|
||||
result = push_ap_profile['ssid_wpa2_eap_passpoint_2g']['vif_state']
|
||||
if result:
|
||||
allure.attach(name="Config apply to AP for ssid_wpa2_eap_passpoint_2g successful ", body="")
|
||||
else:
|
||||
allure.attach(name="Config apply to AP for ssid_wpa2_eap_passpoint_2g failed", body="")
|
||||
assert result
|
||||
|
||||
print("SSID to download profile :: ", setup_params_eap["ssid_modes"]["open"][0]["ssid_name"])
|
||||
print("SSID to validate connectivity :: ", setup_params_eap["ssid_modes"]["wpa2_eap"][0]["ssid_name"])
|
||||
print("Profile download URL :: ", passpoint_profile_info["profile_download_url_ios"])
|
||||
print("Profile name to remove :: ", passpoint_profile_info["profile_name_on_device"])
|
||||
|
||||
report = setup_perfectoMobile_iOS[1]
|
||||
driver = setup_perfectoMobile_iOS[0]
|
||||
connData = get_APToMobileDevice_data
|
||||
|
||||
downloadProfileSSID = setup_params_eap["ssid_modes"]["open"][0]["ssid_name"]
|
||||
downloadProfileSSIDPass = ""
|
||||
#profileDownloadURL = passpoint_profile_info["profile_download_url_ios"]
|
||||
profileDownloadURL = "https://onboard.almondlabs.net/ttls/AmeriBand-Profile.mobileconfig"
|
||||
profileName = passpoint_profile_info["profile_name_on_device"]
|
||||
profileNameSSID = setup_params_eap["ssid_modes"]["wpa2_eap"][1]["ssid_name"]
|
||||
|
||||
#Setting Perfecto ReportClient....
|
||||
#SSID to download profile :: passpoint_profile_download
|
||||
#SSID to validate connectivity :: ssid_wpa2_eap_passpoint_5g
|
||||
#Profile download URL :: https://onboard.almondlabs.net/ios.html
|
||||
#Profile name to remove :: AmeriBand
|
||||
|
||||
#Delete Profile Under Settings
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Set Wifi/AP Mode
|
||||
set_APconnMobileDevice_iOS(request, downloadProfileSSID, downloadProfileSSIDPass, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Install Profile
|
||||
downloadInstallOpenRoamingProfile(request, profileDownloadURL, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#ForgetWifi Original
|
||||
ForgetWifiConnection(request, setup_perfectoMobile_iOS, downloadProfileSSID, connData)
|
||||
|
||||
try:
|
||||
assert verify_APconnMobileDevice_iOS(request, profileNameSSID, setup_perfectoMobile_iOS, connData)
|
||||
#Verify Upload download Speed from device Selection
|
||||
verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
|
||||
except Exception as e:
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
|
||||
assert False
|
||||
|
||||
#Delete Profile Under Settings
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
|
||||
@pytest.mark.wpa2_eap
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.parametrize(
|
||||
'push_ap_profile',
|
||||
[{"ssid_names": ["ssid_wpa2_eap_passpoint_5g", "passpoint_profile_download"]}],
|
||||
indirect=True,
|
||||
scope="function"
|
||||
)
|
||||
@pytest.mark.usefixtures("push_ap_profile")
|
||||
def test_OpenRoaming_5g_WPA2_EAP_NAT(self, passpoint_profile_info, push_ap_profile, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
|
||||
|
||||
result = push_ap_profile['ssid_wpa2_eap_passpoint_5g']['vif_config']
|
||||
if result:
|
||||
allure.attach(name="Config push to AP for ssid_wpa2_eap_passpoint_5g successful ", body="")
|
||||
else:
|
||||
allure.attach(name="Config push to AP for ssid_wpa2_eap_passpoint_5g failed", body="")
|
||||
assert result
|
||||
result = push_ap_profile['ssid_wpa2_eap_passpoint_5g']['vif_state']
|
||||
if result:
|
||||
allure.attach(name="Config apply to AP for ssid_wpa2_eap_passpoint_5g successful ", body="")
|
||||
else:
|
||||
allure.attach(name="Config apply to AP for ssid_wpa2_eap_passpoint_5g failed", body="")
|
||||
assert result
|
||||
|
||||
print("SSID to download profile :: ", setup_params_eap["ssid_modes"]["open"][0]["ssid_name"])
|
||||
print("SSID to validate connectivity :: ", setup_params_eap["ssid_modes"]["wpa2_eap"][1]["ssid_name"])
|
||||
print("Profile download URL :: ", passpoint_profile_info["profile_download_url_ios"])
|
||||
print("Profile name to remove :: ", passpoint_profile_info["profile_name_on_device"])
|
||||
|
||||
report = setup_perfectoMobile_iOS[1]
|
||||
driver = setup_perfectoMobile_iOS[0]
|
||||
connData = get_APToMobileDevice_data
|
||||
|
||||
downloadProfileSSID = setup_params_eap["ssid_modes"]["open"][0]["ssid_name"]
|
||||
downloadProfileSSIDPass = ""
|
||||
#profileDownloadURL = passpoint_profile_info["profile_download_url_ios"]
|
||||
profileDownloadURL = "https://onboard.almondlabs.net/ttls/AmeriBand-Profile.mobileconfig"
|
||||
profileName = passpoint_profile_info["profile_name_on_device"]
|
||||
profileNameSSID = setup_params_eap["ssid_modes"]["wpa2_eap"][1]["ssid_name"]
|
||||
|
||||
#Setting Perfecto ReportClient....
|
||||
#SSID to download profile :: passpoint_profile_download
|
||||
#SSID to validate connectivity :: ssid_wpa2_eap_passpoint_5g
|
||||
#Profile download URL :: https://onboard.almondlabs.net/ios.html
|
||||
#Profile name to remove :: AmeriBand
|
||||
|
||||
#ForgetProfileWifiConnection(request, setup_perfectoMobile_iOS, profileNameSSID, connData)
|
||||
#Delete Profile Under Settings
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Set Wifi/AP Mode
|
||||
set_APconnMobileDevice_iOS(request, downloadProfileSSID, downloadProfileSSIDPass, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Install Profile
|
||||
downloadInstallOpenRoamingProfile(request, profileDownloadURL, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#ForgetWifi Original
|
||||
ForgetWifiConnection(request, setup_perfectoMobile_iOS, downloadProfileSSID, connData)
|
||||
|
||||
try:
|
||||
assert verify_APconnMobileDevice_iOS(request, profileNameSSID, setup_perfectoMobile_iOS, connData)
|
||||
#Verify Upload download Speed from device Selection
|
||||
verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
|
||||
except Exception as e:
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
|
||||
assert False
|
||||
|
||||
#Delete Profile Under Settings
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
|
||||
@pytest.mark.wpa2_only_eap
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.parametrize(
|
||||
'push_ap_profile',
|
||||
[{"ssid_names": ["ssid_wpa2_only_eap_passpoint_2g", "passpoint_profile_download"]}],
|
||||
indirect=True,
|
||||
scope="function"
|
||||
)
|
||||
@pytest.mark.usefixtures("push_ap_profile")
|
||||
def test_wpa2_only_eap_2g_NAT(self, passpoint_profile_info, push_ap_profile, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
|
||||
"""
|
||||
EAP Passpoint BRIDGE Mode
|
||||
pytest -m "interop_iOS and eap_passpoint and bridge and wpa2_only_eap and twog"
|
||||
"""
|
||||
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_2g']['vif_config']
|
||||
if result:
|
||||
allure.attach(name="Config push to AP for ssid_wpa2_only_eap_passpoint_2g successful ", body="")
|
||||
else:
|
||||
allure.attach(name="Config push to AP for ssid_wpa2_only_eap_passpoint_2g failed", body="")
|
||||
assert result
|
||||
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_2g']['vif_state']
|
||||
if result:
|
||||
allure.attach(name="Config apply to AP for ssid_wpa2_only_eap_passpoint_2g successful ", body="")
|
||||
else:
|
||||
allure.attach(name="Config apply to AP for ssid_wpa2_only_eap_passpoint_2g failed", body="")
|
||||
assert result
|
||||
|
||||
print("SSID to download profile :: ", setup_params_eap["ssid_modes"]["open"][0]["ssid_name"])
|
||||
print("SSID to validate connectivity :: ", setup_params_eap["ssid_modes"]["wpa2_only_eap"][0]["ssid_name"])
|
||||
print("Profile download URL :: ", passpoint_profile_info["profile_download_url_ios"])
|
||||
print("Profile name to remove :: ", passpoint_profile_info["profile_name_on_device"])
|
||||
|
||||
report = setup_perfectoMobile_iOS[1]
|
||||
driver = setup_perfectoMobile_iOS[0]
|
||||
connData = get_APToMobileDevice_data
|
||||
|
||||
downloadProfileSSID = setup_params_eap["ssid_modes"]["open"][0]["ssid_name"]
|
||||
downloadProfileSSIDPass = ""
|
||||
#profileDownloadURL = passpoint_profile_info["profile_download_url_ios"]
|
||||
profileDownloadURL = "https://onboard.almondlabs.net/ttls/AmeriBand-Profile.mobileconfig"
|
||||
profileName = passpoint_profile_info["profile_name_on_device"]
|
||||
profileNameSSID = setup_params_eap["ssid_modes"]["wpa2_eap"][1]["ssid_name"]
|
||||
|
||||
#Setting Perfecto ReportClient....
|
||||
#SSID to download profile :: passpoint_profile_download
|
||||
#SSID to validate connectivity :: ssid_wpa2_eap_passpoint_5g
|
||||
#Profile download URL :: https://onboard.almondlabs.net/ios.html
|
||||
#Profile name to remove :: AmeriBand
|
||||
|
||||
#Delete Profile Under Settings
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Set Wifi/AP Mode
|
||||
set_APconnMobileDevice_iOS(request, downloadProfileSSID, downloadProfileSSIDPass, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Install Profile
|
||||
downloadInstallOpenRoamingProfile(request, profileDownloadURL, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#ForgetWifi Original
|
||||
ForgetWifiConnection(request, setup_perfectoMobile_iOS, downloadProfileSSID, connData)
|
||||
|
||||
try:
|
||||
assert verify_APconnMobileDevice_iOS(request, profileNameSSID, setup_perfectoMobile_iOS, connData)
|
||||
#Verify Upload download Speed from device Selection
|
||||
verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
|
||||
except Exception as e:
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
|
||||
assert False
|
||||
|
||||
#Delete Profile Under Settings
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
|
||||
|
||||
@pytest.mark.wpa2_only_eap
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.parametrize(
|
||||
'push_ap_profile',
|
||||
[{"ssid_names": ["ssid_wpa2_only_eap_passpoint_5g", "passpoint_profile_download"]}],
|
||||
indirect=True,
|
||||
scope="function"
|
||||
)
|
||||
@pytest.mark.usefixtures("push_ap_profile")
|
||||
def test_wpa2_only_eap_5g_NAT(self, passpoint_profile_info, push_ap_profile, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
|
||||
"""
|
||||
EAP Passpoint BRIDGE Mode
|
||||
pytest -m "interop_iOS and eap_passpoint and bridge and wpa2_only_eap and fiveg"
|
||||
"""
|
||||
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_5g']['vif_config']
|
||||
if result:
|
||||
allure.attach(name="Config push to AP for ssid_wpa2_only_eap_passpoint_5g successful ", body="")
|
||||
else:
|
||||
allure.attach(name="Config push to AP for ssid_wpa2_only_eap_passpoint_5g failed", body="")
|
||||
assert result
|
||||
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_5g']['vif_state']
|
||||
if result:
|
||||
allure.attach(name="Config apply to AP for ssid_wpa2_only_eap_passpoint_5g successful ", body="")
|
||||
else:
|
||||
allure.attach(name="Config apply to AP for ssid_wpa2_only_eap_passpoint_5g failed", body="")
|
||||
assert result
|
||||
|
||||
print("SSID to download profile :: ", setup_params_eap["ssid_modes"]["open"][0]["ssid_name"])
|
||||
print("SSID to validate connectivity :: ", setup_params_eap["ssid_modes"]["wpa2_only_eap"][1]["ssid_name"])
|
||||
print("Profile download URL :: ", passpoint_profile_info["profile_download_url_ios"])
|
||||
print("Profile name to remove :: ", passpoint_profile_info["profile_name_on_device"])
|
||||
|
||||
report = setup_perfectoMobile_iOS[1]
|
||||
driver = setup_perfectoMobile_iOS[0]
|
||||
connData = get_APToMobileDevice_data
|
||||
|
||||
downloadProfileSSID = setup_params_eap["ssid_modes"]["open"][0]["ssid_name"]
|
||||
downloadProfileSSIDPass = ""
|
||||
#profileDownloadURL = passpoint_profile_info["profile_download_url_ios"]
|
||||
profileDownloadURL = "https://onboard.almondlabs.net/ttls/AmeriBand-Profile.mobileconfig"
|
||||
profileName = passpoint_profile_info["profile_name_on_device"]
|
||||
profileNameSSID = setup_params_eap["ssid_modes"]["wpa2_eap"][1]["ssid_name"]
|
||||
|
||||
#Setting Perfecto ReportClient....
|
||||
#SSID to download profile :: passpoint_profile_download
|
||||
#SSID to validate connectivity :: ssid_wpa2_eap_passpoint_5g
|
||||
#Profile download URL :: https://onboard.almondlabs.net/ios.html
|
||||
#Profile name to remove :: AmeriBand
|
||||
|
||||
#Delete Profile Under Settings
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Set Wifi/AP Mode
|
||||
set_APconnMobileDevice_iOS(request, downloadProfileSSID, downloadProfileSSIDPass, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Install Profile
|
||||
downloadInstallOpenRoamingProfile(request, profileDownloadURL, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#ForgetWifi Original
|
||||
ForgetWifiConnection(request, setup_perfectoMobile_iOS, downloadProfileSSID, connData)
|
||||
|
||||
try:
|
||||
assert verify_APconnMobileDevice_iOS(request, profileNameSSID, setup_perfectoMobile_iOS, connData)
|
||||
#Verify Upload download Speed from device Selection
|
||||
verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
|
||||
except Exception as e:
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
|
||||
assert False
|
||||
|
||||
#Delete Profile Under Settings
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
|
||||
@@ -0,0 +1,317 @@
|
||||
"""
|
||||
EAP Passpoint VLAN Mode
|
||||
Run wpa2_eap & Run wpa2_only_eap:
|
||||
pytest -m "OpenRoaming and interop_ios and fiveg and wpa2_eap and vlan" -s -vvv --testbed interop --skip-upgrade
|
||||
pytest -m "OpenRoaming and interop_ios and twog and wpa2_eap and vlan" -s -vvv --testbed interop --skip-upgrade
|
||||
pytest -m "OpenRoaming and interop_ios and fiveg and wpa2_only_eap and vlan" -s -vvv --testbed interop --skip-upgrade
|
||||
pytest -m "OpenRoaming and interop_ios and twog and wpa2_only_eap and vlan" -s -vvv --testbed interop --skip-upgrade
|
||||
Run all:
|
||||
pytest -m "openRoaming and interop_ios and vlan" -s -vvv --testbed interop --skip-upgrade --skip-testrail --collect-only
|
||||
"""
|
||||
|
||||
from logging import exception
|
||||
import unittest
|
||||
import warnings
|
||||
from perfecto.test import TestResultFactory
|
||||
import pytest
|
||||
import sys
|
||||
import time
|
||||
from selenium.common.exceptions import NoSuchElementException
|
||||
from selenium.webdriver.common.by import By
|
||||
from appium import webdriver
|
||||
from selenium.common.exceptions import NoSuchElementException
|
||||
|
||||
import sys
|
||||
import allure
|
||||
|
||||
if 'perfecto_libs' not in sys.path:
|
||||
sys.path.append(f'../libs/perfecto_libs')
|
||||
|
||||
pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.interop_ios, pytest.mark.ios, pytest.mark.openRoaming, pytest.mark.vlan]
|
||||
|
||||
from iOS_lib import closeApp, openApp, ForgetProfileWifiConnection, deleteOpenRoamingInstalledProfile, verifyUploadDownloadSpeediOS, downloadInstallOpenRoamingProfile, ForgetWifiConnection, Toggle_AirplaneMode_iOS, set_APconnMobileDevice_iOS, verify_APconnMobileDevice_iOS, Toggle_WifiMode_iOS, tearDown
|
||||
|
||||
setup_params_eap = {
|
||||
"mode": "VLAN",
|
||||
"ssid_modes": {
|
||||
"open": [
|
||||
{"ssid_name": "passpoint_profile_download", "appliedRadios": ["is2dot4GHz"]}
|
||||
],
|
||||
"wpa2_eap": [
|
||||
{"ssid_name": "ssid_wpa2_eap_passpoint_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa2_eap_passpoint_5g", "appliedRadios": ["is5GHz"]}
|
||||
],
|
||||
"wpa2_only_eap": [
|
||||
{"ssid_name": "ssid_wpa2_only_eap_passpoint_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa2_only_eap_passpoint_5g", "appliedRadios": ["is5GHz"]}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@allure.feature("VLAN MODE EAP PASSPOINT SETUP")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_eap],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestOpenRoamingBridgeVLAN(object):
|
||||
|
||||
@pytest.mark.wpa2_eap
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.parametrize(
|
||||
'push_ap_profile',
|
||||
[{"ssid_names": ["ssid_wpa2_eap_passpoint_2g", "passpoint_profile_download"]}],
|
||||
indirect=True,
|
||||
scope="function"
|
||||
)
|
||||
@pytest.mark.usefixtures("push_ap_profile")
|
||||
def test_OpenRoaming_2g_WPA2_EAP_VLAN(self, passpoint_profile_info, push_ap_profile, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
|
||||
|
||||
result = push_ap_profile['ssid_wpa2_eap_passpoint_2g']['vif_config']
|
||||
if result:
|
||||
allure.attach(name="Config push to AP for ssid_wpa2_eap_passpoint_2g successful ", body="")
|
||||
else:
|
||||
allure.attach(name="Config push to AP for ssid_wpa2_eap_passpoint_2g failed", body="")
|
||||
assert result
|
||||
result = push_ap_profile['ssid_wpa2_eap_passpoint_2g']['vif_state']
|
||||
if result:
|
||||
allure.attach(name="Config apply to AP for ssid_wpa2_eap_passpoint_2g successful ", body="")
|
||||
else:
|
||||
allure.attach(name="Config apply to AP for ssid_wpa2_eap_passpoint_2g failed", body="")
|
||||
assert result
|
||||
|
||||
print("SSID to download profile :: ", setup_params_eap["ssid_modes"]["open"][0]["ssid_name"])
|
||||
print("SSID to validate connectivity :: ", setup_params_eap["ssid_modes"]["wpa2_eap"][0]["ssid_name"])
|
||||
print("Profile download URL :: ", passpoint_profile_info["profile_download_url_ios"])
|
||||
print("Profile name to remove :: ", passpoint_profile_info["profile_name_on_device"])
|
||||
|
||||
report = setup_perfectoMobile_iOS[1]
|
||||
driver = setup_perfectoMobile_iOS[0]
|
||||
connData = get_APToMobileDevice_data
|
||||
|
||||
downloadProfileSSID = setup_params_eap["ssid_modes"]["open"][0]["ssid_name"]
|
||||
downloadProfileSSIDPass = ""
|
||||
#profileDownloadURL = passpoint_profile_info["profile_download_url_ios"]
|
||||
profileDownloadURL = "https://onboard.almondlabs.net/ttls/AmeriBand-Profile.mobileconfig"
|
||||
profileName = passpoint_profile_info["profile_name_on_device"]
|
||||
profileNameSSID = setup_params_eap["ssid_modes"]["wpa2_eap"][1]["ssid_name"]
|
||||
|
||||
#Delete Profile Under Settings
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Set Wifi/AP Mode
|
||||
set_APconnMobileDevice_iOS(request, downloadProfileSSID, downloadProfileSSIDPass, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Install Profile
|
||||
downloadInstallOpenRoamingProfile(request, profileDownloadURL, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#ForgetWifi Original
|
||||
ForgetWifiConnection(request, setup_perfectoMobile_iOS, downloadProfileSSID, connData)
|
||||
|
||||
try:
|
||||
assert verify_APconnMobileDevice_iOS(request, profileNameSSID, setup_perfectoMobile_iOS, connData)
|
||||
#Verify Upload download Speed from device Selection
|
||||
verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
|
||||
except Exception as e:
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
|
||||
assert False
|
||||
|
||||
#Delete Profile Under Settings
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
@pytest.mark.wpa2_eap
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.parametrize(
|
||||
'push_ap_profile',
|
||||
[{"ssid_names": ["ssid_wpa2_eap_passpoint_5g", "passpoint_profile_download"]}],
|
||||
indirect=True,
|
||||
scope="function"
|
||||
)
|
||||
@pytest.mark.usefixtures("push_ap_profile")
|
||||
def test_OpenRoaming_5g_WPA2_EAP_VLAN(self, passpoint_profile_info, push_ap_profile, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
|
||||
|
||||
result = push_ap_profile['ssid_wpa2_eap_passpoint_5g']['vif_config']
|
||||
if result:
|
||||
allure.attach(name="Config push to AP for ssid_wpa2_eap_passpoint_5g successful ", body="")
|
||||
else:
|
||||
allure.attach(name="Config push to AP for ssid_wpa2_eap_passpoint_5g failed", body="")
|
||||
assert result
|
||||
result = push_ap_profile['ssid_wpa2_eap_passpoint_5g']['vif_state']
|
||||
if result:
|
||||
allure.attach(name="Config apply to AP for ssid_wpa2_eap_passpoint_5g successful ", body="")
|
||||
else:
|
||||
allure.attach(name="Config apply to AP for ssid_wpa2_eap_passpoint_5g failed", body="")
|
||||
assert result
|
||||
|
||||
print("SSID to download profile :: ", setup_params_eap["ssid_modes"]["open"][0]["ssid_name"])
|
||||
print("SSID to validate connectivity :: ", setup_params_eap["ssid_modes"]["wpa2_eap"][1]["ssid_name"])
|
||||
print("Profile download URL :: ", passpoint_profile_info["profile_download_url_ios"])
|
||||
print("Profile name to remove :: ", passpoint_profile_info["profile_name_on_device"])
|
||||
|
||||
report = setup_perfectoMobile_iOS[1]
|
||||
driver = setup_perfectoMobile_iOS[0]
|
||||
connData = get_APToMobileDevice_data
|
||||
|
||||
downloadProfileSSID = setup_params_eap["ssid_modes"]["open"][0]["ssid_name"]
|
||||
downloadProfileSSIDPass = ""
|
||||
#profileDownloadURL = passpoint_profile_info["profile_download_url_ios"]
|
||||
profileDownloadURL = "https://onboard.almondlabs.net/ttls/AmeriBand-Profile.mobileconfig"
|
||||
profileName = passpoint_profile_info["profile_name_on_device"]
|
||||
profileNameSSID = setup_params_eap["ssid_modes"]["wpa2_eap"][1]["ssid_name"]
|
||||
|
||||
#Setting Perfecto ReportClient....
|
||||
#SSID to download profile :: passpoint_profile_download
|
||||
#SSID to validate connectivity :: ssid_wpa2_eap_passpoint_5g
|
||||
#Profile download URL :: https://onboard.almondlabs.net/ios.html
|
||||
#Profile name to remove :: AmeriBand
|
||||
|
||||
#Delete Profile Under Settings
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Set Wifi/AP Mode
|
||||
set_APconnMobileDevice_iOS(request, downloadProfileSSID, downloadProfileSSIDPass, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Install Profile
|
||||
downloadInstallOpenRoamingProfile(request, profileDownloadURL, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#ForgetWifi Original
|
||||
ForgetWifiConnection(request, setup_perfectoMobile_iOS, downloadProfileSSID, connData)
|
||||
|
||||
try:
|
||||
assert verify_APconnMobileDevice_iOS(request, profileNameSSID, setup_perfectoMobile_iOS, connData)
|
||||
#Verify Upload download Speed from device Selection
|
||||
verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
|
||||
except Exception as e:
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
|
||||
assert False
|
||||
|
||||
#Delete Profile Under Settings
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
@pytest.mark.wpa2_only_eap
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.parametrize(
|
||||
'push_ap_profile',
|
||||
[{"ssid_names": ["ssid_wpa2_only_eap_passpoint_2g", "passpoint_profile_download"]}],
|
||||
indirect=True,
|
||||
scope="function"
|
||||
)
|
||||
@pytest.mark.usefixtures("push_ap_profile")
|
||||
def test_wpa2_only_eap_2g_VLAN(self, passpoint_profile_info, push_ap_profile, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
|
||||
|
||||
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_2g']['vif_config']
|
||||
if result:
|
||||
allure.attach(name="Config push to AP for ssid_wpa2_only_eap_passpoint_2g successful ", body="")
|
||||
else:
|
||||
allure.attach(name="Config push to AP for ssid_wpa2_only_eap_passpoint_2g failed", body="")
|
||||
assert result
|
||||
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_2g']['vif_state']
|
||||
if result:
|
||||
allure.attach(name="Config apply to AP for ssid_wpa2_only_eap_passpoint_2g successful ", body="")
|
||||
else:
|
||||
allure.attach(name="Config apply to AP for ssid_wpa2_only_eap_passpoint_2g failed", body="")
|
||||
assert result
|
||||
|
||||
print("SSID to download profile :: ", setup_params_eap["ssid_modes"]["open"][0]["ssid_name"])
|
||||
print("SSID to validate connectivity :: ", setup_params_eap["ssid_modes"]["wpa2_only_eap"][0]["ssid_name"])
|
||||
print("Profile download URL :: ", passpoint_profile_info["profile_download_url_ios"])
|
||||
print("Profile name to remove :: ", passpoint_profile_info["profile_name_on_device"])
|
||||
|
||||
report = setup_perfectoMobile_iOS[1]
|
||||
driver = setup_perfectoMobile_iOS[0]
|
||||
connData = get_APToMobileDevice_data
|
||||
|
||||
downloadProfileSSID = setup_params_eap["ssid_modes"]["open"][0]["ssid_name"]
|
||||
downloadProfileSSIDPass = ""
|
||||
#profileDownloadURL = passpoint_profile_info["profile_download_url_ios"]
|
||||
profileDownloadURL = "https://onboard.almondlabs.net/ttls/AmeriBand-Profile.mobileconfig"
|
||||
profileName = passpoint_profile_info["profile_name_on_device"]
|
||||
profileNameSSID = setup_params_eap["ssid_modes"]["wpa2_eap"][1]["ssid_name"]
|
||||
|
||||
#Delete Profile Under Settings
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Set Wifi/AP Mode
|
||||
set_APconnMobileDevice_iOS(request, downloadProfileSSID, downloadProfileSSIDPass, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Install Profile
|
||||
downloadInstallOpenRoamingProfile(request, profileDownloadURL, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#ForgetWifi Original
|
||||
ForgetWifiConnection(request, setup_perfectoMobile_iOS, downloadProfileSSID, connData)
|
||||
|
||||
try:
|
||||
assert verify_APconnMobileDevice_iOS(request, profileNameSSID, setup_perfectoMobile_iOS, connData)
|
||||
#Verify Upload download Speed from device Selection
|
||||
verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
|
||||
except Exception as e:
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
|
||||
assert False
|
||||
|
||||
#Delete Profile Under Settings
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
@pytest.mark.wpa2_only_eap
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.parametrize(
|
||||
'push_ap_profile',
|
||||
[{"ssid_names": ["ssid_wpa2_only_eap_passpoint_5g", "passpoint_profile_download"]}],
|
||||
indirect=True,
|
||||
scope="function"
|
||||
)
|
||||
@pytest.mark.usefixtures("push_ap_profile")
|
||||
def test_wpa2_only_eap_5g_VLAN(self, passpoint_profile_info, push_ap_profile, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
|
||||
|
||||
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_5g']['vif_config']
|
||||
if result:
|
||||
allure.attach(name="Config push to AP for ssid_wpa2_only_eap_passpoint_5g successful ", body="")
|
||||
else:
|
||||
allure.attach(name="Config push to AP for ssid_wpa2_only_eap_passpoint_5g failed", body="")
|
||||
assert result
|
||||
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_5g']['vif_state']
|
||||
if result:
|
||||
allure.attach(name="Config apply to AP for ssid_wpa2_only_eap_passpoint_5g successful ", body="")
|
||||
else:
|
||||
allure.attach(name="Config apply to AP for ssid_wpa2_only_eap_passpoint_5g failed", body="")
|
||||
assert result
|
||||
|
||||
print("SSID to download profile :: ", setup_params_eap["ssid_modes"]["open"][0]["ssid_name"])
|
||||
print("SSID to validate connectivity :: ", setup_params_eap["ssid_modes"]["wpa2_only_eap"][1]["ssid_name"])
|
||||
print("Profile download URL :: ", passpoint_profile_info["profile_download_url_ios"])
|
||||
print("Profile name to remove :: ", passpoint_profile_info["profile_name_on_device"])
|
||||
|
||||
report = setup_perfectoMobile_iOS[1]
|
||||
driver = setup_perfectoMobile_iOS[0]
|
||||
connData = get_APToMobileDevice_data
|
||||
|
||||
downloadProfileSSID = setup_params_eap["ssid_modes"]["open"][0]["ssid_name"]
|
||||
downloadProfileSSIDPass = ""
|
||||
#profileDownloadURL = passpoint_profile_info["profile_download_url_ios"]
|
||||
profileDownloadURL = "https://onboard.almondlabs.net/ttls/AmeriBand-Profile.mobileconfig"
|
||||
profileName = passpoint_profile_info["profile_name_on_device"]
|
||||
profileNameSSID = setup_params_eap["ssid_modes"]["wpa2_eap"][1]["ssid_name"]
|
||||
|
||||
#Delete Profile Under Settings
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Set Wifi/AP Mode
|
||||
set_APconnMobileDevice_iOS(request, downloadProfileSSID, downloadProfileSSIDPass, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Install Profile
|
||||
downloadInstallOpenRoamingProfile(request, profileDownloadURL, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#ForgetWifi Original
|
||||
ForgetWifiConnection(request, setup_perfectoMobile_iOS, downloadProfileSSID, connData)
|
||||
|
||||
try:
|
||||
assert verify_APconnMobileDevice_iOS(request, profileNameSSID, setup_perfectoMobile_iOS, connData)
|
||||
#Verify Upload download Speed from device Selection
|
||||
verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
|
||||
except Exception as e:
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
|
||||
assert False
|
||||
|
||||
#Delete Profile Under Settings
|
||||
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
|
||||
@@ -14,6 +14,7 @@ from urllib3 import exceptions
|
||||
import sys
|
||||
import allure
|
||||
|
||||
pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.interop_ios, pytest.mark.ios, pytest.mark.PassPointConnection]
|
||||
|
||||
if 'perfecto_libs' not in sys.path:
|
||||
sys.path.append(f'../libs/perfecto_libs')
|
||||
@@ -32,8 +33,6 @@ setup_params_general = {
|
||||
"radius": False
|
||||
}
|
||||
|
||||
@pytest.mark.PassPointConnection
|
||||
@pytest.mark.interop_iOS
|
||||
@allure.feature("NAT MODE CLIENT CONNECTIVITY")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
|
||||
@@ -16,6 +16,8 @@ import allure
|
||||
if 'perfecto_libs' not in sys.path:
|
||||
sys.path.append(f'../libs/perfecto_libs')
|
||||
|
||||
pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.ios, pytest.mark.interop_ios, pytest.mark.ToggleWifiMode]
|
||||
|
||||
from iOS_lib import closeApp, openApp, Toggle_AirplaneMode_iOS, ForgetWifiConnection, set_APconnMobileDevice_iOS, verify_APconnMobileDevice_iOS, Toggle_WifiMode_iOS, tearDown
|
||||
|
||||
setup_params_general = {
|
||||
@@ -30,8 +32,6 @@ setup_params_general = {
|
||||
"radius": False
|
||||
}
|
||||
|
||||
@pytest.mark.ToggleWifiMode
|
||||
@pytest.mark.interop_iOS
|
||||
@allure.feature("NAT MODE CLIENT CONNECTIVITY")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
|
||||
@@ -16,6 +16,8 @@ import allure
|
||||
if 'perfecto_libs' not in sys.path:
|
||||
sys.path.append(f'../libs/perfecto_libs')
|
||||
|
||||
pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.interop_ios, pytest.mark.ClientConnectivity]
|
||||
|
||||
from iOS_lib import closeApp, openApp, verifyUploadDownloadSpeediOS, ForgetWifiConnection, Toggle_AirplaneMode_iOS, set_APconnMobileDevice_iOS, verify_APconnMobileDevice_iOS, Toggle_WifiMode_iOS, tearDown
|
||||
|
||||
setup_params_general = {
|
||||
@@ -30,8 +32,6 @@ setup_params_general = {
|
||||
"radius": False
|
||||
}
|
||||
|
||||
@pytest.mark.ClientConnectivity
|
||||
@pytest.mark.interop_iOS
|
||||
@allure.feature("NAT MODE CLIENT CONNECTIVITY")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
@@ -68,7 +68,7 @@ class TestNatMode(object):
|
||||
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa2_personal
|
||||
def test_ClientConnectivity_2g_WPA2_Personal(self, request, get_APToMobileDevice_data, setup_perfectoMobileWeb):
|
||||
def test_ClientConnectivity_2g_WPA2_Personal(self, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -76,22 +76,22 @@ class TestNatMode(object):
|
||||
print ("SSID_NAME: " + ssidName)
|
||||
print ("SSID_PASS: " + ssidPassword)
|
||||
|
||||
report = setup_perfectoMobileWeb[1]
|
||||
driver = setup_perfectoMobileWeb[0]
|
||||
report = setup_perfectoMobile_iOS[1]
|
||||
driver = setup_perfectoMobile_iOS[0]
|
||||
connData = get_APToMobileDevice_data
|
||||
|
||||
#Set Wifi/AP Mode
|
||||
set_APconnMobileDevice_iOS(ssidName, request, ssidPassword, setup_perfectoMobileWeb, connData)
|
||||
set_APconnMobileDevice_iOS(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Verify Upload download Speed from device Selection
|
||||
assert verifyUploadDownloadSpeediOS(request, setup_perfectoMobileWeb, connData)
|
||||
verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#ForgetWifi
|
||||
ForgetWifiConnection(request, setup_perfectoMobileWeb, ssidName, connData)
|
||||
ForgetWifiConnection(request, setup_perfectoMobile_iOS, ssidName, connData)
|
||||
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa
|
||||
def test_ClientConnectivity_2g_WPA(self, request, get_APToMobileDevice_data, setup_perfectoMobileWeb):
|
||||
def test_ClientConnectivity_2g_WPA(self, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -99,22 +99,22 @@ class TestNatMode(object):
|
||||
print ("SSID_NAME: " + ssidName)
|
||||
print ("SSID_PASS: " + ssidPassword)
|
||||
|
||||
report = setup_perfectoMobileWeb[1]
|
||||
driver = setup_perfectoMobileWeb[0]
|
||||
report = setup_perfectoMobile_iOS[1]
|
||||
driver = setup_perfectoMobile_iOS[0]
|
||||
connData = get_APToMobileDevice_data
|
||||
|
||||
#Set Wifi/AP Mode
|
||||
set_APconnMobileDevice_iOS(request, ssidName, ssidPassword, setup_perfectoMobileWeb, connData)
|
||||
set_APconnMobileDevice_iOS(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Verify Upload download Speed from device Selection
|
||||
verifyUploadDownloadSpeediOS(request, setup_perfectoMobileWeb, connData)
|
||||
verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#ForgetWifi
|
||||
ForgetWifiConnection(request, setup_perfectoMobileWeb, ssidName, connData)
|
||||
ForgetWifiConnection(request, setup_perfectoMobile_iOS, ssidName, connData)
|
||||
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa
|
||||
def test_ClientConnectivity_5g_WPA(self, request, get_APToMobileDevice_data, setup_perfectoMobileWeb):
|
||||
def test_ClientConnectivity_5g_WPA(self, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa"][1]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -122,15 +122,15 @@ class TestNatMode(object):
|
||||
print ("SSID_NAME: " + ssidName)
|
||||
print ("SSID_PASS: " + ssidPassword)
|
||||
|
||||
report = setup_perfectoMobileWeb[1]
|
||||
driver = setup_perfectoMobileWeb[0]
|
||||
report = setup_perfectoMobile_iOS[1]
|
||||
driver = setup_perfectoMobile_iOS[0]
|
||||
connData = get_APToMobileDevice_data
|
||||
|
||||
#Set Wifi/AP Mode
|
||||
set_APconnMobileDevice_iOS(request, ssidName, ssidPassword, setup_perfectoMobileWeb, connData)
|
||||
set_APconnMobileDevice_iOS(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Verify Upload download Speed from device Selection
|
||||
verifyUploadDownloadSpeediOS(request, setup_perfectoMobileWeb, connData)
|
||||
verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#ForgetWifi
|
||||
ForgetWifiConnection(request, setup_perfectoMobileWeb, ssidName, connData)
|
||||
ForgetWifiConnection(request, setup_perfectoMobile_iOS, ssidName, connData)
|
||||
@@ -61,8 +61,7 @@ bundleId-iOS-Ping=com.deftapps.ping
|
||||
#browserType-iOS=Safari
|
||||
browserType-iOS=Safari
|
||||
bundleId-iOS-Safari=com.apple.mobilesafari
|
||||
openRoaming-iOS-URL=https://onboard.cicd.lab.wlan.tip.build/ttls/AmeriBand-Profile.mobileconfig
|
||||
openRoaming-and-URL=https://onboard.cicd.lab.wlan.tip.build/aka/androidconfig.cfg
|
||||
|
||||
# Android Device Capabilities
|
||||
platformName-android=Android
|
||||
model-android=Galaxy S20
|
||||
|
||||
77
tools/ap_tools.py
Normal file
77
tools/ap_tools.py
Normal file
@@ -0,0 +1,77 @@
|
||||
#!/usr/bin/python3.9
|
||||
"""
|
||||
|
||||
lf_tools : Tools for Access Point
|
||||
reboot, run_cmd, etc
|
||||
./lf_tools --host 10.28.3.8 --jumphost True --port 22 --username root --password openwifi --action reboot
|
||||
./lf_tools --host 10.28.3.8 --jumphost True --port 22 --username root --password openwifi --action run_cmd --cmd ls
|
||||
|
||||
"""
|
||||
import sys
|
||||
|
||||
if "libs" not in sys.path:
|
||||
sys.path.append("../libs/apnos/")
|
||||
|
||||
import argparse
|
||||
import paramiko
|
||||
from apnos import APNOS
|
||||
|
||||
|
||||
class APTools:
|
||||
|
||||
def __init__(self, host="", port=22, username="root", jumphost=True,
|
||||
password="openwifi", tty="/dev/ttyAP1"):
|
||||
self.host = host
|
||||
self.port = port
|
||||
self.username = username
|
||||
self.password = password
|
||||
self.credentials = {
|
||||
'jumphost': jumphost,
|
||||
'ip': host,
|
||||
'username': username,
|
||||
'password': password,
|
||||
'port': port,
|
||||
'jumphost_tty': tty,
|
||||
|
||||
}
|
||||
self.apnos = APNOS(credentials=self.credentials)
|
||||
|
||||
def run_action(self, action, cmd):
|
||||
if action == "reboot":
|
||||
output, error = self.apnos.reboot()
|
||||
print(output, error)
|
||||
elif action == "run_cmd":
|
||||
[input, output, error] = self.apnos.run_generic_command(cmd=cmd)
|
||||
print(input, output, error)
|
||||
elif action == "get_redirector":
|
||||
redirector = self.apnos.get_redirector()
|
||||
print(redirector)
|
||||
elif action == "set_redirector":
|
||||
[input, output, error] = self.apnos.run_generic_command(cmd=cmd)
|
||||
print(input, output, error)
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(prog="lf_utils",
|
||||
formatter_class=argparse.RawTextHelpFormatter,
|
||||
allow_abbrev=True,
|
||||
epilog="About lf_tools.py",
|
||||
description="Tools for Access Point System")
|
||||
parser.add_argument('--host', type=str, help=' --host : IP Address f LAB Controller / '
|
||||
'Access Point System', default="localhost")
|
||||
parser.add_argument('--jumphost', type=bool, help=' --host : IP Address f Access Point System', default=True)
|
||||
parser.add_argument('--tty', type=bool, help=' --tty : /dev/ttyAP1', default="/dev/ttyAP1")
|
||||
parser.add_argument('--port', type=int, help='--passwd of dut', default=22)
|
||||
parser.add_argument('--username', type=str, help='--username to use on Access Point', default="root")
|
||||
parser.add_argument('--password', type=str, help='--password to the given username', default="openwifi")
|
||||
parser.add_argument('--action', type=str, help='--action to perform'
|
||||
'reboot | run_cmd', default="run_cmd")
|
||||
parser.add_argument('--cmd', type=str, help='--cmd : used when action is "run_cmd"', default="pwd")
|
||||
args = parser.parse_args()
|
||||
lf_tools = APTools(host=args.host, port=args.port, tty=args.tty,
|
||||
username=args.username, jumphost=args.jumphost, password=args.password)
|
||||
lf_tools.run_action(args.action, args.cmd)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
70
tools/lf_tools.py
Normal file
70
tools/lf_tools.py
Normal file
@@ -0,0 +1,70 @@
|
||||
#!/usr/bin/python3.9
|
||||
"""
|
||||
|
||||
lf_tools : Tools for LANforge
|
||||
reboot, run_cmd, etc
|
||||
./lf_tools --host 10.28.3.8 --port 22 --username root --password lanforge --action reboot
|
||||
./lf_tools --host 10.28.3.8 --port 22 --username root --password lanforge --action run_cmd --cmd ls
|
||||
|
||||
"""
|
||||
import argparse
|
||||
import paramiko
|
||||
|
||||
|
||||
class LFTools:
|
||||
|
||||
def __init__(self, host="", port=22, username="root", password="lanforge"):
|
||||
self.host = host
|
||||
self.port = port
|
||||
self.username = username
|
||||
self.password = password
|
||||
|
||||
def ssh_cli_connect(self):
|
||||
client = paramiko.SSHClient()
|
||||
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
print("Connecting to LANforge: %s@%s:%s" % (
|
||||
self.username, self.host, self.port))
|
||||
client.connect(self.host, username=self.username, password=self.password,
|
||||
port=self.port, timeout=10, allow_agent=False, banner_timeout=200)
|
||||
|
||||
return client
|
||||
|
||||
def run_cmd(self, cmd):
|
||||
client = self.ssh_cli_connect()
|
||||
stdin, stdout, stderr = client.exec_command(cmd)
|
||||
output = "Output: " + str(stdout.read())
|
||||
error = "Error: " + str(stderr.read())
|
||||
client.close()
|
||||
return output, error
|
||||
|
||||
def run_action(self, action, cmd):
|
||||
if action == "reboot":
|
||||
output, error = self.run_cmd("reboot")
|
||||
print(output, error)
|
||||
elif action == "run_cmd":
|
||||
output, error = self.run_cmd(cmd)
|
||||
print(output, error)
|
||||
else:
|
||||
print("Invalid Action")
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(prog="lf_utils",
|
||||
formatter_class=argparse.RawTextHelpFormatter,
|
||||
allow_abbrev=True,
|
||||
epilog="About lf_tools.py",
|
||||
description="Tools for LANforge System")
|
||||
parser.add_argument('--host', type=str, help=' --host : IP Address f LANforge System', default="localhost")
|
||||
parser.add_argument('--port', type=int, help='--passwd of dut', default=22)
|
||||
parser.add_argument('--username', type=str, help='--username to use on LANforge', default="root")
|
||||
parser.add_argument('--password', type=str, help='--password to the given username', default="lanforge")
|
||||
parser.add_argument('--action', type=str, help='--action to perform'
|
||||
'reboot | run_cmd', default="run_cmd")
|
||||
parser.add_argument('--cmd', type=str, help='--cmd : used when action is "run_cmd"', default="pwd")
|
||||
args = parser.parse_args()
|
||||
lf_tools = LFTools(host=args.host, port=args.port, username=args.username, password=args.password)
|
||||
lf_tools.run_action(args.action, args.cmd)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Reference in New Issue
Block a user