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