예제 #1
0
파일: BusyBoxTests.cs 프로젝트: sttt/madb
        public void ExecuteRemoteCommandTest( )
        {
            Device  device  = GetFirstDevice( );
            BusyBox busyBox = new BusyBox(device);

            ConsoleOutputReceiver creciever = new ConsoleOutputReceiver( );

            Console.WriteLine("Executing 'busybox':");
            bool hasBB = false;

            try {
                device.ExecuteShellCommand("busybox", creciever);
                hasBB = true;
            } catch (FileNotFoundException) {
                hasBB = false;
            } finally {
                Console.WriteLine("Busybox enabled: {0}", hasBB);
            }


            Console.WriteLine("Executing 'busybox ls': ");
            try {
                busyBox.ExecuteShellCommand("ls", creciever);
            } catch (Exception ex) {
                Console.WriteLine(ex.Message);
                throw;
            }
        }
예제 #2
0
파일: BusyBoxTests.cs 프로젝트: phaufe/madb
        public void ExecuteRemoteCommandTest( )
        {
            Device device = GetFirstDevice ( );
            BusyBox busyBox = new BusyBox(device);

            ConsoleOutputReceiver creciever = new ConsoleOutputReceiver ( );

            Console.WriteLine ( "Executing 'busybox':" );
            bool hasBB = false;
            try {
                device.ExecuteShellCommand ( "busybox", creciever );
                hasBB = true;
            } catch ( FileNotFoundException ) {
                hasBB = false;
            } finally {
                Console.WriteLine ( "Busybox enabled: {0}", hasBB );
            }

            Console.WriteLine ( "Executing 'busybox ls': " );
            try {
                busyBox.ExecuteShellCommand ( "ls", creciever );
            } catch ( Exception  ex) {
                Console.WriteLine ( ex.Message );
                throw;
            }
        }
예제 #3
0
파일: BusyBoxTests.cs 프로젝트: phaufe/madb
        public void GetCommandsTest( )
        {
            Device device = GetFirstDevice ( );
            BusyBox busyBox = new BusyBox(device);

            bool avail = busyBox.Available;
            Assert.IsTrue ( avail, "BusyBox is not available" );

            foreach ( var item in busyBox.Commands ) {
                Console.Write ( "{0},", item );
            }

            Assert.IsTrue ( avail && busyBox.Commands.Count > 0 );
        }
예제 #4
0
파일: BusyBoxTests.cs 프로젝트: phaufe/madb
        public void InstallTest( )
        {
            Device device = GetFirstDevice ( );
            BusyBox busyBox = new BusyBox(device);

            bool avail = busyBox.Available;
            if ( !avail ) {
                bool result = busyBox.Install ( "/sdcard/busybox" );
                Assert.IsTrue ( result, "BusyBox Install returned false" );
            }

            device.ExecuteShellCommand ( "printenv", new ConsoleOutputReceiver ( ) );

            Assert.IsTrue ( busyBox.Available, "BusyBox is not installed" );
        }
예제 #5
0
        public void GetCommandsTest()
        {
            Device  device  = GetFirstDevice();
            BusyBox busyBox = new BusyBox(device);

            bool avail = busyBox.Available;

            Assert.True(avail, "BusyBox is not available");

            foreach (var item in busyBox.Commands)
            {
                Console.Write("{0},", item);
            }

            Assert.True(avail && busyBox.Commands.Count > 0);
        }
예제 #6
0
파일: BusyBoxTests.cs 프로젝트: sttt/madb
        public void InstallTest( )
        {
            Device  device  = GetFirstDevice( );
            BusyBox busyBox = new BusyBox(device);

            bool avail = busyBox.Available;

            if (!avail)
            {
                bool result = busyBox.Install("/sdcard/busybox");
                Assert.IsTrue(result, "BusyBox Install returned false");
            }

            device.ExecuteShellCommand("printenv", new ConsoleOutputReceiver( ));

            Assert.IsTrue(busyBox.Available, "BusyBox is not installed");
        }