Blame tests/p_busybox/20_functiontest_busybox.sh

Christoph Galuschka 886019
#!/bin/sh
Christoph Galuschka 886019
# Author: Athmane Madjoudj <athmanem@gmail.com>
Christoph Galuschka 886019
# Author: Christoph Galuschka <christoph.galuschka@chello.at>
Christoph Galuschka 886019
Christoph Galuschka 886019
t_Log "Running $0 - busybox functional tests: busybox provided functions are working."
Christoph Galuschka 886019
Christoph Galuschka 442e3b
Christoph Galuschka 442e3b
ret_val=0
Christoph Galuschka 886019
busybox | grep -q 'ls,'
Christoph Galuschka 442e3b
if [ $? == 0 ]
Christoph Galuschka 886019
  then
Christoph Galuschka 886019
  t_Log "busybox provides 'ls'; testing it"
Christoph Galuschka 886019
  touch /var/tmp/busybox
Christoph Galuschka 886019
  busybox ls /var/tmp/ |grep -q busybox
Christoph Galuschka 442e3b
  if [ $? == 1 ]
Christoph Galuschka 886019
    then
Christoph Galuschka 886019
    t_Log "busybox provides 'ls' but it does not seem to work"
Christoph Galuschka 442e3b
    ret_val=1
Christoph Galuschka 886019
  else
Christoph Galuschka 886019
    t_Log "'ls' works"
Christoph Galuschka 886019
  fi
Christoph Galuschka 886019
  #cleaning up
Christoph Galuschka 886019
  /bin/rm /var/tmp/busybox
Christoph Galuschka 886019
fi
Christoph Galuschka 886019
Christoph Galuschka 886019
busybox | grep -q 'touch,'
Christoph Galuschka 442e3b
if [ $? == 0 ]
Christoph Galuschka 886019
  then
Christoph Galuschka 886019
  t_Log "busybox provides 'touch'; testing it"
Christoph Galuschka 886019
  busybox touch /var/tmp/busybox
Christoph Galuschka 886019
  ls /var/tmp/ |grep -q busybox
Christoph Galuschka 442e3b
  if [ $? == 1 ]
Christoph Galuschka 886019
    then
Christoph Galuschka 886019
    t_Log "busybox provides 'touch' but it does not seem to work"
Christoph Galuschka 442e3b
    ret_val=1
Christoph Galuschka 886019
  else
Christoph Galuschka 886019
    t_Log "'touch' works"
Christoph Galuschka 886019
  fi
Christoph Galuschka 886019
  #cleaning up
Christoph Galuschka 886019
  /bin/rm /var/tmp/busybox
Christoph Galuschka 886019
fi
Christoph Galuschka 442e3b
Christoph Galuschka 442e3b
t_CheckExitStatus $ret_val
Christoph Galuschka 886019