cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
950
Views
0
Helpful
5
Replies

I have deployed the ova with the factorial app. Now how do I test it?

Hi everyone,

Hey guys, I am having some problems on how to run the factorial application. I have installed the sdk, and I have also built the factorial app as described in the cookbook.

After building the app, I run this command (I source iox_sdk_env before running the following command)

imgb.sh -c repack-rootfs -f ~/Projects/cisco/cisco_iox_sdk-x86_64-v0.1/images/e500v2_linux_guest/archives/e500v2-linux-guest.rootfs -o /tmp/myiox-app/e500v2-linux-guest.rootfs -s ./imgb_cb_script.sh

and I get the following output:

/home/user/Projects/cisco/cisco_iox_sdk-x86_64-v0.1/tools/scripts/imgb.sh: line 216: return: -1: invalid option

return: usage: return [n]

/home/user/Projects/cisco/cisco_iox_sdk-x86_64-v0.1/tools/scripts/imgb.sh: line 216: return: -1: invalid option

return: usage: return [n]

***************************************************************************

Step 1. Extracting rootfs: /home/user/Projects/cisco/cisco_iox_sdk-x86_64-v0.1/images/e500v2_linux_guest/archives/e500v2-linux-guest.rootfs under: /home/user/iox_c/src/rootfs.ext.20150421-112941...

***************************************************************************

47865 blocks

***************************************************************************

Step 2. Invoking user's script: ./imgb_cb_script.sh /home/user/iox_c/src/rootfs.ext.20150421-112941

***************************************************************************

This is test script received args : /home/user/iox_c/src/rootfs.ext.20150421-112941

AM i running under fakeroot?./imgb_cb_script.sh: line 7: [: missing `]'

yes, FAKEROOTKEY:660159935

**************************************

Script completed with exit status: 0

**************************************

***************************************************************************

Step 3. Packing rootfs: /tmp/myiox-app/e500v2-linux-guest.rootfs

***************************************************************************

Packing rootfs: /tmp/myiox-app/e500v2-linux-guest.rootfs with content at: /home/user/iox_c/src/rootfs.ext.20150421-112941...

/bin/cpio: File ./initramfs.cpio grew, 24512512 new bytes not copied

95754 blocks

I have attached the imgb_cb_script.sh.

Now I generate the OVA file with the new rootfs, by issuing the following command:

packing.sh -a 0 -s ~/Projects/cisco/cisco_iox_sdk-x86_64-v0.1/tools/verifier/ /tmp/myiox-app/

And here's the output:

packing.sh v1.8(Linux) - Create a virtual-service OVA package

Note: use the version of <binos_root>/vman/packing.sh from the LABEL

      that corresponds to the version of VMAN code in the OVA.

      If the code is the latest then use:

      "$(/auto/binos-tools/bin/mcp_latest_success)/vman/packing.sh"

Found utility: shasum at: /usr/bin/shasum

Found utility: xmllint at: /usr/bin/xmllint

User inputs:

  Algorithm=No SHA

  Key=dev

  Compress=(files > '10M' if total file size > '600M')

  Directory=/tmp/myiox-app/

  Fishbowl signing=no

  Fishbowl username=

  Fishbowl password=

platform.xml is not located.

Schema path is '/home/user/Projects/cisco/cisco_iox_sdk-x86_64-v0.1/tools/verifier/'

Verifying 'test.xml' Machine Definition:

Note: XML Machine Definition 'test.xml' has profiles

Validating with '/home/user/Projects/cisco/cisco_iox_sdk-x86_64-v0.1/tools/verifier//ciscodefinition.rng'

test.xml validates

Valid manifest file app_manifest.yaml found

Running SHA1 over all files in '/tmp/myiox-app' and

    creating manifest file 'test.mf', please wait...

Done creating 'test.mf' file

Note: total directory size '19M' is not greater than '600M', files will not be compressed.

Creating 'test.ova' please wait...

app_manifest.yaml

e500v2-linux-guest.rootfs

e500v2-linux-guest.uImage

test.mf

test.ver

test.xml

'/tmp/myiox-app/test.ova' created

Manifest Contents:

SHA1(app_manifest.yaml)= 9b7d96cf2c85509b2c8c1a5b7000ad024dee4ad6 

SHA1(e500v2-linux-guest.rootfs)= c58a83fc429ffd639df503da98b87fde264f76c9 

SHA1(e500v2-linux-guest.uImage)= 1aa03627001e4f565ba7b9c39222e80cf887d615 

SHA1(test.ver)= 61652cd1568dcf2614df833eba241755eee34e89 

SHA1(test.xml)= f37b1b5c41e4a63c8b50e78a6edd7a54692fb12c 

This output tells me that the ova file test.ova is now created. And indeed it is created. I then deploy the ova on the router, and after deploying the app, I start the application from the cisco router web portal. But there is not output to check. I then use minicom to log into the router, and I check to see if there is any log file in /data/ directory. There isn't any.

(The factorial code created a log file in /data/ directory "fptr=fopen("/data/app.log", "w");")

How can I make sure that my application has been repacked correctly in the new rootfs, and the test.ova is created properly. How can I verify that the app is running?

Any help is greatly appreciated. Thanks.

I have also attached imgb.sh script, the makefile used to generate the factorial binary using the toolchain, and the code of factorial.

Everyone's tags (2)
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: I have deployed the ova with the factorial app. Now how do I test it?

Hi all,

In my previous post, I was not able to find the binary 'factorial.bin' (following the factorial example from the cookbook) in /usr/bin (on the linux context of the Cisco 819 router).

Actually, the issue is now resolved.

The problem was during the copy of the binary in the rootfs '/usr/bin' target directory during the rootfs re-packaging.

The script 'imgb_cb_script.sh' wasn't correctly executed (fakeroot test and copy of the binary in the rootfs /usr/bin directory).

I forgot to call the main function with the args in this script (main $*).

PROBLEM SOLVED. Hope it will help someone.

Thanks.

Cheers,

Adrien

View solution in original post

5 REPLIES 5
Highlighted
Cisco Employee

Re: I have deployed the ova with the factorial app. Now how do I test it?

HI Atul,

I understand you created the ova application successfully, and deployed it the application on C819 through Local App Manager. But you need to access the Guess OS (run "virtual-service connect name yourappname console" to access the Guess OS) to check the log after that, not in the IOS. Please refer to the chapter 4.10 of 819-IOx-SDK-Cookbook.docx for details.

Thanks,

Steve

Highlighted

Re: I have deployed the ova with the factorial app. Now how do I test it?

Hi thanks a lot for replying,

I did manage to run the app from the OVA, by logging into the console of the router and running it as command. I figured out that the imgb_cb_script copied the factorial.bin to /usr/bin of the rootfs.

Thanks again.

Highlighted
Cisco Employee

Re: I have deployed the ova with the factorial app. Now how do I test it?

Hi Atul,

As you mentioned, the ova application is created, deployed, and started successfully. It means the guest OS is started.

But not sure if you run the factorial code yet. You should run the bin file manually: /usr/bin/factorial.bin. Please try it.

Meanwhile, you may use any example bin file which is compiled by the C819 IOx SDK toolchain, put it in the guest OS (wget is supportable), make it executable, and run it for further testing. If you really did not run it successfully, you may add some print information for debug.

Thanks,

Steve

Highlighted

Re: I have deployed the ova with the factorial app. Now how do I test it?

Hi Steve,

I've got a Cisco 4G LTE M2M since a few days.

I'm trying to get started with the SDK (also following the Cookbook 819 procedure with the factorial example).

I guess that all the process to generate the OVA is correct...

Here is my result:

Rootfs :


root@adrien-VirtualBox:~/iox_c/src# ./imgb.sh -c repack-rootfs -f /opt/ciscoiox/cisco_iox_sdk-x86_64-v0.1/images/e500v2_linux_guest/archives/e500v2-linux-guest.rootfs -o /root/myiox-app/e500v2-linux-guest.rootfs -s ./imgb_cb_script.sh

***************************************************************************

Step 1. Extracting rootfs: /opt/ciscoiox/cisco_iox_sdk-x86_64-v0.1/images/e500v2_linux_guest/archives/e500v2-linux-guest.rootfs under: /root/iox_c/src/rootfs.ext.20150803-113247...

***************************************************************************

47864 blocks

***************************************************************************

Step 2. Invoking user's script: ./imgb_cb_script.sh /root/iox_c/src/rootfs.ext.20150803-113247

***************************************************************************

This is a test script, received args: /root/iox_c/src/rootfs.ext.20150803-113247

**************************************

Script completed with exit status: 0

**************************************

***************************************************************************

Step 3. Packing rootfs: /root/myiox-app/e500v2-linux-guest.rootfs

***************************************************************************

Packing rootfs: /root/myiox-app/e500v2-linux-guest.rootfs with content at: /root/iox_c/src/rootfs.ext.20150803-113247...

47864 blocks

root@adrien-VirtualBox:~/iox_c/src# ls

factorial.bin  imgb_cb_script.sh  Makefile.bakup              sdkchk.sh

factorial.c    imgb.sh            packing.sh

factorial.o    Makefile           rootfs.ext.20150803-113247

----

OVA generation:


root@adrien-VirtualBox:~/iox_c/src# ./packing.sh -a 0 -s /opt/ciscoiox/cisco_iox_sdk-x86_64-v0.1/tools/verifier /root/myiox-app/

packing.sh v1.8(Linux) - Create a virtual-service OVA package

Note: use the version of <binos_root>/vman/packing.sh from the LABEL

      that corresponds to the version of VMAN code in the OVA.

      If the code is the latest then use:

      "$(/auto/binos-tools/bin/mcp_latest_success)/vman/packing.sh"

Found utility: shasum at: /usr/bin/shasum

Found utility: xmllint at: /usr/bin/xmllint

User inputs:

  Algorithm=No SHA

  Key=dev

  Compress=(files > '10M' if total file size > '600M')

  Directory=/root/myiox-app/

  Fishbowl signing=no

  Fishbowl username=

  Fishbowl password=

platform.xml is not located.

Schema path is '/opt/ciscoiox/cisco_iox_sdk-x86_64-v0.1/tools/verifier'

Verifying 'test.xml' Machine Definition:

Note: XML Machine Definition 'test.xml' has profiles

Validating with '/opt/ciscoiox/cisco_iox_sdk-x86_64-v0.1/tools/verifier/ciscodefinition.rng'

test.xml validates

Valid manifest file app_manifest.yaml found

Running SHA1 over all files in '/root/myiox-app' and

    creating manifest file 'test.mf', please wait...

Done creating 'test.mf' file

Creating 'test.ova' please wait...

app_manifest.yaml

e500v2-linux-guest.rootfs

e500v2-linux-guest.uImage

test.mf

test.ver

test.xml

'/root/myiox-app/test.ova' created

After that, I deployed 'test.ova' on the router via the Cisco Application Manager (status is RUNNING).

Connecting to the VM's interface also succeed with the command:

virtual-service connect name devapp console

After that, when I'm in the Linux context,

How can I test or launch my factorial application (I can't see the '/data/app.log' file written with the app, so my conclusion is that the program never started)?

Moreover, in the Cisco Application Manager, Manage>Show logs for the deployed and running application, I can't see any log.

I also read your post, but I'm unable to find the binary in the Linux context in order to start the program.

After deployment via the web interface, what's the procedure to start the factorial program and see the result?

Thanks in advance.

Best regards,

Adrien van den Haak

Highlighted

Re: I have deployed the ova with the factorial app. Now how do I test it?

Hi all,

In my previous post, I was not able to find the binary 'factorial.bin' (following the factorial example from the cookbook) in /usr/bin (on the linux context of the Cisco 819 router).

Actually, the issue is now resolved.

The problem was during the copy of the binary in the rootfs '/usr/bin' target directory during the rootfs re-packaging.

The script 'imgb_cb_script.sh' wasn't correctly executed (fakeroot test and copy of the binary in the rootfs /usr/bin directory).

I forgot to call the main function with the args in this script (main $*).

PROBLEM SOLVED. Hope it will help someone.

Thanks.

Cheers,

Adrien

View solution in original post

CreatePlease to create content
This widget could not be displayed.