Skip to content

added first test for junos #93

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from comfy.compliance import medium


@medium(
name='rule_1_1_ensure_device_is_running_current_junos_software',
platform=['juniper_junos'],
commands=dict(chk_cmd='show version')
)
def rule_1_1_ensure_device_is_running_current_junos_software(commands, ref):
assert '21.4' in commands.chk_cmd, ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
.rule_1_1_ensure_device_is_running_current_junos_software

Reference: DATA
ORIES
S&cat=SIRT_1&detail=content

Remediation: Software patching procedures may vary between different platforms or organizations and
can be accomplished using the CLI, the JWeb GUI, centrally through Junos Space or other
management platforms.
To update a standalone JUNOS Device through the CLI, first upload the desired software
image (downloaded from Juniper or your Support Partner) to the JUNOS Device in the
/var/tmp/ folder.
In most cases an upgrade is performed with the following command, issued from
Operational Mode:
user@host> request system software add /var/tmp/<image name>
Where <image name> is the filename of the JUNOS image provided by Juniper.
NOTE - Updating JUNOS Software with this command will result in a reboot of the system
and loss of service.
In platforms deployed with redundant Routing Engines, as Virtual Chassis or as HA
Clusters, an In-Service Software Updates (or ISSU) may be supported. An ISSU update
updates and reboots each node or RE separately, failing services on to the other node/RE
prior to the reboot.
To perform an ISSU Update, on most platforms, issue the following command from
Operational Mode:
user@host> request system software in-service-upgrade /var/tmp/<image name>



NOTE - The specific procedure and prerequisites for ISSU varies by platform and deployment
type. If some prerequisites (such as NSR or GRES) are not correctly configured a loss of
service may still occur.
Please refer to the documentation for your platform and network enviroment before
attempting to update software.

.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
defaults:
devices:
- ipaddress: 192.168.1.1
platform: juniper_junos
tenant: default

tests:
rule_1_1_ensure_device_is_running_current_junos_software:
- outcome: OK
commands:
show version: 21.4R3-S2.9
- outcome: TESTS_FAILED
commands:
show version: 18.2R3-S2.9
Loading