~anjan/sxmo-check

fe916901b25ea6543fc5650e284e2393987a7074 — Anjandev Momi 2 years ago 390c6f1
add pin test COMMAND DOESNT WORK
2 files changed, 24 insertions(+), 0 deletions(-)

A lib/pin.sh
A spec/pin_spec.sh
A lib/pin.sh => lib/pin.sh +11 -0
@@ 0,0 1,11 @@
#!/bin/sh

enablePinSim() {
	SIM="$(mmcli -m any | grep -oE 'SIM\/([0-9]+)' | cut -d'/' -f2)"
	mmcli -i "$SIM" --pin 1234 --enable-pin 1234
}

disablePinSim() {
	SIM="$(mmcli -m any | grep -oE 'SIM\/([0-9]+)' | cut -d'/' -f2)"
	mmcli -i "$SIM" --pin 1234 --disable-pin
}

A spec/pin_spec.sh => spec/pin_spec.sh +13 -0
@@ 0,0 1,13 @@
Describe "sxmo_unlocksim.sh"
	Include lib/pin.sh

	It 'enables Pin'
		When call enablePinSim ShellSpec
		The status should be success
	End
	It 'disables Pin'
		When call disablePinSim ShellSpec
		The status should be success
	End

End