Posts

Showing posts from 2013

Testing your web app with Selenium

Image
Selenium is a web testing toolkit. This week I tried to use Selenium tools to create a test scenario that actually automates the web browser in order to populate test database. Similar to many open source tools, it has its rough edges. My first problem is automating the jquery UI datepicker. Recording with Selenium IDE gives a result that is not too reliable : It isn't easy to change the month or day in this test script. Running this script failed with error message that Selenium couldn't find the '1' link. The '1' is actually a clickable td but the script assumed it was a HTML link (a tag). Finding other sources, I replaced the last row with click css=td.day:contains("1"). Which sometimes doesn't work correctly because sometimes it choose the 31 cell instead of 1 cell. After a while I settled by a runScript command that invokes jQuery to set the datepicker value : runScript $("Request_kembali").val("2013-01-01"); The

Installing Saprfc on CentOS 6

Our PHP web servers were powered by Linux, either Red Hat Enterprise Linux or CentOS Linux. Normally we use 5.x version of CentOS or RHEL, but after a few years running 5.x we decided that its now time to upgrade to 6.x. The first problem we encounter is that the SAPCAR utility shows loading shared libraries error. ./SAPCAR_1-20002087.EXE RFC_45-10003377.SAR ./SAPCAR_1-20002087.EXE: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory Checking the EXE file (actually is a Linux ELF binary but with misleading extension) with LDD, we find that : [root@myserver opt]# ldd SAPCAR_1-20002087.EXE         linux-gate.so.1 =>  (0x00e81000)         libdl.so.2 => /lib/libdl.so.2 (0x00d05000)         librt.so.1 => /lib/librt.so.1 (0x00317000)         libstdc++.so.6 => not found         libm.so.6 => /lib/libm.so.6 (0x003b0000)         libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x0083d000)         libpthread.so.0 =&g

First OpenBravo Experiences

What is Openbravo OpenBravo is an open source ERP software, in the same market as Compiere and TinyERP. This post describes my experiences trying OpenBravo to do Sales Order and Purchase Order Process. First thing I notice is that it is built on the Java Platform, and uses PostgreSQL database. There is a little inconvenience because I never really used PostGreSQL before.  Creating a new company (Organization) Openbravo's concept were similar to SAP's multi company capabilities. We could create more than one company (organization in OpenBravo's terms) in the ERP syatem. But creating a new company has some hidden challenges.  First, the newly created company, if it is incomplete, will be unavailable from some screen. It is a little confusing but it is to be expected on a complex ERP system. We could create a new company from the General Setup : Enterprise Model : Initial Organization Setup menu.  Filling the blanks and the checkboxes, we could create the company in th

SE Linux Cure (mini mini post)

I think its only natural for admins to avoid SELinux. Having SELinux enabled can make your simplest changes resulting in system failures. Or maybe even no change at all (no changes that you remember..). The Cure In the past, I depend upon a few commands that might shed some light on SELinux troubles. The commands are : ls -Z : this parameter shows additional column, named the security context, that is owned by each file chcon : this command changes a file's context to the given context argument. Example, chcon -t mysqld_db_t mysql - this command sets the security context of the mysql directory to mysqld_db_t restorecon : this command restores a file's context to default But a recent trouble opened my mind that more tools are needed. For example, in Ubuntu systems, we might need to poke the directory /etc/apparmor.d and edit rule files there. In recent CentOS trouble, these commands are handy : yum install setroubleshoot - this installs sealert, semanage tools

MySQL Corrupt Tables and How to Avoid it

Once in a while MySQL's tables became corrupted. This post is not interested in repair process (you should see other posts, but the most general advice is to do a REPAIR TABLE table ; ) In my humble opinion, a real life production database must not have any corruption, it must have sufficient failsafe mechanisms to avoid such corruption. Causes of Corruption MyISAM tables could became corrupted by  (refer http://dev.mysql.com/doc/refman/5.1/en/corrupted-myisam-tables.html) : mysqld is being killed in the middle of write unexpected computer shutdown occured hardware failures running an external program (example: myisamchk) while mysqld is running software bug in Mysql/myISAM code Tips to mitigate data corruption Do not use MyISAM for long lasting data. Use InnoDB. InnoDB is less corruption prone than MyISAM.  Use file per table option for InnoDB. Check your disk space and database availability periodically. On one occasion, my mysql data partition is full, and

Learning Cloud Foundry - NATS

All Cloud Foundry components communicates with each other using NATS publish-subscribe mechanism. Lets see in detail what is NATS like. Cloud Foundry Router as NATS client During startup of Cloud Foundry Router ( router.rb ), there is a call to start NATS client below : NATS . start ( :uri => config [ 'mbus' ] ) It means that NATS client will be started with the uri parameter obtained from configuration parameter 'mbus'.  config_path = ENV [ "CLOUD_FOUNDRY_CONFIG_PATH" ] || File . join ( File . dirname ( __FILE__ ), '../config' ) config_file = File . join ( config_path , 'router.yml' ) ... opts . on ( "-c" , "--config [ARG]" , "Configuration File" ) do | opt |      config_file = opt    end ... We find that the configuration parameter will be read from a YAML (yet Another Markup Language) that whose location could came from multiple sources, in these order : specified fro

Learning Cloud Foundry Router

Background The Cloud Foundry PaaS platform serves web applications. The Cloud Foundry router components is different from a router in the plain IT-talk, the Cloud Foundry router is a Ruby-based software component that determines which backend droplet that should serve (each and every) http request that are requested to one of the applications deployed on the platform. Starting Point In order to understand the mechanism of the router, we start from nginx, the http server that serves as the primary gatekeeper. Nginx configuration is my primary concern. So lets see the vcap source code that describes nginx configuration on each and every Cloud Foundry server. In the vcap/dev_setup/cookbooks/nginx folder we found a templates directory that stores nginx configuration templates.  The templates I suppose being used by the dev_setup installation procedure. Configuration templates We have cc-nginx.conf.erb Ruby template along with router-nginx.conf.erb template and some other

Learning Cloud Foundry PHP staging and deployment

Image
Background VMWare Cloud Foudry is an open source Platform for PaaS (platform as a service). I see cloud foundry as a tool to simplify multiple application deployment in multiple servers. This post will describe things I found by reading source code of vcap (Vmware Cloud Application Platform) at github here and here . My point of interest is php deployment capability that exists on vcap, which are contributed by phpfog developers. My previous exploration of Cloud Foundry resulted in this picture below, which describe  my current understanding of the Cloud Foundry platform. Starting point The starting point of php support is given an interesting commit I had seen before, where phpfog team implements php functionality. At first it took me about 10 minutes browsing the vcap network graph (https://github.com/cloudfoundry/vcap/network), then I just realized there is a distinct phpfog branch in the vcap git..  The interesting commit is titled 'Support for deploying PH