Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


How do you suggest testing Bash scripts on multiple OS?
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

How do you suggest testing Bash scripts on multiple OS?

AsimAsim Member
edited May 2013 in Help

OK, I have purchased two OVZs from @Nick_A long time ago and they are working fine in providing me "CentOS 5" and "Debian 6" installs to test drive the opensource bash scripts

Now, if I want to test drive it on "CentOS 6", "Debian 7" and "Ubuntu 12.04", I dont want to add three more VMs to my empire. Hence my question to the community, how do you test drive your bash scripts in multiple OS? I cannot spend time installing and reinstalling the VMs with different OSes, which is time taking

Any bright ideas?

Comments

  • rds100rds100 Member

    Get one KVM VPS then you can have multiple OpenVZ VPSes inside with different OSes. You don't need public IPs for these VPSes so no problem.

    Or it could be UML containers inside the OpenVZ

    Or if disk space permits just have the filesystem trees of different OS templaes and then use chroot

    I.e. chroot /images/debian7/ /bin/bash

  • prae5prae5 Member

    virtualbox or similar on your dev machine

  • AsimAsim Member

    @rds100 I remember there was one host who was using such things but OVZ inside KVM, is it good for testing? is it stable? I dont want to put more time configuring this and less time finishing what I want to finish

  • rds100rds100 Member
    edited May 2013

    @Asim there is no reason why it wouldn't be stable.
    It's just a matter of how much resources you have. But in your case this shouldn't be an issue since you probably will not test 20 different OSes in parallel.

  • it might be easier to run a vm at home to test out the script, atlest you wouldn't have to purchase anything to test you your script. https://www.virtualbox.org/ just install the iso for the distribution you want to use and test away.

  • AsimAsim Member
    edited May 2013

    @prae5 @PcJamesy not possible since I live in part of the world where electricity is not available almost half of the day (and we live off UPS and stuff which also dies at times)

    @rds100 Sounds good, let me try this.

  • sleddogsleddog Member

    What exactly is it that you're checking for? Changes to the core of bash -- where some function you're using isn't available on some Linux flavour/version -- or paths to external binaries?

    The former is pretty damn rare in my experience. Especially if you've developed on an older bash and are wondering about compatibility with a newer bash.

    For the latter you can test for binaries using 'which' and exit if not found, with an advisory message.

    But maybe I'm misunderstanding what you mean....

  • hyaohyao Member

    I read somewhere, I think it's Eric Raymond, that says if your bash scripts get large, maybe it's time to start using languages like Python (or Ruby, for that matter).

  • http://www.cygwin.com/

    The Cygwin tools are ports of the popular GNU development tools for Microsoft Windows. They run thanks to the Cygwin library which provides the POSIX system calls and environment these programs expect.
    
    With these tools installed, it is possible to write Windows console or GUI applications that make use of significant parts of the POSIX API. As a result, it is possible to easily port many Unix programs without the need for extensive changes to the source code. This includes configuring and building most of the available GNU software (including the packages included with the Cygwin development tools themselves) as well as lots of BSD tools and packages (including OpenSSH). Even if the development tools are of little to no use to you, you may have interest in the many standard POSIX utilities provided with the package. They can be used from one of the provided Unix shells like bash, tcsh or zsh, as well as from the standard Windows command shell if you have to for some sad reason.
    
  • snelwegsnelweg Member

    Now, if I want to test drive it on "CentOS 6", "Debian 7" and "Ubuntu 12.04", I dont want to add three more VMs to my empire. Hence my question to the community, how do you test drive your bash scripts in multiple OS? I cannot spend time installing and reinstalling the VMs with different OSes, which is time taking

    Any bright ideas?

    Ummm, use cfengine instead of baking your own scripts? CF knows what kind of machine it is running on, you can make a centrally maintained script that will be distributed to all the machines that are connected.

  • nunimnunim Member
    edited May 2013

    Best thing I've found is to find a nice SSD OVZ host, reinstall rarely takes more then 15 seconds.

    RamNode usually works great for this.

  • AbdussamadAbdussamad Member
    edited June 2013

    @Asim said:
    prae5 PcJamesy not possible since I live in part of the world where electricity is not available almost half of the day (and we live off UPS and stuff which also dies at times)

    >

    What does that mean? I live in Karachi and use virtualbox all the time. It's great for testing shit. You don't have to install guest OSes multiple times. You just make one install and then clone it every time you want to customize it or test something that might potentially break things.

    As far as downloading goes downloads usually resume from the point of interruption. If that's not happening for you you should download via torrents.

    Another thing you can do is download the net install disc for each distro. This is smaller and will pull the rest of the packages during installation based on what you need.

  • AsimAsim Member
    edited June 2013

    Thanks all, I am test driving the OVZ on KVM approach

    @Abdussamad I guess you have no idea how much Lahore is effected with loadshedding and unannounced power outages. So right now, for the record, I have 4 x 1KVA UPS for each bedroom and the living room + I dedicated UPS for all the modems, Raspberry-Pis and the laptop. Each UPS gives me 2 hours of backup. Even then I am not 100% up all the time duh

  • rds100rds100 Member

    @Asim sounds like you need a generator then :) No idea what the gasoline/diesel costs there though.

  • AsimAsim Member

    @rds100 yes, as a backup generator is there but the fuel costs are too high here. a little over $1 per litre of fuel. UPS are more economical

    Thanks for the advice on OVZoverKVM, still not finished doing this yet but seems like the way to go

  • @Asim said:
    Thanks all, I am test driving the OVZ on KVM approach

    Abdussamad I guess you have no idea how much Lahore is effected with loadshedding and unannounced power outages.

    Still no power for 12hours per day? or did it get better now?

  • @Asim That's a sad story.

    If you have any specific scripts that you need tested PM me and I'll do what I can. I have an unused VPS that is currently just sitting there.

  • @Asim said:
    the fuel costs are too high here. a little over $1 per litre of fuel.

    Can you ship me around 10.000 liters for that price?

    LowEndDiesel.com is available

  • AsimAsim Member

    @William yes, we have energy crisis. So while some areas and cities which are politically influenced may see 30min of power outage, some major cities have 12 hours of power outage per day (one hour of electricity after one hour of blackout).

    @snelweg LOL, I wish I could do that. Please note its litre and not gallon

    @Abdussamad sure, will let you know. Right now I am following @rds100's awesome suggestion and successfully deployed OVZ on @torqhost KVM but the networking is not working in the containers. Banging my head to get that working. Lets see

  • AsimAsim Member

    If anyone can help me track down what wrong, I would be obliged!!
    image

  • @Asim said:
    snelweg LOL, I wish I could do that. Please note its litre and not gallon

    We pay $1.80 per liter for diesel and $ 2.27 per liter for gasoline. So, there is a proffit to be made for LET / LEB minded people, it's all in the volume.

  • rds100rds100 Member

    @Asim did you add an ip address to the container?
    vzctl set 101 --ipadd 192.168.1.101 --save

  • AsimAsim Member

    @rds100 thanks, you are awesome

Sign In or Register to comment.