Explorar o código

Issues caused due to random generator

function random() {
    head /dev/urandom | tr -dc A-Za-z0-9 | head -c$1
}
to be replaced with
function random() {
   head /dev/urandom | tr -dc 0-9 | head -c$1
}
System expects an number
Jaap Marcus %!s(int64=5) %!d(string=hai) anos
pai
achega
11cae65d14
Modificáronse 2 ficheiros con 2 adicións e 2 borrados
  1. 1 1
      test/test.bats
  2. 1 1
      test/test_actions.sh

+ 1 - 1
test/test.bats

@@ -6,7 +6,7 @@ load 'test_helper/bats-file/load'
 
 
 
 
 function random() {
 function random() {
-    head /dev/urandom | tr -dc A-Za-z0-9 | head -c$1
+    head /dev/urandom | tr -dc 0-9 | head -c$1
 }
 }
 
 
 function setup() {
 function setup() {

+ 1 - 1
test/test_actions.sh

@@ -7,7 +7,7 @@ V_TEST="$HESTIA/test"
 
 
 # Define functions
 # Define functions
 random() {
 random() {
-    head /dev/urandom | tr -dc A-Za-z0-9 | head -c$1
+    head /dev/urandom | tr -dc 0-9 | head -c$1
 }
 }
 
 
 echo_result() {
 echo_result() {